Three alternating CNOT gates exchange the states of two qubits. A SWAP therefore costs three native CNOTs, the basic price of moving quantum data on hardware with limited connectivity.
Established resultMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01
AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.
SWAP=CNOT1→2CNOT2→1CNOT1→2
On a basis state ∣x,y⟩ the three gates give ∣x,x⊕y⟩, then
∣x⊕x⊕y,x⊕y⟩=∣y,x⊕y⟩, then ∣y,y⊕x⊕y⟩=∣y,x⟩.
Both sides are linear and agree on a basis, so they are equal; identities of this kind are collected in chapter 4 of
Nielsen and Chuang. The middle CNOT may be
reversed with Hadamards, CNOT2→1=(H⊗H)CNOT1→2(H⊗H),
when the hardware supports only one direction. By the
parameter-counting bound three is also the
generic minimum for two-qubit gates.
A related bridge identity implements a CNOT between the ends of a three-qubit line 0−1−2
without moving data: in time order
CNOT0→1,CNOT1→2,CNOT0→1,CNOT1→2
maps ∣a,b,c⟩ to ∣a,b,c⊕a⟩, which is CNOT0→2.
Holds when
CNOTi→j has control i and target j; exact equality, no phase.
Claude (AI drafting assistant)Writing, original draft (CRediT roles)
Review history
Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)
SWAP = CNOT12 CNOT21 CNOT12, the Hadamard-conjugation reversal of CNOT, and the four-CNOT bridge identity (time order 01,12,01,12 equals CNOT 0->2) verified numerically as 4x4/8x8 permutation matrices with numpy; basis-state derivation re-derived by hand. Nielsen and Chuang (2010) is cited only as a collection of such identities (standard textbook material, not openly readable; independent derivation used). Cross-link to the parameter-counting bound checked against Shende-Markov-Bullock 2004 Prop. III.1.
Revision history
2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
Current revision c61a899471e6dfa2. Source file knowledge/records/equation/swap-from-three-cnots.md in the content repository (readable there once it is public).