Proof that swap networks make every pair adjacent once
Each qubit moves ballistically, one site per round, and pauses for one round when it reaches an end of the line; after n rounds this reverses the order, and a counting argument shows that every pair swaps exactly once.
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.
Active pairs. In round t+1 the SWAPs act on the pairs {y,y+1} with y≡t(mod2). Each
position x belongs to at most one active pair: as its left member if x≡t and x≤n−2,
as its right member if x≡t+1 and x≥1. Position n−1 with n−1≡t and position 0
with 0≡t+1 are the only positions not in an active pair.
Trajectories. Define the fold map F(u)=u for 0≤u≤n−1, F(u)=2n−1−u for
n≤u≤2n−1 and F(u)=−1−u for −n≤u≤−1. For the qubit starting at i put
ui(t)=i+t if i is even and ui(t)=i−t if i is odd; for 0≤t≤n these stay in
[−n,2n−1]. Call the qubit a right-mover after t rounds if ui(t)∈[0,n−1] with i even
or ui(t)∈[−n,−1] with i odd, and a left-mover otherwise. From the formulas,
F(ui(t+1))=F(ui(t))+1 for a right-mover not at position n−1,
F(ui(t+1))=F(ui(t))−1 for a left-mover not at position 0, and F(ui(t+1))=F(ui(t)) for a
right-mover at n−1 or a left-mover at 0. A direct parity check gives: a qubit with
F(ui(t))=x is a right-mover exactly when x≡t(mod2) (for even i unreflected
x=i+t; reflected x=2n−1−i−t; for odd i unreflected x=i−t; reflected x=t−1−i).
We show by induction on t that after t rounds the qubit starting at i sits at F(ui(t)). This
holds for t=0. Assume it after t rounds and consider round t+1. A right-mover at x≤n−2
has x≡t, so it is the left member of an active pair and moves to x+1. A left-mover at
x≥1 has x≡t+1, so it is the right member of an active pair and moves to x−1. A
right-mover at n−1 (then n−1≡t) and a left-mover at 0 (then 0≡t+1) are in
no active pair and stay. In every active pair the left member is a right-mover and the right member a
left-mover, so these moves are exactly the SWAPs of the round, and each agrees with
F(ui(t+1)) as computed above.
Reversal. The ranges stay within the domain of F: for even i, ui(n)=i+n∈[n,2n−1], so
xi(n)=2n−1−i−n=n−1−i; for odd i, ui(n)=i−n∈[−n,−1], so
xi(n)=−1−i+n=n−1−i.
Every pair exactly once. Round t+1 with t even contains ⌊n/2⌋ SWAPs and round
t+1 with t odd contains ⌊(n−1)/2⌋. Among t=0,…,n−1 there are
⌈n/2⌉ even and ⌊n/2⌋ odd values, which gives n(n−1)/2 SWAPs in total for both parities of n. A SWAP changes the relative
order of only the two qubits it exchanges. Every pair i<j ends in the opposite order, so it was
swapped an odd number of times, at least once. With (2n) pairs and (2n) SWAPs, each pair is
swapped exactly once, and it is adjacent at that moment.
Claude (AI drafting assistant)Writing, original draft (CRediT roles)
Review history
Automated source check · Pass with notes · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)
Proof checked by hand (active pairs, fold map F, mover parity, induction, reversal, counting and the odd-number-of-swaps argument) and by exhaustive simulation for n = 1..13 (python): positions after every round equal F(u_i(t)), final position n - 1 - i, n(n-1)/2 SWAPs, every pair swapped exactly once. Application claim compared with the abstract of Kivlichan et al., arXiv 1711.04789 (fermionic swap network, Trotter step in depth N with N^2/2 entangling gates).
The SWAP count per round was stated with the parities of t interchanged relative to the convention 'round t+1 acts on pairs with y = t mod 2' used earlier in the proof (with that convention, even t gives floor(n/2) SWAPs). Restated the counts in terms of t; the total n(n-1)/2 was already right.
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 d5c44a5b3faaf61a. Source file knowledge/records/proof/swap-network-adjacency.md in the content repository (readable there once it is public).