MeasurementRegisterField¶
- class MeasurementRegisterField(name: str, length: int, *, parent: Any | None = None)[source][source]¶
Bases:
objectOne classical register (or loose bit) wired from a qm-qasm compilation result.
Measurement fields live in a separate namespace from runtime
Parameterobjects registered inParameterPool. The same string name (e.g. matching a creg and an input struct field) may refer to both a runtime knob and a measurement output; they are distinct Python objects with distinct QUA variables.Create a measurement field handle before wiring from a compilation result.
Mirrors the
Parametershape convention: a multi-/single-bit classical register is an array (length= register width), while a loose clbit is a scalar (length == 0).- Parameters:
name – Output key in
result_program(creg name,_bitN, or other compiler output key).length – Number of elements —
0for a scalar output (loose clbit), otherwise the classical register width. Drivesis_array.parent – Optional owning
QuaCircuitCompilation(stored as weakref).
- property is_measurement_output: bool¶
True— sentinel used to reject attachment to runtimeParameterTables.
- property is_array: bool¶
Trueif this field holds a QUA array (length > 0),Falsefor a scalar.Same convention as
is_array; part of the sharedTableFieldProtocol.
- property length: int¶
0for a scalar output (loose clbit), otherwise the classical register width.- Type:
Number of elements,
Parameterconvention
- property var¶
Compiler-owned QUA bool scalar or array for this measurement output.
Must be accessed inside
with program():. Useget_parameter()for the Python handle.
- property state_int: QuaVariable[int] | QuaLiteral[int] | QuaBinaryOperation[int] | QuaArrayCell[int] | QuaArrayLength[int] | QuaLibFunctionOutput[int] | QuaFunctionOutput[int] | QuaBroadcast[int] | _QuaGlobalVarOperation[int]¶
Lazy-packed
intQUA variable (LSB = bit index 0).Must be accessed inside
with program():. Declared (and cached) on first access; nothing is materialized unless you read it. Prefer bulk access viastate_intswhen wiring multiple registers.
- property stream¶
Output stream for
save(..., stream)/stream_processing()on the host.Declared lazily on first access inside
with program():.