qiskit_qm_provider.backend.backend_utils.assign_struct_with_table¶
- assign_struct_with_table(struct: Any, table: ParameterTable) None[source][source]¶
QUA macro: copy declared parameter values into a matching OPNIC struct.
Call inside the same
with program():block after both sides are ready: theParameterTableparameters must already be declared (viadeclare()or OPNICinitialize_in_qua()), andstructmust be a Quarc QuaStructHandle returned bymodule.add_struct(...)withQuaStructHandle.initialize_in_qua()already invoked.For each field, this macro assigns the table parameter’s QUA variable onto the corresponding struct field using
qm.qua.assign. Field names and shapes (scalar vs. array length) must match exactly between the struct spec and the table.- Parameters:
struct – A Quarc
QuaStructHandlebound to the destination OPNIC struct. The type is validated at runtime via a lazyquarcimport; it is not imported for static type checking in this module.table – Source
ParameterTablewhose declared QUA variables are copied field-by-field intostruct.
- Raises:
ImportError – If
quarcis not installed.TypeError – If
structis not a QuarcQuaStructHandle.ValueError – If field names or sizes differ, parameters are undeclared, or
structwas not initialized in QUA.