qiskit_qm_provider.backend.backend_utils.pack_register_to_int¶
- pack_register_to_int(var, size: int)[source][source]¶
Pack classical bits into a single integer (LSB = bit index 0).
Packing follows the wired QUA variable shape: arrays are indexed as
var[i]; scalars are cast directly (only valid whensize == 1).- Parameters:
var – Compiler-owned QUA bool scalar or bool array from
result_program.size – Number of bits to pack from
var.
- Raises:
ValueError – If
sizeis not positive, or a multi-bit output is wired to a scalar QUA variable.