QasmQobjInstruction
class qiskit.qobj.QasmQobjInstruction(name, params=None, qubits=None, register=None, memory=None, condition=None, conditional=None, label=None, mask=None, relation=None, val=None, snapshot_type=None)
Bases: object
A class representing a single instruction in an QasmQobj Experiment.
Instantiate a new QasmQobjInstruction object.
Parameters
- name (str) – The name of the instruction
- params (list) – The list of parameters for the gate
- qubits (list) – A list of
intrepresenting the qubits the instruction operates on - register (list) – If a
measureinstruction this is a list ofintcontaining the list of register slots in which to store the measurement results (must be the same length as qubits). If abfuncinstruction this is a singleintof the register slot in which to store the result. - memory (list) – If a
measureinstruction this is a list ofintcontaining the list of memory slots to store the measurement results in (must be the same length as qubits). If abfuncinstruction this is a singleintof the memory slot to store the boolean function result in. - condition (tuple) – A tuple of the form
(int, int)where the firstintis the control register and the secondintis the control value if the gate has a condition. - conditional (int) – The register index of the condition
- label (str) – An optional label assigned to the instruction
- mask (int) – For a
bfuncinstruction the hex value which is applied as anANDto the register bits. - relation (str) – Relational operator for comparing the masked register to the
valkwarg. Can be either==(equals) or!=(not equals). - val (int) – Value to which to compare the masked register. In other words, the output of the function is
(register AND mask) - snapshot_type (str) – For snapshot instructions the type of snapshot to use
Methods
from_dict
classmethod from_dict(data)
Create a new QasmQobjInstruction object from a dictionary.
Parameters
data (dict) – A dictionary for the experiment config
Returns
The object from the input dictionary.
Return type
to_dict
to_dict()
Return a dictionary format representation of the Instruction.
Returns
The dictionary form of the QasmQobjInstruction.
Return type
Was this page helpful?
Report a bug, typo, or request content on GitHub.