- class InstructionSet(circuit_cregs=None, *, resource_requester=None)¶
Instruction collection, and their contexts.
New collection of instructions.
The context (qargs and cargs that each instruction is attached to) is also stored separately for each instruction.
circuit_cregs (list[ClassicalRegister]) –
Optional. List of cregs of the circuit to which the instruction is added. Default: None.
Deprecated since version qiskit-terra: 0.19 The classical registers are insufficient to access all classical resources in a circuit, as there may be loose classical bits as well. It can also cause integer indices to be resolved incorrectly if any registers overlap. Instead, pass a complete requester to the
A callable that takes in the classical resource used in the condition, verifies that it is present in the attached circuit, resolves any indices into concrete
Clbitinstances, and returns the concrete resource. If this is not given, specifying a condition with an index is forbidden, and all concrete
ClassicalRegisterresources will be assumed to be valid.
resource_requesteris called once for each call to
c_if(), and assumes that a call implies that the resource will now be used. It may throw an error if the resource is not valid for usage.
CircuitError – if both
circuit_cregsare passed. Only one of these may be passed, and it should be
Add an instruction and its context (where it is attached).
Invert all instructions.
Legacy getter for the cargs components of an instruction set. This does not support mutation.
Legacy getter for the instruction components of an instruction set. This does not support mutation.
Legacy getter for the qargs components of an instruction set. This does not support mutation.