mimiqcircuits.operations.gates.standard.s¶
S and SDG gates.
Classes
|
Single qubit S gate, a phase gate with angle \(\pi/2\). |
|
Single qubit S† gate, the inverse of |
- class GateS(operation=None, exponent=None, *args, **kwargs)[source]¶
Bases:
PowerSingle qubit S gate, a phase gate with angle \(\pi/2\).
Equal to
GateZ().power(1/2)and toGateP(pi/2).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 GateSDG(operation=None, *args, **kwargs)[source]¶
Bases:
InverseSingle qubit S† gate, the inverse of
GateS.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]