qecx.DataMeasurementVariant¶
- class qecx.DataMeasurementVariant(*, name, circuit, registers=<factory>, fault_tolerant, description=None, references=(), syndrome_cregs=None, transversal_readout_cregs=None, basis, result_creg)¶
Bases:
OperationVariant,DataMeasVariantData-measurement variant for one measurement basis.
Data measurement measures every physical qubit of a single code block in one uniform basis, destroying the encoded state; consumers decode the raw physical outcomes into logical results. Variants are grouped by basis.
A variant whose
syndrome_cregsandtransversal_readout_cregsare bothNoneimplies a check readout ofresult_creg, set by the code type and the basis: overH_ZunderZand overH_XunderXfor a CSS code, overgauge_ZunderZand overgauge_XunderXfor a subsystem-CSS code, and none underYor for a stabilizer or subsystem-stabilizer code. The implied readout means the same as atransversal_readout_cregsentry namingresult_cregover that source in the entry frame. Any declaration in either field, an empty one included, replaces it entirely, so an emptytransversal_readout_cregsdeclares no readout. The variant stores both fields as declared and never fills in the implied readout.- Variables:
name (str) – Variant name; the handle other document sections use to address the variant.
circuit (QuantumCircuit) – Circuit fragment implementing the measurement; read-only, like every field of the frozen variant: a changed circuit goes into a copy made with
dataclasses.replace.registers (Mapping[QuantumRegister | ClassicalRegister, RegisterDecl]) – One declaration per register of
circuit, keyed by the live register object. Defaults to an empty mapping.fault_tolerant (bool) – Whether the variant provides fault-tolerance guarantees.
description (str | None) – Human-readable summary of the variant.
references (tuple[Reference, ...]) – Citations attached to the variant; sequence input is normalized to a tuple at construction.
syndrome_cregs (tuple[SyndromeCregDecl, ...] | None) – Check readouts holding one bit per check, in declaration order; each entry names a distinct output-scoped register of the variant, one
transversal_readout_cregsdoes not name, and the source whose checks the register’s bits store. No named register carriesRegisterPurpose.TRANSVERSAL_READOUT. A measurement writes every bit of each named register. No entry namesresult_creg. No entry carries ablock_index.Nonemeans the field is absent; an empty tuple declares no check readout; sequence input is normalized to a tuple at construction.transversal_readout_cregs (tuple[TransversalReadoutCregDecl, ...] | None) – Check readouts holding one bit per block qubit read, in declaration order; each entry names an output-scoped register of the variant that
syndrome_cregsdoes not name, and several entries may name one register, agreeing onblock_indexandqubitsand declaring no check twice. No named register carriesRegisterPurpose.SYNDROME. A measurement writes every bit of each named register. No entry carries ablock_index.Nonemeans the field is absent; an empty tuple declares no check readout; sequence input is normalized to a tuple at construction.source_qasm (str | None) – OpenQASM text the loader built the variant from, which the variant re-saves byte for byte; set only on the variant the loader built, so a copy made with
dataclasses.replacecarriesNoneand saves its own circuit. Not a constructor argument; never participates in equality comparisons.basis (MeasurementBasis) – Measurement basis, applied uniformly to every logical qubit of the block.
result_creg (ClassicalRegister) – Classical register receiving the physical outcomes; a key of
registerswhose declaration carriesRegisterScope.OUTPUT. Its size equals the measured block’s physical-qubit count, checked at document registration.