Exchanges the complete quantum states of two qubits.
The SWAP gate exchanges the full quantum state of two qubits. If qubit A is in state and qubit B is in state , after SWAP, qubit A holds and qubit B holds . This transfer includes all amplitudes, phases, and entanglement relationships. SWAP is especially important on real hardware where not every pair of qubits can interact directly. When you need two distant qubits to interact, you SWAP one of them closer first.
SWAP exchanges the computational basis states of two qubits: becomes for all values of a and b. It can be built from three CNOT gates: CNOT(1,2) then CNOT(2,1) then CNOT(1,2). SWAP preserves entanglement structure. It does not create or destroy correlations. It simply relabels which physical qubit holds which logical state. The gate is symmetric (swapping the qubit labels gives the same gate) and is its own inverse (SWAP² = I).
The measurement outcomes of the two qubits trade places in the output distribution.
Exchanges the Bloch vectors of the two qubits. Each qubit ends up with the other’s full state, including phase and purity.
It is tempting to think SWAP is trivially classical since it just moves data around. That sounds right because the truth table matches classical bit exchange. What actually happens is that SWAP transfers the full quantum state, including superposition and phase information, perfectly intact. Doing this without disturbing the quantum information is non-trivial in practice.
Real quantum hardware has limited connectivity between qubits. SWAP gates are the mechanism for moving quantum information to where it needs to be. Minimizing SWAP overhead is one of the major challenges in compiling quantum circuits for real devices.
Does applying SWAP to two qubits create entanglement?