qiskit_qm_provider.backend.backend_utils.get_measurement_outcomes¶
- get_measurement_outcomes(qc: QuantumCircuit, result: CompilationResult, compute_state_int: bool = True) dict[str, dict[str, QuaVariableInt]][source][source]¶
Wire classical measurement outcomes from an embedded circuit into QUA variables.
Call inside the same
with program():block immediately afterquantum_circuit_to_qua(). The returned QUA variables reference outcomes from the circuit execution that just completed, enabling real-time QUA control flow and streaming without round-tripping through Python.- Parameters:
qc – The
QuantumCircuitthat was compiled.result – The compilation result returned by
quantum_circuit_to_qua, or aQuaCircuitCompilationwrapper.compute_state_int – If
True(default), declare an integer packing of each register’s bits (LSB = qubit index 0).
- Returns:
"value": QUA variable for the output (a bool array for multi-bit classical registers, a bool scalar for loose clbits)."is_array":Truewhen"value"is a QUA array,Falsefor a scalar — lets callers choosevalue[i]vsvaluewhen saving. MirrorsParameter.is_array."length":Parameterconvention —0for a scalar output (loose clbit), otherwise the register’s bit count."state_int": QUAintwith packed bit values, LSB = bit 0 (whencompute_state_int=True)."stream": QUA stream forstream_processing()on the host.
Each classical register appears under its own name. Loose clbits not in any register appear under their own per-bit keys
_bit0,_bit1, … (one entry per bit, never packed into a single register) — the same keys theoutputstable exposes. All entries are sourced from that table, sostate_intis the cached, rewire-aware handle (meas[key]["state_int"] ≡ comp.outputs.state_ints[key]).- Return type:
A dictionary mapping each output key to a sub-dictionary