Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

Circuit Library


Circuit Library

qiskit.circuit.library

Standard Gates

Barrier(num_qubits)Barrier instruction.
C3XGate([angle, label, ctrl_state])The 3-qubit controlled X gate.
C4XGate([label, ctrl_state])The 4-qubit controlled X gate.
CCXGate([label, ctrl_state])CCX gate, also known as Toffoli gate.
DCXGate()Double-CNOT gate.
CHGate([label, ctrl_state])Controlled-Hadamard gate.
CRXGate(theta[, label, ctrl_state])Controlled-RX gate.
CRYGate(theta[, label, ctrl_state])Controlled-RY gate.
CRZGate(theta[, label, ctrl_state])Controlled-RZ gate.
CSwapGate([label, ctrl_state])Controlled-X gate.
CU1Gate(theta[, label, ctrl_state])Controlled-U1 gate.
CU3Gate(theta, phi, lam[, label, ctrl_state])Controlled-U3 gate (3-parameter two-qubit gate).
CXGate([ctrl_state, label])Controlled-X gate.
CYGate([label, ctrl_state])Controlled-Y gate.
CZGate([label, ctrl_state])Controlled-Z gate.
HGate([label])Single-qubit Hadamard gate.
IGate([label])Identity gate.
Measure()Quantum measurement in the computational basis.
MSGate(num_qubits, theta, *[, n_qubits, label])Global Mølmer–Sørensen gate.
RCCXGate([label])The simplified Toffoli gate, also referred to as Margolus gate.
RC3XGate([label])The simplified 3-controlled Toffoli gate.
Reset()Qubit reset.
RXGate(theta[, label])Single-qubit rotation about the X axis.
RXXGate(theta)A parameteric 2-qubit XXX \otimes X interaction (rotation about XX).
RYGate(theta[, label])Single-qubit rotation about the Y axis.
RYYGate(theta)A parameteric 2-qubit YYY \otimes Y interaction (rotation about YY).
RZGate(phi[, label])Single-qubit rotation about the Z axis.
RZZGate(theta)A parameteric 2-qubit ZZZ \otimes Z interaction (rotation about ZZ).
RZXGate(theta)A parameteric 2-qubit ZXZ \otimes X interaction (rotation about ZX).
SGate([label])Single qubit S gate (Z**0.5).
SdgGate([label])Single qubit S-adjoint gate (~Z**0.5).
SwapGate([label])The SWAP gate.
iSwapGate()iSWAP gate.
TGate([label])Single qubit T gate (Z**0.25).
TdgGate([label])Single qubit T-adjoint gate (~Z**0.25).
U1Gate(theta[, label])Single-qubit rotation about the Z axis.
U2Gate(phi, lam[, label])Single-qubit rotation about the X+Z axis.
U3Gate(theta, phi, lam[, label])Generic single-qubit rotation gate with 3 Euler angles.
XGate([label])The single-qubit Pauli-X gate (σx\sigma_x).
YGate([label])The single-qubit Pauli-Y gate (σy\sigma_y).
ZGate([label])The single-qubit Pauli-Z gate (σz\sigma_z).

Generalized Gates

Diagonal(diag)Diagonal circuit.
MCMT(gate, num_ctrl_qubits, num_target_qubits)The multi-controlled multi-target gate, for an arbitrary singly controlled target gate.
MCMTVChain(gate, num_ctrl_qubits, …)The MCMT implementation using the CCX V-chain.
Permutation(num_qubits[, pattern, seed])An n_qubit circuit that permutes qubits.
GMS(num_qubits, theta)Global Mølmer–Sørensen gate.

Boolean Logic Circuits

AND(num_variable_qubits[, flags, mcx_mode])A circuit implementing the logical AND operation on a number of qubits.
OR(num_variable_qubits[, flags, mcx_mode])A circuit implementing the logical OR operation on a number of qubits.
XOR(num_qubits[, amount, seed])An n_qubit circuit for bitwise xor-ing the input with some integer amount.
InnerProduct(num_qubits)An n_qubit circuit that computes the inner product of two registers.

Basis Change Circuits

QFT([num_qubits, approximation_degree, …])Quantum Fourier Transform Circuit.

Arithmetic Circuits

Functional Pauli Rotations

FunctionalPauliRotations([num_state_qubits, …])Base class for functional Pauli rotations.
LinearPauliRotations([num_state_qubits, …])Linearly-controlled X, Y or Z rotation.
PolynomialPauliRotations([num_state_qubits, …])A circuit implementing polynomial Pauli rotations.
PiecewiseLinearPauliRotations([…])Piecewise-linearly-controlled Pauli rotations.

Adders

WeightedAdder([num_state_qubits, weights, name])A circuit to compute the weighted sum of qubit registers.

Comparators

IntegerComparator([num_state_qubits, value, …])Integer Comparator.

Particular Quantum Circuits

FourierChecking(f, g)Fourier checking circuit.
GraphState(adjacency_matrix)Circuit to prepare a graph state.
HiddenLinearFunction(adjacency_matrix)Circuit to solve the hidden linear function problem.
IQP(interactions)Instantaneous quantum polynomial (IQP) circuit.
QuantumVolume(num_qubits[, depth, seed, …])A quantum volume model circuit.

N-local circuits

NLocal([num_qubits, rotation_blocks, …])The n-local circuit class.
TwoLocal([num_qubits, rotation_blocks, …])The two-local circuit.
RealAmplitudes([num_qubits, entanglement, …])The RealAmplitudes 2-local circuit.
EfficientSU2([num_qubits, su2_gates, …])The hardware efficient SU(2) 2-local circuit.
ExcitationPreserving([num_qubits, mode, …])The heurisitic excitation-preserving wave function ansatz.

Data encoding circuits

PauliFeatureMap([feature_dimension, reps, …])The Pauli Expansion circuit.
ZFeatureMap(feature_dimension[, reps, …])The first order Pauli Z-evolution circuit.
ZZFeatureMap(feature_dimension[, reps, …])Second-order Pauli-Z evolution circuit.
Was this page helpful?