qat.experimental.system_data.materialisers.purr.materialise module
PuRR-to-canonical materialisation orchestration for the experimental boundary.
This module keeps the public materialisation entrypoint and coordinates adaptation, ingress validation, and canonical assembly via domain-specific builders.
Stage architecture
PuRR materialisation is intentionally staged so source-boundary concerns remain separate from compiler-owned enrichment and canonical assembly:
Source version compatibility check.
Source payload adaptation into boundary-normalised plain data.
Source ingress DTO validation and graph consistency validation.
Compiler-owned enrichment required for canonical assembly.
Canonical system data construction from validated/enriched ingress DTO.
This separation allows validation responsibility to move upstream over time without changing canonical assembly responsibilities.
- class PurrMaterialiserV010(*, target_data=None, supported_acquire_modes=None, native_waveform_shapes=None, operation_builder_type=<class 'qat.experimental.system_data.materialisers.operations.defaults.DefaultOperationBuilder'>, extra_operations=())
Bases:
objectTemplate-method materialiser for PuRR v0.1.0 source payloads.
Subclass and override
prepare_ingress(),build_qubits(),build_channels(),build_couplings(), orassemble()to customise specific pipeline stages without duplicating the full flow.materialise()orchestrates the standard validation and assembly stages. Subclasses are intended to customise the flow through the hooks documented above.- assemble(*, dto, source_version)
Assemble canonical system data from the enriched ingress DTO.
Calls
build_qubits(),build_channels(), andbuild_couplings(). Override to substitute a different output model or to add top-level fields (e.g. an extended hardware model).- Parameters:
dto¶ (
PurrIngressV010) – Enriched, fully-validated ingress DTO.source_version¶ (
str) – Source contract version, written to metadata.
- Return type:
- Returns:
Assembled canonical system data.
- build_channels(*, dto)
Build logical channel data from the enriched ingress DTO.
- Parameters:
dto¶ (
PurrIngressV010) – Enriched, fully-validated ingress DTO.- Return type:
tuple[ChannelData,...]- Returns:
Tuple of channel data for canonical assembly.
- build_couplings(*, dto)
Build qubit coupling data from the enriched ingress DTO.
- Parameters:
dto¶ (
PurrIngressV010) – Enriched, fully-validated ingress DTO.- Return type:
tuple[QubitCouplingData,...]- Returns:
Tuple of coupling data for canonical assembly.
- build_operation_builder(*, qubit_payload, reset_methods, default_reset_method, ddrop_delay_ps)
Build the operation builder for a single qubit.
Override to supply a hardware-specific builder or to inject extra constructor arguments for a particular qubit.
- Parameters:
qubit_payload¶ (
dict[str,Any]) – Raw PuRR quantum-device payload for the qubit.reset_methods¶ (
tuple[ResetData,...]) – Reset method objects from canonical assembly.default_reset_method¶ (
str|None) – Default reset method identifier.ddrop_delay_ps¶ (
int|None) – DDrop reset delay in picoseconds, orNone.
- Return type:
- Returns:
A configured, ready-to-use operation builder instance.
- build_qubits(*, dto, reset_methods, default_reset_method)
Build per-qubit data from the enriched ingress DTO.
- Parameters:
dto¶ (
PurrIngressV010) – Enriched, fully-validated ingress DTO.reset_methods¶ (
tuple[ResetData,...]) – Pre-built reset method objects fromassemble().default_reset_method¶ (
str|None) – Default reset method identifier.
- Return type:
tuple[QubitData,...]- Returns:
Tuple of qubit data for canonical assembly.
- materialise(*, adapted_payload, source_version, strict_version_check=True)
Run the full PuRR materialisation pipeline.
Orchestrates all pipeline stages. Boundary validation is non-bypassable; subclass customisation is via
prepare_ingress(),build_qubits(),build_channels(),build_couplings(), andassemble().- Parameters:
adapted_payload¶ (
dict[str,Any]) – Pre-adapted (boundary-normalised) PuRR payload. Callers are responsible for running the source-specific adapter before invoking this method; passing a raw jsonpickle payload will fail at ingress DTO validation with a confusing error.source_version¶ (
str) – Source contract version.strict_version_check¶ (
bool) – WhenTrue(default), raisesUnsupportedSourceVersionErrorifsource_versionis not in_SUPPORTED_PURR_SOURCE_VERSIONS. Set toFalseto attempt materialisation with an unrecognised version; DTO validation may still fail if the payload shape is incompatible.
- Return type:
- Returns:
Materialised canonical system data.
- Raises:
UnsupportedSourceVersionError – If
strict_version_checkisTrueand the source version is not supported.SourceValidationError – If DTO or graph validation fails.
- prepare_ingress(*, adapted_payload, source_ingress_dto)
Enrich the adapted payload before canonical assembly.
Called after boundary validation; the returned dict is re-validated before assembly. Override to inject hardware-specific fields alongside or instead of the standard compiler enrichment.
- Parameters:
adapted_payload¶ (
dict[str,Any]) – Boundary-normalised payload from the adapter.source_ingress_dto¶ (
PurrIngressV010) – Validated ingress DTO from the adapted payload.
- Return type:
dict[str,Any]- Returns:
Enriched payload dict ready for the second model_validate pass.