qib.operator.control_instructions.BarrierInstruction¶
- class qib.operator.control_instructions.BarrierInstruction(qubits: Sequence[Qubit] = [])[source]¶
Bases:
ControlInstructionA barrier instruction for a quantum circuit.
The barrier instruction prevents the quantum processor from executing any further instructions until all qubits have reached the barrier.
Methods
Instructions in quantum circuits do not have a sparse matrix representation, because they are not quantum operations that act on the state of qubits.
Generate a Qobj OpenQASM representation of the instruction.
List of all fields appearing in the instruction.
A control instruction is never Hermitian.
A control instruction is never unitary.
Apply the instruction on the specified qubits.
Return the list of quantum particles the instruction is applied on.
Attributes
The number of "wires" (or quantum particles) this instruction is applied on.
- as_matrix()[source]¶
Instructions in quantum circuits do not have a sparse matrix representation, because they are not quantum operations that act on the state of qubits. Instead, these instructions serve as control directives within a quantum circuit.
- fields()[source]¶
List of all fields appearing in the instruction. If empty, all fields of the circuit appears in the instruction.
- property num_wires¶
The number of “wires” (or quantum particles) this instruction is applied on. If 0, the barrier is applied on all “wires” of the circuit.