mimiqcircuits.operations.gates.standard.phase¶
Phase (P) gate.
Classes
|
Single qubit phase gate. |
- class GateP(lmbda)[source]¶
Bases:
GateSingle qubit phase gate.
Adds a phase \(\mathrm{e}^{i\lambda}\) to the \(|1\rangle\) state.
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:
lmbda – Phase angle \(\lambda\) in radians, numeric or symbolic.
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]