Skip to main content
IBM Quantum Platform
이 페이지는 Qiskit SDK의 이전 버전입니다. 최신 버전으로 이동

Operation

class qiskit.circuit.Operation

GitHub

Bases: ABC

Quantum operation interface.

The minimal interface that any object must fulfil in order to be added to a QuantumCircuit.

Concrete instances of this interface include Gate, Reset, Barrier, Measure, and operators such as Clifford.

The main purpose is to add allow abstract mathematical objects to be added directly onto abstract circuits, and for the exact syntheses of these to be determined later, during compilation.

Example

Add a Clifford and a Toffoli gate to a QuantumCircuit.

from qiskit import QuantumCircuit
from qiskit.quantum_info import Clifford, random_clifford

qc = QuantumCircuit(3)
cliff = random_clifford(2)
qc.append(cliff, [0, 1])
qc.ccx(0, 1, 2)
qc.draw('mpl')
../_images/qiskit-circuit-Operation-1.png

Attributes

name

Unique string identifier for operation type.

num_clbits

Number of classical bits.

num_qubits

Number of qubits.

이 페이지가 도움이 되었습니까?
GitHub에서 버그, 오타를 보고하거나 컨텐츠를 요청하십시오.