qib.operator.control_instructions.ControlInstruction

class qib.operator.control_instructions.ControlInstruction[source]

Bases: AbstractOperator

Parent class for circuit control instructions.

A control instruction is an operational directive in a quantum program (i.e. circuit), that dictates specific actions to be carried out on qubits within a quantum processor.

Methods

as_matrix

Instructions in quantum circuits do not have a sparse matrix representation, because they are not quantum operations that act on the state of qubits.

as_qasm

Generate a Qobj OpenQASM representation of the instruction.

fields

List of all fields appearing in the instruction.

is_hermitian

A control instruction is never Hermitian.

is_unitary

A control instruction is never unitary.

on

Apply the instruction on the specified qubits.

particles

Return the list of quantum particles the instruction is applied on.

Attributes

num_wires

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.

as_qasm()[source]

Generate a Qobj OpenQASM representation of the instruction.

abstract fields()[source]

List of all fields appearing in the instruction.

is_hermitian()[source]

A control instruction is never Hermitian.

is_unitary()[source]

A control instruction is never unitary.

abstract property num_wires

The number of “wires” (or quantum particles) this instruction is applied on.

abstract on(qubits: Sequence[Qubit])[source]

Apply the instruction on the specified qubits.

abstract particles()[source]

Return the list of quantum particles the instruction is applied on.