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 limit – acquire_limit must be -1 (unlimited) or strictly positive.

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

  • Oscillators – frequency strictly positive.

  • Identity – top-level resource identifiers must be unique.

  • External resources – port and oscillator external-resource references must resolve.

  • Channels – frequency non-negative; port_id and oscillator_reference must resolve to declared resources.

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

  • Couplings – source_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