mimiqcircuits.operations.gates.standard.s¶
S and SDG gates.
Classes
|
Single qubit gate S. |
|
Single qubit S-dagger gate (conjugate transpose of the S gate). |
- class mimiqcircuits.operations.gates.standard.s.GateS(operation=None, exponent=None, *args, **kwargs)[source]¶
Bases:
PowerSingle qubit gate S.
It induces a \(\frac{\pi}{2}\) phase gate.
Matrix representation:
\[\begin{split}\operatorname{S} = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}\end{split}\]Examples
>>> from mimiqcircuits import * >>> GateS() S >>> GateS().matrix() [1.0, 0] [0, 0.0 + 1.0*I] >>> c = Circuit().push(GateS(), 0) >>> c 1-qubit circuit with 1 instruction: └── S @ q[0] >>> GateS().power(2), GateS().inverse() (Z, S†) >>> GateS().decompose() 1-qubit circuit with 1 instruction: └── U(0, 0, (1/2)*pi, 0.0) @ q[0]
- class mimiqcircuits.operations.gates.standard.s.GateSDG(operation=None, *args, **kwargs)[source]¶
Bases:
InverseSingle qubit S-dagger gate (conjugate transpose of the S gate).
Matrix representation:
\[\begin{split}\operatorname{S}^\dagger = \begin{pmatrix} 1 & 0 \\ 0 & -i \end{pmatrix}\end{split}\]Examples
>>> from mimiqcircuits import * >>> GateSDG() S† >>> GateSDG().matrix() [1.0, 0] [0, 6.12323399573677e-17 - 1.0*I] >>> c = Circuit().push(GateSDG(), 0) >>> c 1-qubit circuit with 1 instruction: └── S† @ q[0] >>> GateSDG().power(2), GateSDG().inverse() ((S†)**2, S) >>> GateSDG().decompose() 1-qubit circuit with 1 instruction: └── U(0, 0, (-1/2)*pi, 0.0) @ q[0]