quri_parts.circuit.gates module¶
- class ParametricPauliRotationFactory(**kwargs)¶
Bases:
object- name: Literal['ParametricPauliRotation'] = 'ParametricPauliRotation'¶
- class PauliRotationFactory(**kwargs)¶
Bases:
object- name: Literal['PauliRotation'] = 'PauliRotation'¶
- class TwoQubitUnitaryMatrixFactory(**kwargs)¶
Bases:
object- name: Literal['UnitaryMatrix'] = 'UnitaryMatrix'¶
- class SingleQubitUnitaryMatrixFactory(**kwargs)¶
Bases:
object- name: Literal['UnitaryMatrix'] = 'UnitaryMatrix'¶
- class UnitaryMatrixFactory(**kwargs)¶
Bases:
object- name: Literal['UnitaryMatrix'] = 'UnitaryMatrix'¶
- X()¶
Pauli X gate represented by matrix \(\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\)
- Y()¶
Pauli Y gate represented by matrix \(\begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}\)
- Z()¶
- Identity()¶
Identity gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\)
- Measurement()¶
Measurement gate that transfers the measurement result to a classical bit.
- ParametricPauliRotation()¶
Parametric Pauli rotation gate.
Note that the instance of this class doesn’t contain parameter values. Every parametric gate is carried with it’s parameter (
Parameter) such as (ParametricPauliRotation, Parameter).
- ParametricRZ()¶
Parametric RZ gate.
Note that the instance of this class doesn’t contain parameter values. Every parametric gate is carried with it’s parameter (
Parameter) such as (ParametricRZ, Parameter).
- ParametricRY()¶
Parametric RY gate.
Note that the instance of this class doesn’t contain parameter values. Every parametric gate is carried with it’s parameter (
Parameter) such as (ParametricRY, Parameter).
- ParametricRX()¶
Parametric RX gate.
Note that the instance of this class doesn’t contain parameter values. Every parametric gate is carried with it’s parameter (
Parameter) such as (ParametricRX, Parameter).
- PauliRotation()¶
Multi-qubit Pauli rotation gate such as \(e^{-iX_0Y_1 \\phi / 2}\).
- Pauli()¶
Multi-qubit Pauli gate, consists of Pauli X, Y, or Z gates.
- TwoQubitUnitaryMatrix()¶
Two qubit UnitaryMatrix gate.
- SingleQubitUnitaryMatrix()¶
Single qubit UnitaryMatrix gate.
- UnitaryMatrix()¶
UnitaryMatrix gate represented by an arbitrary unitary matrix.
- TOFFOLI()¶
TOFFOLI gate.
- SWAP()¶
SWAP gate.
- CZ()¶
CZ gate, also called controlled-Z gate CZ(control, target) = \(I \otimes |0\rangle\langle0| + Z \otimes |1\rangle\langle1|\)
- CNOT()¶
CNOT gate, also called controlled-X gate, or CX gate CNOT(control, target) = \(I \otimes |0\rangle\langle0| + X \otimes |1\rangle\langle1|\)
- U3()¶
U3 gate is a generic single-qubit rotation gate with 3 Euler angles. Represented by matrix \(\begin{pmatrix} \cos\frac{\theta}{2} & -e^{i\lambda}\sin\frac{\theta}{2} \\ e^{i\phi}\sin\frac{\theta}{2} & e^{i(\phi+\lambda)}\cos\frac{\theta}{2} \end{pmatrix}\)
- U2()¶
U2 gate is a single-qubit rotation about X + Z axis:
\(U_2(\phi, \lambda) = R_Z(\phi)R_Y(\pi/2)R_Z(\lambda)\). Represented by matrix \(\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -e^{i\lambda} \\ e^{i\phi} & e^{i(\phi+\lambda)} \end{pmatrix}\)
- U1()¶
U1 gate is a single-qubit rotation about the Z axis:
\(U_1(\lambda) = e^{i\lambda/2} R_Z(\lambda)\). Represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & e^{i\lambda} \end{pmatrix}\)
- RZ()¶
RZ gate equivalant to \(\exp(-i\theta Z/2)\) represented by matrix \(\begin{pmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{pmatrix}\)
- RY()¶
RY gate equivalant to \(\exp(-i\theta Y/2)\) represented by matrix \(\begin{pmatrix} \cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{pmatrix}\)
- RX()¶
RX gate equivalant to \(\exp(-i\theta X/2)\) represented by matrix \(\begin{pmatrix} \cos\frac{\theta}{2} & -i\sin\frac{\theta}{2} \\ -i\sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{pmatrix}\)
- Tdag()¶
Conjugate of the T gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & e^{-i\pi/4} \end{pmatrix}\)
- T()¶
T gate, or sqrt(S) gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}\)
- SqrtYdag()¶
Conjugate of the quare root of Y gate represented by matrix \(\frac{1-i}{2}\begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix}\)
- SqrtY()¶
Square root of Y gate represented by matrix \(\frac{1+i}{2}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}\)
- SqrtXdag()¶
Conjugate of the quare root of X gate represented by matrix \(\frac{1}{2}\begin{pmatrix} 1-i & 1+i \\ 1+i & 1-i \end{pmatrix}\)
- SqrtX()¶
Square root of X gate represented by matrix \(\frac{1}{2}\begin{pmatrix} 1+i & 1-i \\ 1-i & 1+i \end{pmatrix}\)
- Sdag()¶
Sdag Gate, conjugate of S gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & -i \end{pmatrix}\)
- H()¶
Hadamard gate represented by matrix \(\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\)