The SWAP Gate Exchanges Two Qubit Positions
The SWAP gate exchanges the two qubit positions and applies the same permutation to every basis amplitude.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
On a computational basis state, \(\operatorname{SWAP}\lvert a b\rangle=\lvert b a\rangle\).
Trace a simple input
Label 01 becomes 10 and label 11 stays 11. Testing only the equal labels cannot establish that the operation moves either position. See two-qubit basis order.
Check the whole state
For a superposition, apply the same permutation to each basis coefficient. This uses linearity rather than measuring labels first. See superposition in linear operations.[1][2]