Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 15D c Solution Created 2026-09-24 Updated 2026-09-25
Use three controlled-NOT gates with control-target directionsOn computational-basis bits they act asThey 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.
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]
Qiskit quantum gate documentation by IBM. IBM Quantum, SwapGate: state exchange and matrix representation