Circuit Library¶
Circuit Library (qiskit.circuit.library
)¶
Standard Gates¶
|
Barrier instruction. |
|
The X gate controlled on 3 qubits. |
|
The 3-qubit controlled sqrt-X gate. |
|
The 4-qubit controlled X gate. |
|
CCX gate, also known as Toffoli gate. |
|
Double-CNOT gate. |
|
Controlled-Hadamard gate. |
|
Controlled-Phase gate. |
|
Controlled-RX gate. |
|
Controlled-RY gate. |
|
Controlled-RZ gate. |
|
Controlled-SWAP gate, also known as the Fredkin gate. |
|
Controlled-√X gate. |
|
Controlled-U gate (4-parameter two-qubit gate). |
|
Controlled-U1 gate. |
|
Controlled-U3 gate (3-parameter two-qubit gate). |
|
Controlled-X gate. |
|
Controlled-Y gate. |
|
Controlled-Z gate. |
|
Single-qubit Hadamard gate. |
|
Identity gate. |
|
Multi-controlled-Phase gate. |
|
The general, multi-controlled X gate. |
|
Implement the multi-controlled X gate using the Gray code. |
|
Implement the multi-controlled X gate using recursion. |
|
Implement the multi-controlled X gate using a V-chain of CX gates. |
|
Quantum measurement in the computational basis. |
|
MSGate has been deprecated. |
|
Single-qubit rotation about the Z axis. |
|
The simplified Toffoli gate, also referred to as Margolus gate. |
|
The simplified 3-controlled Toffoli gate. |
|
Qubit reset. |
|
Rotation θ around the cos(φ)x + sin(φ)y axis. |
|
Single-qubit rotation about the X axis. |
|
A parametric 2-qubit \(X \otimes X\) interaction (rotation about XX). |
|
Single-qubit rotation about the Y axis. |
|
A parametric 2-qubit \(Y \otimes Y\) interaction (rotation about YY). |
|
Single-qubit rotation about the Z axis. |
|
A parametric 2-qubit \(Z \otimes Z\) interaction (rotation about ZZ). |
|
A parametric 2-qubit \(Z \otimes X\) interaction (rotation about ZX). |
|
An echoed RZX(pi/2) gate implemented using RZX(pi/4) and RZX(-pi/4). |
|
Single qubit S gate (Z**0.5). |
|
Single qubit S-adjoint gate (~Z**0.5). |
|
The SWAP gate. |
iSWAP gate. |
|
|
The single-qubit Sqrt(X) gate (\(\sqrt{X}\)). |
|
The inverse single-qubit Sqrt(X) gate. |
|
Single qubit T gate (Z**0.25). |
|
Single qubit T-adjoint gate (~Z**0.25). |
|
Generic single-qubit rotation gate with 3 Euler angles. |
|
Single-qubit rotation about the Z axis. |
|
Single-qubit rotation about the X+Z axis. |
|
Generic single-qubit rotation gate with 3 Euler angles. |
|
The single-qubit Pauli-X gate (\(\sigma_x\)). |
|
The single-qubit Pauli-Y gate (\(\sigma_y\)). |
|
The single-qubit Pauli-Z gate (\(\sigma_z\)). |
Generalized Gates¶
|
Diagonal circuit. |
|
The multi-controlled multi-target gate, for an arbitrary singly controlled target gate. |
|
The MCMT implementation using the CCX V-chain. |
|
An n_qubit circuit that permutes qubits. |
|
Global Mølmer–Sørensen gate. |
|
Global R gate. |
|
Global RX gate. |
|
Global RY gate. |
|
Global RZ gate. |
|
Rotation around arbitrary rotation axis \(v\) where \(|v|\) is angle of rotation in radians. |
|
A multi-qubit Pauli gate. |
Boolean Logic Circuits¶
|
A circuit implementing the logical AND operation on a number of qubits. |
|
A circuit implementing the logical OR operation on a number of qubits. |
|
An n_qubit circuit for bitwise xor-ing the input with some integer |
|
A 2n-qubit Boolean function that computes the inner product of two n-qubit vectors over \(F_2\). |
Basis Change Circuits¶
|
Quantum Fourier Transform Circuit. |
Arithmetic Circuits¶
Amplitude Functions¶
|
A circuit implementing a (piecewise) linear function on qubit amplitudes. |
Functional Pauli Rotations¶
|
Base class for functional Pauli rotations. |
|
Linearly-controlled X, Y or Z rotation. |
|
A circuit implementing polynomial Pauli rotations. |
Piecewise-linearly-controlled Pauli rotations. |
|
Piecewise-polynomially-controlled Pauli rotations. |
|
|
Piecewise Chebyshev approximation to an input function. |
Adders¶
|
A circuit that uses QFT to perform in-place addition on two qubit registers. |
|
A ripple-carry circuit to perform in-place addition on two qubit registers. |
|
The VBE ripple carry adder [1]. |
|
A circuit to compute the weighted sum of qubit registers. |
Multipliers¶
|
A multiplication circuit to store product of two input registers out-of-place. |
|
A QFT multiplication circuit to store product of two input registers out-of-place. |
Comparators¶
|
Integer Comparator. |
Functions on binary variables¶
|
Implements a quadratic form on binary variables encoded in qubit registers. |
Amplitude Functions¶
|
A circuit implementing a (piecewise) linear function on qubit amplitudes. |
Particular Quantum Circuits¶
|
Fourier checking circuit. |
|
Circuit to prepare a graph state. |
|
Circuit to solve the hidden linear function problem. |
|
Instantaneous quantum polynomial (IQP) circuit. |
|
A quantum volume model circuit. |
|
Phase Estimation circuit. |
|
The Grover operator. |
|
Phase Oracle. |
|
The evolved operator ansatz. |
Probability distributions¶
|
A circuit to encode a discretized uniform distribution in qubit amplitudes. |
|
A circuit to encode a discretized normal distribution in qubit amplitudes. |
|
A circuit to encode a discretized log-normal distribution in qubit amplitudes. |
N-local circuits¶
|
The n-local circuit class. |
|
The two-local circuit. |
|
The Pauli Two-Design ansatz. |
|
The real-amplitudes 2-local circuit. |
|
The hardware efficient SU(2) 2-local circuit. |
|
The heuristic excitation-preserving wave function ansatz. |
|
A generalized QAOA quantum circuit with a support of custom initial states and mixers. |
Data encoding circuits¶
|
The Pauli Expansion circuit. |
|
The first order Pauli Z-evolution circuit. |
|
Second-order Pauli-Z evolution circuit. |
NCT (Not-CNOT-Toffoli) template circuits¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Clifford template circuits¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RZXGate template circuits¶
|
Template for CX - RYGate - CX. |
|
Template for CX - RXGate - CX. |
|
Template for CX - RYGate - CX. |
|
Template for CX - RZGate - CX. |
|
Template for CX - RZGate - CX. |
|
Template for CX - RZGate - CX. |