Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK. Go to the latest version

CircuitInstruction

class CircuitInstruction(operation, qubits=(), clbits=())

GitHub

Bases: object

A single instruction in a QuantumCircuit, comprised of the operation and various operands.

Warning

This is a lightweight internal class and there is minimal error checking; you must respect the type hints when using it. It is the user’s responsibility to ensure that direct mutations of the object do not invalidate the types, nor the restrictions placed on it by its context. Typically this will mean, for example, that qubits must be a sequence of distinct items, with no duplicates.


Methods

copy

CircuitInstruction.copy()

Return a shallow copy of the CircuitInstruction.

Return type

CircuitInstruction

replace

CircuitInstruction.replace(operation=None, qubits=None, clbits=None)

Return a new CircuitInstruction with the given fields replaced.

Return type

CircuitInstruction


Attributes

operation

Type: qiskit.circuit.instruction.Instruction

The logical operation that this instruction represents an execution of.

qubits

Type: Tuple[qiskit.circuit.quantumregister.Qubit, ...]

A sequence of the qubits that the operation is applied to.

clbits

Type: Tuple[qiskit.circuit.classicalregister.Clbit, ...]

A sequence of the classical bits that this operation reads from or writes to.

Was this page helpful?
Report a bug or request content on GitHub.