quri_parts.circuit.gates module

class XFactory(**kwargs)

Bases: object

name: Literal['X'] = 'X'
class YFactory(**kwargs)

Bases: object

name: Literal['Y'] = 'Y'
class ZFactory(**kwargs)

Bases: object

name: Literal['Z'] = 'Z'
class IdentityFactory(**kwargs)

Bases: object

name: Literal['Identity'] = 'Identity'
class MeasurementFactory(**kwargs)

Bases: object

name: Literal['Measurement'] = 'Measurement'
class ParametricPauliRotationFactory(**kwargs)

Bases: object

name: Literal['ParametricPauliRotation'] = 'ParametricPauliRotation'
class ParametricRZFactory(**kwargs)

Bases: object

name: Literal['ParametricRZ'] = 'ParametricRZ'
class ParametricRYFactory(**kwargs)

Bases: object

name: Literal['ParametricRY'] = 'ParametricRY'
class ParametricRXFactory(**kwargs)

Bases: object

name: Literal['ParametricRX'] = 'ParametricRX'
class PauliRotationFactory(**kwargs)

Bases: object

name: Literal['PauliRotation'] = 'PauliRotation'
class PauliFactory(**kwargs)

Bases: object

name: Literal['Pauli'] = 'Pauli'
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'
class TOFFOLIFactory(**kwargs)

Bases: object

name: Literal['TOFFOLI'] = 'TOFFOLI'
class SWAPFactory(**kwargs)

Bases: object

name: Literal['SWAP'] = 'SWAP'
class CZFactory(**kwargs)

Bases: object

name: Literal['CZ'] = 'CZ'
class CNOTFactory(**kwargs)

Bases: object

name: Literal['CNOT'] = 'CNOT'
class U3Factory(**kwargs)

Bases: object

name: Literal['U3'] = 'U3'
class U2Factory(**kwargs)

Bases: object

name: Literal['U2'] = 'U2'
class U1Factory(**kwargs)

Bases: object

name: Literal['U1'] = 'U1'
class RZFactory(**kwargs)

Bases: object

name: Literal['RZ'] = 'RZ'
class RYFactory(**kwargs)

Bases: object

name: Literal['RY'] = 'RY'
class RXFactory(**kwargs)

Bases: object

name: Literal['RX'] = 'RX'
class TdagFactory(**kwargs)

Bases: object

name: Literal['Tdag'] = 'Tdag'
class TFactory(**kwargs)

Bases: object

name: Literal['T'] = 'T'
class SqrtYdagFactory(**kwargs)

Bases: object

name: Literal['SqrtYdag'] = 'SqrtYdag'
class SqrtYFactory(**kwargs)

Bases: object

name: Literal['SqrtY'] = 'SqrtY'
class SqrtXdagFactory(**kwargs)

Bases: object

name: Literal['SqrtXdag'] = 'SqrtXdag'
class SqrtXFactory(**kwargs)

Bases: object

name: Literal['SqrtX'] = 'SqrtX'
class SdagFactory(**kwargs)

Bases: object

name: Literal['Sdag'] = 'Sdag'
class SFactory(**kwargs)

Bases: object

name: Literal['S'] = 'S'
class HFactory(**kwargs)

Bases: object

name: Literal['H'] = 'H'
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}\)

S()

S Gate, or sqrt(Z) gate represented by matrix :math:`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}\)

class MCXFactory

Bases: object

name: Literal['MCX'] = 'MCX'
class MCYFactory

Bases: object

name: Literal['MCY'] = 'MCY'
class MCZFactory

Bases: object

name: Literal['MCZ'] = 'MCZ'
class MCHFactory

Bases: object

name: Literal['MCH'] = 'MCH'
class MCSFactory

Bases: object

name: Literal['MCS'] = 'MCS'
class MCSdagFactory

Bases: object

name: Literal['MCSdag'] = 'MCSdag'
class MCTFactory

Bases: object

name: Literal['MCT'] = 'MCT'
class MCTdagFactory

Bases: object

name: Literal['MCTdag'] = 'MCTdag'
class MCSqrtXFactory

Bases: object

name: Literal['MCSqrtX'] = 'MCSqrtX'
class MCSqrtXdagFactory

Bases: object

name: Literal['MCSqrtXdag'] = 'MCSqrtXdag'
class MCSqrtYFactory

Bases: object

name: Literal['MCSqrtY'] = 'MCSqrtY'
class MCSqrtYdagFactory

Bases: object

name: Literal['MCSqrtYdag'] = 'MCSqrtYdag'
class MCRXFactory

Bases: object

name: Literal['MCRX'] = 'MCRX'
class MCRYFactory

Bases: object

name: Literal['MCRY'] = 'MCRY'
class MCRZFactory

Bases: object

name: Literal['MCRZ'] = 'MCRZ'
class MCU1Factory

Bases: object

name: Literal['MCU1'] = 'MCU1'