qecx.LogicalMeasurementVariant

class qecx.LogicalMeasurementVariant(*, name, circuit, registers=<factory>, fault_tolerant, description=None, references=(), syndrome_cregs=None, transversal_readout_cregs=None, observable, operands, result_creg)

Bases: OperationVariant, LogicalMeasVariant

Logical-measurement variant for one observable and operand shape.

Logical measurement measures a Pauli observable over one or more logical qubits without destroying the code blocks; the measured qubits collapse to an eigenstate of the observable. Variants are grouped by observable and operand shape.

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. Block-scoped inherited declarations carry the block_index tying them to an operand block. 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_cregs does not name, and the source whose checks the register’s bits store. No named register carries RegisterPurpose.TRANSVERSAL_READOUT. A measurement writes every bit of each named register. No entry names result_creg. Each entry carries a block_index equal to one of the operands’ block labels. None means 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_cregs does not name, and several entries may name one register, agreeing on block_index and qubits and declaring no check twice. No named register carries RegisterPurpose.SYNDROME. A measurement writes every bit of each named register. No entry names result_creg. Each entry carries a block_index equal to one of the operands’ block labels. None means 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.replace carries None and saves its own circuit. Not a constructor argument; never participates in equality comparisons.

  • observable (PauliProductOperator) – Measured Pauli observable; position i of its qubit-0-first form is the basis measured on operand i.

  • operands (tuple[Operand, ...]) – Ordered logical-qubit arguments; operands sharing a block value act on the same code block. An all-wildcard block covers the block’s full logical-qubit set, checked at document registration. Sequence input is normalized to a tuple at construction.

  • result_creg (ClassicalRegister) – Classical register receiving the measurement outcome; a key of registers whose declaration carries RegisterScope.OUTPUT.