quri_parts.circuit.gates module#
- Identity = <quri_parts.circuit.gates.IdentityFactory object>#
Identity gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- X = <quri_parts.circuit.gates.XFactory object>#
Pauli X gate represented by matrix \(\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- Y = <quri_parts.circuit.gates.YFactory object>#
Pauli Y gate represented by matrix \(\begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- Z = <quri_parts.circuit.gates.ZFactory object>#
Pauli Z gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- H = <quri_parts.circuit.gates.HFactory object>#
Hadamard gate represented by matrix \(\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- S = <quri_parts.circuit.gates.SFactory object>#
S Gate, or sqrt(Z) gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- Sdag = <quri_parts.circuit.gates.SdagFactory object>#
Sdag Gate, conjugate of S gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & -i \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- SqrtX = <quri_parts.circuit.gates.SqrtXFactory object>#
Square root of X gate represented by matrix \(\frac{1}{2}\begin{pmatrix} 1+i & 1-i \\ 1-i & 1+i \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- SqrtXdag = <quri_parts.circuit.gates.SqrtXdagFactory object>#
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}\)
- Parameters:
target_index (int) –
- Return type:
- SqrtY = <quri_parts.circuit.gates.SqrtYFactory object>#
Square root of Y gate represented by matrix \(\frac{1+i}{2}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- SqrtYdag = <quri_parts.circuit.gates.SqrtYdagFactory object>#
Conjugate of the quare root of Y gate represented by matrix \(\frac{1-i}{2}\begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- T = <quri_parts.circuit.gates.TFactory object>#
T gate, or sqrt(S) gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- Tdag = <quri_parts.circuit.gates.TdagFactory object>#
Conjugate of the T gate represented by matrix \(\begin{pmatrix} 1 & 0 \\ 0 & e^{-i\pi/4} \end{pmatrix}\)
- Parameters:
target_index (int) –
- Return type:
- RX = <quri_parts.circuit.gates.RXFactory object>#
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}\)
- Parameters:
target_index (int) –
angle (float) –
- Return type:
- RY = <quri_parts.circuit.gates.RYFactory object>#
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}\)
- Parameters:
target_index (int) –
angle (float) –
- Return type:
- RZ = <quri_parts.circuit.gates.RZFactory object>#
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}\)
- Parameters:
target_index (int) –
angle (float) –
- Return type:
- U1 = <quri_parts.circuit.gates.U1Factory object>#
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}\)
- Parameters:
target_index (int) –
lmd (float) –
- Return type:
- U2 = <quri_parts.circuit.gates.U2Factory object>#
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}\)
- Parameters:
target_index (int) –
phi (float) –
lmd (float) –
- Return type:
- U3 = <quri_parts.circuit.gates.U3Factory object>#
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}\)
- Parameters:
target_index (int) –
theta (float) –
phi (float) –
lmd (float) –
- Return type:
- CNOT = <quri_parts.circuit.gates.CNOTFactory object>#
CNOT gate, also called controlled-X gate, or CX gate CNOT(control, target) = \(I \otimes |0\rangle\langle0| + X \otimes |1\rangle\langle1|\)
- Parameters:
control_index (int) –
target_index (int) –
- Return type:
- CZ = <quri_parts.circuit.gates.CZFactory object>#
CZ gate, also called controlled-Z gate CZ(control, target) = \(I \otimes |0\rangle\langle0| + Z \otimes |1\rangle\langle1|\)
- Parameters:
control_index (int) –
target_index (int) –
- Return type:
- SWAP = <quri_parts.circuit.gates.SWAPFactory object>#
SWAP gate.
- Parameters:
target_index1 (int) –
target_index2 (int) –
- Return type:
- TOFFOLI = <quri_parts.circuit.gates.TOFFOLIFactory object>#
TOFFOLI gate.
- Parameters:
control_index1 (int) –
control_index2 (int) –
target_index (int) –
- Return type:
- UnitaryMatrix = <quri_parts.circuit.gates.UnitaryMatrixFactory object>#
UnitaryMatrix gate represented by an arbitrary unitary matrix.
- Parameters:
target_indices (Sequence[int]) –
unitary_matrix (Sequence[Sequence[complex]]) –
- Return type:
- class SingleQubitUnitaryMatrixFactory#
Bases:
object
- name: Literal['UnitaryMatrix'] = 'UnitaryMatrix'#
- SingleQubitUnitaryMatrix = <quri_parts.circuit.gates.SingleQubitUnitaryMatrixFactory object>#
Single qubit UnitaryMatrix gate.
- Parameters:
target_index (int) –
unitary_matrix (Sequence[Sequence[complex]]) –
- Return type:
- TwoQubitUnitaryMatrix = <quri_parts.circuit.gates.TwoQubitUnitaryMatrixFactory object>#
Two qubit UnitaryMatrix gate.
- Parameters:
target_index1 (int) –
target_index2 (int) –
unitary_matrix (Sequence[Sequence[complex]]) –
- Return type:
- Pauli = <quri_parts.circuit.gates.PauliFactory object>#
Multi-qubit Pauli gate, consists of Pauli X, Y, or Z gates.
- Parameters:
target_indices (Sequence[int]) –
pauli_ids (Sequence[int]) –
- Return type:
- PauliRotation = <quri_parts.circuit.gates.PauliRotationFactory object>#
Multi-qubit Pauli rotation gate such as \(e^{-iX_0Y_1 \phi / 2}\).
- Parameters:
target_indices (Sequence[int]) –
pauli_ids (Sequence[int]) –
angle (float) –
- Return type:
- ParametricRX = <quri_parts.circuit.gates.ParametricRXFactory object>#
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).- Parameters:
target_index (int) –
- Return type:
- ParametricRY = <quri_parts.circuit.gates.ParametricRYFactory object>#
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).- Parameters:
target_index (int) –
- Return type:
- ParametricRZ = <quri_parts.circuit.gates.ParametricRZFactory object>#
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).- Parameters:
target_index (int) –
- Return type:
- class ParametricPauliRotationFactory#
Bases:
object
- name: Literal['ParametricPauliRotation'] = 'ParametricPauliRotation'#
- ParametricPauliRotation = <quri_parts.circuit.gates.ParametricPauliRotationFactory object>#
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).- Parameters:
target_indics (Sequence[int]) –
pauli_ids (Sequence[int]) –
- Return type:
- Measurement = <quri_parts.circuit.gates.MeasurementFactory object>#
Measurement gate that transfers the measurement result to a classical bit.
- Parameters:
target_indices (Sequence[int]) –
classical_indices (Sequence[int]) –
- Return type: