mimiqcircuits.operations.gates.standard.phase

Phase (P) gate.

Classes

GateP(lmbda)

Single qubit Phase gate.

class mimiqcircuits.operations.gates.standard.phase.GateP(lmbda)[source]

Bases: Gate

Single qubit Phase gate.

Matrix representation:

\[\begin{split}\operatorname{P}(\lambda) = \operatorname{U}(0,0,\lambda) = \begin{pmatrix} 1 & 0 \\ 0 & \mathrm{e}^{i\lambda} \end{pmatrix}\end{split}\]
Parameters:

lambda – Phase angle

Examples

>>> from mimiqcircuits import *
>>> from symengine import *
>>> lmbda = Symbol('lambda')
>>> GateP(lmbda)
P(lambda)
>>> GateP(lmbda).matrix()
[1.0, 0]
[0, exp(I*lambda)]

>>> c = Circuit().push(GateP(lmbda), 0)
>>> c
1-qubit circuit with 1 instruction:
└── P(lambda) @ q[0]

>>> GateP(lmbda).power(2), GateP(lmbda).inverse()
(P(2*lambda), P(-lambda))
>>> GateP(lmbda).decompose()
1-qubit circuit with 1 instruction:
└── U(0, 0, lambda, 0.0) @ q[0]
__init__(lmbda)[source]
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.