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 after quantum_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 QuantumCircuit that was compiled.

  • result – The compilation result returned by quantum_circuit_to_qua, or a QuaCircuitCompilation wrapper.

  • 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": True when "value" is a QUA array, False for a scalar — lets callers choose value[i] vs value when saving. Mirrors Parameter.is_array.

  • "length": Parameter convention — 0 for a scalar output (loose clbit), otherwise the register’s bit count.

  • "state_int": QUA int with packed bit values, LSB = bit 0 (when compute_state_int=True).

  • "stream": QUA stream for stream_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 the outputs table exposes. All entries are sourced from that table, so state_int is 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