mimiqcircuits.operations.gates.standard.sx¶
SX (Sqrt(X)) and SXDG gates.
Classes
|
Single qubit \(\sqrt{X}\) gate. |
|
Single qubit \(\sqrt{X}^\dagger\) gate, the inverse of |
- class GateSX(operation=None, exponent=None, *args, **kwargs)[source]¶
Bases:
PowerSingle qubit \(\sqrt{X}\) gate.
Equal to
GateX().power(1/2).Matrix Representation
\[\begin{split}\sqrt{\operatorname{X}} = \frac{1}{2} \begin{pmatrix} 1+i & 1-i \\ 1-i & 1+i\\ \end{pmatrix}\end{split}\]Examples
>>> from mimiqcircuits import * >>> GateSX() SX >>> GateSX().matrix() [0.5 + 0.5*I, 0.5 - 0.5*I] [0.5 - 0.5*I, 0.5 + 0.5*I] >>> c = Circuit().push(GateSX(), 0) >>> c 1-qubit circuit with 1 instruction: └── SX @ q[0] >>> GateSX().power(2), GateSX().inverse() (X, SX†) >>> GateSX().decompose() 1-qubit circuit with 4 instructions: ├── S† @ q[0] ├── H @ q[0] ├── S† @ q[0] └── U(0, 0, 0, (1/4)*pi) @ q[0]
- class GateSXDG(operation=None, *args, **kwargs)[source]¶
Bases:
InverseSingle qubit \(\sqrt{X}^\dagger\) gate, the inverse of
GateSX.Matrix Representation
\[\begin{split}\sqrt{\operatorname{X}}^\dagger = \frac{1}{2} \begin{pmatrix} 1-i & 1+i \\ 1+i & 1-i\\ \end{pmatrix}\end{split}\]Examples
>>> from mimiqcircuits import * >>> GateSXDG() SX† >>> GateSXDG().matrix() [0.5 - 0.5*I, 0.5 + 0.5*I] [0.5 + 0.5*I, 0.5 - 0.5*I] >>> c = Circuit().push(GateSXDG(), 0) >>> c 1-qubit circuit with 1 instruction: └── SX† @ q[0] >>> GateSXDG().power(2), GateSXDG().inverse() ((SX†)**2, SX) >>> GateSXDG().decompose() 1-qubit circuit with 4 instructions: ├── S @ q[0] ├── H @ q[0] ├── S @ q[0] └── U(0, 0, 0, (-1/4)*pi) @ q[0]