mimiqcircuits.operations.gates.standard.iswap¶
iSWAP and iSWAP† gates.
Classes
Two qubit ISWAP gate. |
|
|
Two qubit ISWAP† (iSWAP dagger) gate. |
- class mimiqcircuits.operations.gates.standard.iswap.GateISWAP[source]¶
Bases:
GateTwo qubit ISWAP gate.
See Also
GateISWAPDGandGateSWAPMatrix representation:
\[\begin{split}\operatorname{ISWAP} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & i & 0 \\ 0 & i & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}\end{split}\]Examples
>>> from mimiqcircuits import * >>> GateISWAP() ISWAP >>> GateISWAP().matrix() [1.0, 0, 0, 0] [0, 0, 0.0 + 1.0*I, 0] [0, 0.0 + 1.0*I, 0, 0] [0, 0, 0, 1.0] >>> c = Circuit().push(GateISWAP(), 0, 1) >>> GateISWAP().power(2), GateISWAP().inverse() (ISWAP**2, ISWAP†) >>> GateISWAP().decompose() 2-qubit circuit with 6 instructions: ├── S @ q[0] ├── S @ q[1] ├── H @ q[0] ├── CX @ q[0], q[1] ├── CX @ q[1], q[0] └── H @ q[1]
- inverse()[source]¶
Raise an error, as non-unitary operators cannot be inverted.
This method is not implemented for non-unitary operators and will raise a NotImplementedError if called.
- Raises:
NotImplementedError – If the method is called.
- class mimiqcircuits.operations.gates.standard.iswap.GateISWAPDG(operation=None, *args, **kwargs)[source]¶
Bases:
InverseTwo qubit ISWAP† (iSWAP dagger) gate.
See Also
GateISWAPandGateSWAPMatrix representation:
\[\begin{split}\operatorname{ISWAP}^\dagger = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & -i & 0 \\ 0 & -i & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}\end{split}\]Examples
>>> from mimiqcircuits import * >>> GateISWAPDG() ISWAP† >>> GateISWAPDG().matrix() [1.0, 0, 0, 0] [0, 0, 6.12323399573677e-17 - 1.0*I, 0] [0, 6.12323399573677e-17 - 1.0*I, 0, 0] [0, 0, 0, 1.0] >>> c = Circuit().push(GateISWAPDG(), 0, 1) >>> GateISWAPDG().power(2), GateISWAPDG().inverse() (ISWAP†**2, ISWAP) >>> GateISWAPDG().decompose() 2-qubit circuit with 6 instructions: ├── H @ q[1] ├── CX @ q[1], q[0] ├── CX @ q[0], q[1] ├── H @ q[0] ├── S† @ q[1] └── S† @ q[0]
- inverse()[source]¶
Raise an error, as non-unitary operators cannot be inverted.
This method is not implemented for non-unitary operators and will raise a NotImplementedError if called.
- Raises:
NotImplementedError – If the method is called.