mimiqcircuits.operations.gates.standard.deprecated¶
Deprecated gates (U1, U2, U3).
Classes
|
Single qubit phase gate \(U_1\), equivalent to |
|
Single qubit gate \(U_2\), equal to \(U(\pi/2, \phi, \lambda)\). |
|
Single qubit gate \(U_3\), equal to |
- class GateU1(lmbda)[source]¶
Bases:
GateSingle qubit phase gate \(U_1\), equivalent to
GateP.Kept for compatibility with OpenQASM 2;
GatePis the same gate.Matrix Representation
\[\begin{split}\operatorname{U1}(\lambda) = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\lambda} \end{pmatrix}\end{split}\]- Parameters:
lmbda – Phase angle \(\lambda\) in radians.
Examples
>>> from mimiqcircuits import * >>> from symengine import * >>> lmbda = Symbol('lambda') >>> GateU1(lmbda) U1(lambda) >>> GateU1(lmbda).matrix() [1.0, 0] [0, exp(I*lambda)] >>> c = Circuit().push(GateU1(lmbda), 0) >>> c 1-qubit circuit with 1 instruction: └── U1(lambda) @ q[0] >>> GateU1(lmbda).power(2), GateU1(lmbda).inverse() (U1(2*lambda), U1(-lambda)) >>> GateU1(lmbda).decompose() 1-qubit circuit with 1 instruction: └── U(0, 0, lambda, 0.0) @ q[0]
- class GateU2(phi, lmbda)[source]¶
Bases:
GateSingle qubit gate \(U_2\), equal to \(U(\pi/2, \phi, \lambda)\).
Kept for compatibility with OpenQASM 2;
GateUcovers the same gates.Matrix Representation
\[\begin{split}\operatorname{U2}(\phi,\lambda) = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -e^{i\lambda} \\ e^{i\phi} & e^{i(\phi+\lambda)} \end{pmatrix}\end{split}\]- Parameters:
phi – Euler angle \(\phi\) in radians.
lmbda – Euler angle \(\lambda\) in radians.
Examples
>>> from mimiqcircuits import * >>> from symengine import * >>> phi, lmbda = symbols('phi lambda') >>> GateU2(phi, lmbda) U2(phi, lambda) >>> GateU2(phi, lmbda).matrix() [0.707106781186548, (-1/2)*sqrt(2)*exp(I*lambda)] [(1/2)*sqrt(2)*exp(I*phi), (1/2)*sqrt(2)*exp(I*(lambda + phi))] >>> c = Circuit().push(GateU2(phi, lmbda), 0) >>> c 1-qubit circuit with 1 instruction: └── U2(phi, lambda) @ q[0] >>> GateU2(phi, lmbda).power(2), GateU2(phi, lmbda).inverse() (U2(phi, lambda)**2, U2(-lambda - pi, -phi + pi)) >>> GateU2(phi, lmbda).decompose() 1-qubit circuit with 1 instruction: └── U((1/2)*pi, phi, lambda, 0.0) @ q[0]
- class GateU3(theta, phi, lmbda)[source]¶
Bases:
GateSingle qubit gate \(U_3\), equal to
GateUwith no global phase.Kept for compatibility with OpenQASM 2;
GateUcovers the same gates.Matrix Representation
\[\begin{split}\operatorname{U3}(\theta,\phi,\lambda) = \begin{pmatrix} \cos\left(\frac{\theta}{2}\right) & -\mathrm{e}^{i\lambda}\sin\left(\frac{\theta}{2}\right) \\ \mathrm{e}^{i\phi}\sin\left(\frac{\theta}{2}\right) & \mathrm{e}^{i(\phi+\lambda)}\cos\left(\frac{\theta}{2}\right) \end{pmatrix}\end{split}\]- Parameters:
theta – Euler angle \(\theta\) in radians.
phi – Euler angle \(\phi\) in radians.
lmbda – Euler angle \(\lambda\) in radians.
Examples
>>> from mimiqcircuits import * >>> from symengine import * >>> theta, phi, lmbda = symbols('theta phi lambda') >>> GateU3(theta, phi, lmbda) U3(theta, phi, lambda) >>> GateU3(theta, phi, lmbda).matrix() [cos((1/2)*theta), -exp(I*lambda)*sin((1/2)*theta)] [exp(I*phi)*sin((1/2)*theta), exp(I*(lambda + phi))*cos((1/2)*theta)] >>> c = Circuit().push(GateU3(theta, phi, lmbda), 0) >>> c 1-qubit circuit with 1 instruction: └── U3(theta, phi, lambda) @ q[0] >>> GateU3(theta, phi, lmbda).power(2), GateU3(theta, phi, lmbda).inverse() (U3(theta, phi, lambda)**2, U3(-theta, -lambda, -phi)) >>> GateU3(theta, phi, lmbda).decompose() 1-qubit circuit with 1 instruction: └── U(theta, phi, lambda, 0.0) @ q[0]