Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Exchanging arbitrary qubits characterizes the SWAP class

Open
QAlgorithms.Papers.Independent.Intakethird100.P99.twoQubitsCapability_cost

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

For a two-qubit unitary UUU, let β\betaβ be an actual interaction-content witness: UUU is locally equivalent, up to global phase, to Uβ=exp⁡[−i∑k=13βkσk⊗σk]U_\beta=\exp[-i\sum_{k=1}^3\beta_k\sigma_k\otimes\sigma_k]Uβ​=exp[−i∑k=13​βk​σk​⊗σk​], where σ1,σ2,σ3\sigma_1,\sigma_2,\sigma_3σ1​,σ2​,σ3​ are the Pauli matrices X,Y,ZX,Y,ZX,Y,Z and π/4≥β1≥β2≥∣β3∣\pi/4\ge\beta_1\ge\beta_2\ge|\beta_3|π/4≥β1​≥β2​≥∣β3​∣. Transmission means one use of the gate with normalized pure product inputs, without ancillas or prior shared entanglement. Encoding and decoding axes are free local choices fixed before the unknown input. Classical messages are encoded in orthogonal states and decoded with certainty; qubit transmission preserves every superposition with the same encoding and recovery. In simultaneous tasks, a receiver may choose its local decoder according to its own sent classical bit. Simultaneous exchange of arbitrary unknown qubits is equivalent to membership in the SWAP local-equivalence class, where SWAP exchanges the two tensor factors. Precisely,

U exchanges two arbitrary qubits⟺U∼LUSWAP⟺β1=β2=∣β3∣=π/4.U\text{ exchanges two arbitrary qubits}\quad\Longleftrightarrow\quad U\sim_{\rm LU}\mathrm{SWAP}\quad\Longleftrightarrow\quad\beta_1=\beta_2=|\beta_3|=\pi/4.U exchanges two arbitrary qubits⟺U∼LU​SWAP⟺β1​=β2​=∣β3​∣=π/4.

Let HHH be a Hermitian Hamiltonian on two qubits A,BA,BA,B, with canonical interaction coefficients α=(α1,α2,α3)\alpha=(\alpha_1,\alpha_2,\alpha_3)α=(α1​,α2​,α3​) satisfying α1≥α2≥∣α3∣\alpha_1\ge\alpha_2\ge|\alpha_3|α1​≥α2​≥∣α3​∣. Local terms in HHH are allowed. Local unitary controls are instantaneous and free, interaction intervals are nonnegative, and ℏ=1\hbar=1ℏ=1. Write CH(U)C_H(U)CH​(U) for the infimum of the interaction durations of protocols implementing the gate UUU, allowing the ideal limit of arbitrarily fine pulses at fixed total duration and disregarding global phase. This cost is an extended nonnegative real, with value +∞+\infty+∞ for an impossible simulation. For a transmission task TTT, write CH(T)=inf⁡{CH(V):V performs T}C_H(T)=\inf\{C_H(V):V\text{ performs }T\}CH​(T)=inf{CH​(V):V performs T}. An asserted optimal gate both performs the task and has an ideal simulation at the displayed time, and every capable gate has at least its cost. For α1>0\alpha_1>0α1​>0, SWAP attains CH(qubitA↔B)=3π/[4(α1+α2+∣α3∣)]C_H(\mathrm{qubit}_{A\leftrightarrow B})=3\pi/[4(\alpha_1+\alpha_2+|\alpha_3|)]CH​(qubitA↔B​)=3π/[4(α1​+α2​+∣α3​∣)]. The characterization concerns free local axes, not literal equality of unprocessed matrices.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P99
Formal statement
namespace QAlgorithms.Papers.Independent.Intakethird100.P99

open scoped Matrix Kronecker NNReal ENNReal

open QAlgorithms.Papers.Independent.Information100.P10 (pauli)

open QAlgorithms.Papers.Independent.Information100.P32 (evolution)

noncomputable section

/-- PDF p.12, IV.B.4: only the SWAP local-equivalence class exchanges arbitrary qubits;
its two signed chamber endpoints and the minimum task interaction cost are retained. -/
theorem twoQubitsCapability_cost (U H : TwoMatrix) (b a : Triple)
    (hU : HasContent U b) (hH : HasCanonicalHamiltonian H a) (ha : 0 < a 0) :
    (CanTwoQubits U ↔ TwoQubitLocalEquivalent U swapGate) ∧
    (CanTwoQubits U ↔ b 0 = Real.pi / 4 ∧ b 1 = Real.pi / 4 ∧ |b 2| = Real.pi / 4) ∧
    OptimalTask H CanTwoQubits swapGate
      (3 * Real.pi / (4 * (a 0 + a 1 + |a 2|))) := by sorry

end

end QAlgorithms.Papers.Independent.Intakethird100.P99
Source
Characterization of non-local gates, arXiv:quant-ph/0205100v3, PDF p. 12, IV.B.4: exchanging arbitrary qubits
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

