Validation and Discretization¶
Validation checks an AHSProgram or lowered ProgramIR against a TargetSpec. It reports typed diagnostics for register geometry, atom count and spacing, waveform time/value shape, parameter binding, control support, measurement basis, and shot count. Validation does not mutate the program.
Waveforms and Parameters¶
Constant, linear, piecewise-constant, piecewise-linear, and interpolated waveforms require finite values and increasing sample times. The final sample time must match the declared duration. Interpolated waveforms use shape-preserving PCHIP semantics; concatenation accepts compatible non-overlapping segments and enforces the documented point limit.
Parameter is the canonical declaration type across Digital, Analog, and Hybrid APIs. Names, data types, units, bounds, defaults, expressions, and targets are checked before lowering. Binding returns a separate bound object; mutability depends on the builder or result type. Missing, duplicate, undeclared, incompatible-unit, and out-of-range values fail with structured diagnostics or typed exceptions before execution.
Site-Addressed Controls¶
SitePattern supplies one weight for every filled site. SiteMask.constant() and SiteMask.piecewise() lower sparse identifiers to dense addressing in active-site order. Validation rejects unknown, inactive, duplicate, or incomplete site references. Public Target checks also cover declared channel support, concurrency, mutual exclusion, bandwidth, slew, and crosstalk policy; they do not allocate production channels or load private calibration.
Discretization¶
Discretization projects supported fields onto Target grids and returns a new program plus DiscretizationReport. Policies are nearest, floor, ceil, and strict. The strict policy reports DISCRETIZATION_STRICT_GRID_MISMATCH instead of changing an off-grid value.
Local simulators validate their input before allocating large state arrays. Reference compilation accepts only validated and supported semantics; unsupported local controls, channel kinds, measurements, or unbound values stop before submission construction.