mimiqcircuits.operations.gates.standard.sy

SY (Sqrt(Y)) and SYDG gates.

Classes

GateSY([operation, exponent])

Single qubit \(\sqrt{Y}\) gate.

GateSYDG([operation])

Single qubit \(\sqrt{Y}^\dagger\) gate, the inverse of GateSY.

class GateSY(operation=None, exponent=None, *args, **kwargs)[source]

Bases: Power

Single qubit \(\sqrt{Y}\) gate.

Equal to GateY().power(1/2).

Matrix Representation

\[\begin{split}\operatorname{SY} = \sqrt{\operatorname{Y}} = \frac{1}{2} \begin{pmatrix} 1+i & -1-i \\ 1+i & 1+i \end{pmatrix}\end{split}\]

Examples

>>> from mimiqcircuits import *
>>> GateSY()
SY
>>> GateSY().matrix()
[0.5 + 0.5*I, -0.5 - 0.5*I]
[0.5 + 0.5*I, 0.5 + 0.5*I]

>>> c = Circuit().push(GateSY(), 0)
>>> c
1-qubit circuit with 1 instruction:
└── SY @ q[0]

>>> GateSY().power(2), GateSY().inverse()
(Y**1, SY†)
>>> GateSY().decompose()
1-qubit circuit with 4 instructions:
├── S @ q[0]
├── S @ q[0]
├── H @ q[0]
└── U(0, 0, 0, (1/4)*pi) @ q[0]

See also

GateSYDG, GateY, Power

__init__(operation=None, exponent=None)[source]

Initialize a SY gate. The arguments are unused.

inverse()[source]

Return the inverse, Inverse(self).

isopalias()[source]

Whether the operation is a named alias of a wrapper.

Some named gates are defined as a wrapper around another operation, for example GateS as GateZ to the power 1/2. Such gates return True. Not every such gate reports it: GateSDG and GateCX return False.

Returns:

True for a named alias of a wrapper that reports it, False otherwise.

Return type:

bool

class GateSYDG(operation=None, *args, **kwargs)[source]

Bases: Inverse

Single qubit \(\sqrt{Y}^\dagger\) gate, the inverse of GateSY.

Matrix Representation

\[\begin{split}\operatorname{SYDG} = \sqrt{\operatorname{Y}}^\dagger = \frac{1}{2} \begin{pmatrix} 1-i & 1-i \\ -1+i & 1-i \end{pmatrix}\end{split}\]

Examples

>>> from mimiqcircuits import *
>>> GateSYDG()
SY†
>>> GateSYDG().matrix()
[0.5 - 0.5*I, 0.5 - 0.5*I]
[-0.5 + 0.5*I, 0.5 - 0.5*I]

>>> c = Circuit().push(GateSYDG(), 0)
>>> c
1-qubit circuit with 1 instruction:
└── SY† @ q[0]

>>> GateSYDG().power(2), GateSYDG().inverse()
(SY†**2, SY)
>>> GateSYDG().decompose()
1-qubit circuit with 4 instructions:
├── U(0, 0, 0, (-1/4)*pi) @ q[0]
├── H @ q[0]
├── S† @ q[0]
└── S† @ q[0]

See also

GateSY, GateY, Inverse

__init__(operation=None)[source]

Initialize a SYDG gate. The argument is unused.

inverse()[source]

Return the wrapped gate, undoing the inversion.

isopalias()[source]

Whether the operation is a named alias of a wrapper.

Some named gates are defined as a wrapper around another operation, for example GateS as GateZ to the power 1/2. Such gates return True. Not every such gate reports it: GateSDG and GateCX return False.

Returns:

True for a named alias of a wrapper that reports it, False otherwise.

Return type:

bool