qat.experimental.system_data.materialisers.model.validation module

Structural and referential validation for canonical system data.

The public entry point is validate(). All other functions are internal helpers.

Validation rules

  • Structural presence – qubits, ports, channels, and oscillators must be present.

  • Acquire limitacquire_limit must be -1 (unlimited) or strictly positive.

  • Portssample_time strictly positive; block_size / min_blocks at least one; max_blocks either -1 or at least one; min_blocks <= max_blocks when bounded.

  • Oscillatorsfrequency strictly positive.

  • Channelsfrequency non-negative; port_id and oscillator_reference must resolve to declared resources.

  • Modeschannel_id must resolve to a declared channel; nested waveform and acquire definitions and post-processing methods are bounds-checked.

  • Couplingssource_qubit_id / target_qubit_id must resolve to declared qubits.

  • Readout probabilities – probabilities within [0, 1] and normalised per prepared state.

Warning-level rules flag missing coupling fidelities and inconsistent port sample times.

validate(model)

Validate a canonical system data model.

Enforces structural, field-level, and referential invariants on CanonicalSystemData. Fatal issues raise MaterialisationValidationError (field-level bounds) or MaterialisationConsistencyError (referential integrity and cross-entry consistency). Non-fatal issues are logged as warnings and do not block usage.

Parameters:

model (CanonicalSystemData) – The CanonicalSystemData model to validate.

Return type:

None