swap family 2 qubits
iSWAP
Swaps $|01\rangle$ and $|10\rangle$ and adds a phase of $i$.
The iSWAP gate exchanges the $|01\rangle$ and $|10\rangle$ states with a phase $i$, leaving $|00\rangle$ and $|11\rangle$ unchanged.
$$i\mathrm{SWAP} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & i & 0 \\ 0 & i & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$$
Properties
- Entangling and generated by an $XY$ interaction.
- $i\mathrm{SWAP}^2 = Z \otimes Z$.
- Symmetric under exchange of the two qubits.
Usage
- Native to hardware with exchange or $XY$ coupling.
- Used for excitation transfer and as a building block for CNOT with single-qubit rotations.
The unitary, drawn
Every entry of the matrix as a disc. The area is the transition probability $|U_{jk}|^2$; the colour and the hand are the phase. Rows are outputs $\langle j|$, columns inputs $|k\rangle$, in the computational basis.
Phase
Disc area $= |U_{jk}|^2$. Hover an entry for its value, or take the JSON.
Weyl chamber
Where this gate sits among all two-qubit gates, up to single-qubit rotations before and after.
Coordinates:
not entangling entangling perfect entangler
$(a, b, c)$ means the gate equals $e^{i(a\,XX + b\,YY + c\,ZZ)}$ up to single-qubit gates, reduced to the chamber $\pi/4 \ge a \ge b \ge |c|$ (the convention of the canonical gate, Qiskit and Cirq). The $a = \pi/4$ face is a mirror: $(\pi/4, b, c)$ and $(\pi/4, b, -c)$ are the same gate. Drag the figure to rotate it, double-click to reset.
SDK support
How to call this gate in each framework. Hover a ⓘ for a note; the support matrix compares every gate at once.
| SDK | Name |
|---|---|
| Qiskit | qiskit.circuit.library.iSwapGate |
| PennyLane | pennylane.ISWAP |
| Cirq | cirq.ISWAP |
| Q# | — |
| PyQuil | pyquil.gates.ISWAP |
| Braket | braket.circuits.gates.ISwap |
| BQSKit | bqskit.ir.gates.ISwapGate |
| Qibo | qibo.gates.iSWAP |
| pytket | pytket.circuit.OpType.ISWAPMax ⓘ |
| Stim | ISWAP |
| OpenQASM | — |