Use three controlled-NOT gates with control-target directions
On computational-basis bits they act as
They therefore implement the Three-CNOT decomposition of the SWAP gate, and linearity proves the identity on every two-qubit state.
SWAP gate Created 2026-09-24 Updated 2026-11-05
The SWAP gate exchanges the states of two qubits, including any correlations they have with other systems. Its action on the computational basis fixes the operation on every quantum superposition by linearity.
The SWAP gate maps to .
In particular, . This transfers rather than copies the two inputs, so it does not violate the no-cloning theorem. The Three-CNOT decomposition of the SWAP gate implements the same operation using alternating control directions. [ref]