mimiqcircuits.operations.gates.standard.pauli

Pauli gates (X, Y, Z).

Classes

GateX()

Single qubit Pauli-X gate.

GateY()

Single qubit Pauli-Y gate.

GateZ()

Single qubit Pauli-Z gate.

class mimiqcircuits.operations.gates.standard.pauli.GateX[source]

Bases: Gate

Single qubit Pauli-X gate.

Matrix representation:

\[\begin{split}\operatorname{X} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\end{split}\]

Examples

>>> from mimiqcircuits import *
>>> GateX()
X
>>> GateX().matrix()
[0, 1.0]
[1.0, 0]

>>> c = Circuit().push(GateX(), 0)
>>> c
1-qubit circuit with 1 instruction:
└── X @ q[0]

>>> GateX().power(2), GateX().inverse()
(ID, X)
>>> GateX().decompose()
1-qubit circuit with 1 instruction:
└── U(pi, 0, pi, 0.0) @ q[0]
inverse()[source]

Raise an error, as non-unitary operators cannot be inverted.

This method is not implemented for non-unitary operators and will raise a NotImplementedError if called.

Raises:

NotImplementedError – If the method is called.

class mimiqcircuits.operations.gates.standard.pauli.GateY[source]

Bases: Gate

Single qubit Pauli-Y gate.

Matrix representation:

\[\begin{split}\operatorname{Y} = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}\end{split}\]

Examples

>>> from mimiqcircuits import *
>>> GateY()
Y
>>> GateY().matrix()
[0, -0.0 - 1.0*I]
[0.0 + 1.0*I, 0]

>>> c = Circuit().push(GateY(), 0)
>>> GateY().power(2), GateY().inverse()
(ID, Y)
>>> GateY().decompose()
1-qubit circuit with 1 instruction:
└── U(pi, (1/2)*pi, (1/2)*pi, 0.0) @ q[0]
inverse()[source]

Raise an error, as non-unitary operators cannot be inverted.

This method is not implemented for non-unitary operators and will raise a NotImplementedError if called.

Raises:

NotImplementedError – If the method is called.

class mimiqcircuits.operations.gates.standard.pauli.GateZ[source]

Bases: Gate

Single qubit Pauli-Z gate.

Matrix representation:

\[\begin{split}\operatorname{Z} = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\end{split}\]

Examples

>>> from mimiqcircuits import *
>>> GateZ()
Z
>>> GateZ().matrix()
[1.0, 0]
[0, -1.0]

>>> c = Circuit().push(GateZ(), 0)
>>> GateZ().power(2), GateZ().inverse()
(ID, Z)
>>> GateZ().decompose()
1-qubit circuit with 1 instruction:
└── P(pi) @ q[0]
inverse()[source]

Raise an error, as non-unitary operators cannot be inverted.

This method is not implemented for non-unitary operators and will raise a NotImplementedError if called.

Raises:

NotImplementedError – If the method is called.