mimiqcircuits.operations.gates.standard.s

S and SDG gates.

Classes

GateS([operation, exponent])

Single qubit gate S.

GateSDG([operation])

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: Power

Single 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]
__init__(operation=None, exponent=None)[source]

Initialize an S gate.

class mimiqcircuits.operations.gates.standard.s.GateSDG(operation=None, *args, **kwargs)[source]

Bases: Inverse

Single 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]
__init__(operation=None)[source]

Initialize an SDG gate.