Let U,HU,HU,H be complex matrices on C2⊗C2\mathbb C^2\otimes\mathbb C^2C2⊗C2, and let b=(b0,b1,b2)b=(b_0,b_1,b_2)b=(b0​,b1​,b2​) and a=(a0,a1,a2)a=(a_0,a_1,a_2)a=(a0​,a1​,a2​) be real triples. Let X=(0110)X=\left(\begin{smallmatrix}0&1\\1&0\end{smallmatrix}\right)X=(01​10​), Y=(0−ii0)Y=\left(\begin{smallmatrix}0&-i\\i&0\end{smallmatrix}\right)Y=(0i​−i0​), Z=(100−1)Z=\left(\begin{smallmatrix}1&0\\0&-1\end{smallmatrix}\right)Z=(10​0−1​), J(d)=d0X⊗X+d1Y⊗Y+d2Z⊗ZJ(d)=d_0X\otimes X+d_1Y\otimes Y+d_2Z\otimes ZJ(d)=d0​X⊗X+d1​Y⊗Y+d2​Z⊗Z, and G(d)=e−iJ(d)G(d)=e^{-iJ(d)}G(d)=e−iJ(d). Define V∼WV\sim WV∼W to mean that V=(A⊗B)W(C⊗D)V=(A\otimes B)W(C\otimes D)V=(A⊗B)W(C⊗D) for some one-qubit unitaries A,B,C,DA,B,C,DA,B,C,D. Assume UUU is unitary, b1≤b0b_1\le b_0b1​≤b0​, ∣b2∣≤b1|b_2|\le b_1∣b2​∣≤b1​, b0≤π/4b_0\le\pi/4b0​≤π/4, and U∼G(b)U\sim G(b)U∼G(b). Assume HHH is Hermitian, a1≤a0a_1\le a_0a1​≤a0​, ∣a2∣≤a1|a_2|\le a_1∣a2​∣≤a1​, and, for some one-qubit unitaries A,BA,BA,B and Hermitian one-qubit matrices K,LK,LK,L,

(A⊗B)H(A⊗B)†=J(a)+K⊗I+I⊗L,(A\otimes B)H(A\otimes B)^\dagger=J(a)+K\otimes I+I\otimes L,(A⊗B)H(A⊗B)†=J(a)+K⊗I+I⊗L,

and assume a0>0a_0>0a0​>0. For a two-qubit matrix VVV, let T(V)\mathcal T(V)T(V) mean that VVV is unitary and there exist one-qubit unitaries E,F,R,S1E,F,R,S_1E,F,R,S1​ such that, for every pair of unit vectors q,r∈C2q,r\in\mathbb C^2q,r∈C2,

(R⊗S1)V(Eq⊗Fr)=r⊗q.(R\otimes S_1)V(Eq\otimes Fr)=r\otimes q.(R⊗S1​)V(Eq⊗Fr)=r⊗q.

Let SSS denote the swap matrix, S∣i,j⟩=∣j,i⟩S|i,j\rangle=|j,i\rangleS∣i,j⟩=∣j,i⟩. Then

T(U)  ⟺  U∼S,T(U)  ⟺  b0=π4 ∧ b1=π4 ∧ ∣b2∣=π4.\mathcal T(U)\iff U\sim S, \qquad \mathcal T(U)\iff b_0=\frac\pi4\ \land\ b_1=\frac\pi4\ \land\ |b_2|=\frac\pi4.T(U)⟺U∼S,T(U)⟺b0​=4π​ ∧ b1​=4π​ ∧ ∣b2​∣=4π​.

Furthermore, SSS has property T\mathcal TT and is optimal for this property at time

t∗=3π4(a0+a1+∣a2∣)t_*=\frac{3\pi}{4(a_0+a_1+|a_2|)}t∗​=4(a0​+a1​+∣a2​∣)3π​

in the following exact sense. Let CH(V)C_H(V)CH​(V) be the infimum in [0,∞][0,\infty][0,∞] of nonnegative ttt such that HHH is Hermitian, VVV is unitary, and for every ε>0\varepsilon>0ε>0 there are a finite pulse protocol of total interaction time exactly ttt and a complex number zzz with ∣z∣=1|z|=1∣z∣=1 for which the protocol matrix is within operator norm strictly less than ε\varepsilonε of zVzVzV. A pulse protocol starts at a product A0⊗B0A_0\otimes B_0A0​⊗B0​ of one-qubit unitaries and successively replaces its current matrix PPP by (Aj⊗Bj)e−itjHP(A_j\otimes B_j)e^{-it_jH}P(Aj​⊗Bj​)e−itj​HP, with one-qubit unitaries Aj,BjA_j,B_jAj​,Bj​, nonnegative durations tjt_jtj​, and ∑jtj=t\sum_jt_j=t∑j​tj​=t; an empty pulse list is allowed, and an empty set of admissible times has infimum +∞+\infty+∞. Such approximating protocols for SSS exist at exactly t∗t_*t∗​, and

CH(S)=t∗=inf⁡{V:T(V)}CH(V),∀V,T(V)⟹CH(S)≤CH(V).C_H(S)=t_*=\inf_{\{V:\mathcal T(V)\}}C_H(V), \qquad \forall V,\quad \mathcal T(V)\Longrightarrow C_H(S)\le C_H(V).CH​(S)=t∗​={V:T(V)}inf​CH​(V),∀V,T(V)⟹CH​(S)≤CH​(V).

Here a0+a1+∣a2∣>0a_0+a_1+|a_2|>0a0​+a1​+∣a2​∣>0 follows from the hypotheses, so t∗>0t_*>0t∗​>0.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Nov 1, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me