mimiqcircuits.operations.gates.standard.iswap¶
iSWAP and iSWAP† gates.
Classes
Two qubit iSWAP gate. |
|
|
Two qubit iSWAP† gate, the inverse of |
- class GateISWAP[source]¶
Bases:
GateTwo qubit iSWAP gate.
Swaps the states of the two qubits and adds a phase \(i\) to \(|01\rangle\) and \(|10\rangle\).
Matrix 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) >>> c 2-qubit circuit with 1 instruction: └── ISWAP @ q[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]
See also
GateISWAPDG,GateSWAP
- class GateISWAPDG(operation=None, *args, **kwargs)[source]¶
Bases:
InverseTwo qubit iSWAP† gate, the inverse of
GateISWAP.Matrix 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) >>> c 2-qubit circuit with 1 instruction: └── ISWAP† @ q[0:1] >>> GateISWAPDG().power(2), GateISWAPDG().inverse() (ISWAP†**2, ISWAP) >>> GateISWAPDG().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]
See also
GateISWAP,GateSWAP- 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
GateSasGateZto the power 1/2. Such gates returnTrue. Not every such gate reports it:GateSDGandGateCXreturnFalse.- Returns:
Truefor a named alias of a wrapper that reports it,Falseotherwise.- Return type: