Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

SWAP interaction content, branch choice, and cost

Open
QAlgorithms.Papers.Independent.Intakethird100.P99.swap_content_cost

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

prove2quantum

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. Assume α1>0\alpha_1>0α1​>0. For SWAP:∣i,j⟩↦∣j,i⟩\mathrm{SWAP}:|i,j\rangle\mapsto|j,i\rangleSWAP:∣i,j⟩↦∣j,i⟩, both π4(1,1,1)\frac{\pi}{4}(1,1,1)4π​(1,1,1) and π4(1,1,−1)\frac{\pi}{4}(1,1,-1)4π​(1,1,−1) describe its physical local-equivalence class, and

CH(SWAP)=3π4(α1+α2+∣α3∣).C_H(\mathrm{SWAP})=\frac{3\pi}{4(\alpha_1+\alpha_2+|\alpha_3|)}.CH​(SWAP)=4(α1​+α2​+∣α3​∣)3π​.

The positive branch attains this cost when α3≥0\alpha_3\ge0α3​≥0, and the negative branch when α3≤0\alpha_3\le0α3​≤0; both tie at zero. A branch cost is the infimum of nonnegative times satisfying that branch of s-majorization.

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.7, III.D.3: SWAP's two signed contents and cost; the positive branch is
optimal for positive a3, the negative branch for negative a3, and both tie at zero. -/
theorem swap_content_cost (H : TwoMatrix) (a : Triple)
    (hH : HasCanonicalHamiltonian H a) (ha : 0 < a 0) :
    HasContent swapGate ![Real.pi / 4, Real.pi / 4, Real.pi / 4] ∧
    HasContent swapGate ![Real.pi / 4, Real.pi / 4, -Real.pi / 4] ∧
    interactionCost H swapGate =
      ENNReal.ofReal (3 * Real.pi / (4 * (a 0 + a 1 + |a 2|))) ∧
    (0 ≤ a 2 → branchCost a ![Real.pi / 4, Real.pi / 4, Real.pi / 4] =
      interactionCost H swapGate) ∧
    (a 2 ≤ 0 → branchCost a ![Real.pi / 4, Real.pi / 4, -Real.pi / 4] =
      interactionCost H swapGate) := by sorry

end

end QAlgorithms.Papers.Independent.Intakethird100.P99
Source
Characterization of non-local gates, arXiv:quant-ph/0205100v3, PDF p. 7, III.D.3: SWAP content and interaction cost
Read-back

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

For every complex two-qubit matrix HHH and real triple aaa, assume H=H†H=H^\daggerH=H†, a1≤a0a_1\le a_0a1​≤a0​, ∣a2∣≤a1|a_2|\le a_1∣a2​∣≤a1​, a0>0a_0>0a0​>0, and there exist one-qubit unitaries A,BA,BA,B and Hermitian one-qubit matrices K,LK,LK,L with

(A⊗B)H(A⊗B)†=∑j=02ajσj⊗σj+K⊗I+I⊗L,(σ0,σ1,σ2)=(X,Y,Z).(A\otimes B)H(A\otimes B)^\dagger =\sum_{j=0}^2a_j\sigma_j\otimes\sigma_j+K\otimes I+I\otimes L, \qquad(\sigma_0,\sigma_1,\sigma_2)=(X,Y,Z).(A⊗B)H(A⊗B)†=j=0∑2​aj​σj​⊗σj​+K⊗I+I⊗L,(σ0​,σ1​,σ2​)=(X,Y,Z).

Let S∣i,j⟩=∣j,i⟩S|i,j\rangle=|j,i\rangleS∣i,j⟩=∣j,i⟩ and d±=(π/4,π/4,±π/4)d_\pm=(\pi/4,\pi/4,\pm\pi/4)d±​=(π/4,π/4,±π/4). For each of d+d_+d+​ and d−d_-d−​, SSS is unitary, the triple satisfies d1≤d0d_1\le d_0d1​≤d0​, ∣d2∣≤d1|d_2|\le d_1∣d2​∣≤d1​, d0≤π/4d_0\le\pi/4d0​≤π/4, and some four one-qubit unitaries give S=(A′⊗B′)exp⁡(−i∑jdjσj⊗σj)(C′⊗D′)S=(A'\otimes B')\exp(-i\sum_jd_j\sigma_j\otimes\sigma_j)(C'\otimes D')S=(A′⊗B′)exp(−i∑j​dj​σj​⊗σj​)(C′⊗D′). Its interaction cost is

CH(S)=3π4(a0+a1+∣a2∣).C_H(S)=\frac{3\pi}{4(a_0+a_1+|a_2|)}.CH​(S)=4(a0​+a1​+∣a2​∣)3π​.

Here CH(S)C_H(S)CH​(S) is the extended nonnegative infimum of times t≥0t\ge0t≥0 such that every ε>0\varepsilon>0ε>0 admits a finite product (Am⊗Bm)e−itmH⋯(A1⊗B1)e−it1H(A0⊗B0)(A_m\otimes B_m)e^{-it_mH}\cdots(A_1\otimes B_1)e^{-it_1H}(A_0\otimes B_0)(Am​⊗Bm​)e−itm​H⋯(A1​⊗B1​)e−it1​H(A0​⊗B0​), with one-qubit unitaries and nonnegative durations summing exactly to ttt, whose operator-norm distance from zSzSzS is strictly less than ε\varepsilonε for some ∣z∣=1|z|=1∣z∣=1; empty pulse lists are allowed. For a real triple xxx, define o(x)=(h,∑j∣xj∣−h−ℓ,η)o(x)=(h,\sum_j|x_j|-h-\ell,\eta)o(x)=(h,∑j​∣xj​∣−h−ℓ,η), where h=max⁡j∣xj∣h=\max_j|x_j|h=maxj​∣xj​∣, ℓ=min⁡j∣xj∣\ell=\min_j|x_j|ℓ=minj​∣xj​∣, and η=−ℓ\eta=-\ellη=−ℓ if x0x1x2<0x_0x_1x_2<0x0​x1​x2​<0, otherwise η=ℓ\eta=\ellη=ℓ. Define x⪯syx\preceq_s yx⪯s​y by the three inequalities

o(x)0≤o(y)0,o(x)0+o(x)1−o(x)2≤o(y)0+o(y)1−o(y)2,o(x)0+o(x)1+o(x)2≤o(y)0+o(y)1+o(y)2,o(x)_0\le o(y)_0,\qquad o(x)_0+o(x)_1-o(x)_2\le o(y)_0+o(y)_1-o(y)_2,\qquad o(x)_0+o(x)_1+o(x)_2\le o(y)_0+o(y)_1+o(y)_2,o(x)0​≤o(y)0​,o(x)0​+o(x)1​−o(x)2​≤o(y)0​+o(y)1​−o(y)2​,o(x)0​+o(x)1​+o(x)2​≤o(y)0​+o(y)1​+o(y)2​,

and Ba(d)=inf⁡{t≥0:d⪯sta}B_a(d)=\inf\{t\ge0:d\preceq_s ta\}Ba​(d)=inf{t≥0:d⪯s​ta}, with the times embedded in [0,+∞][0,+\infty][0,+∞] and empty infimum +∞+\infty+∞. Then a2≥0a_2\ge0a2​≥0 implies Ba(d+)=CH(S)B_a(d_+)=C_H(S)Ba​(d+​)=CH​(S), and a2≤0a_2\le0a2​≤0 implies Ba(d−)=CH(S)B_a(d_-)=C_H(S)Ba​(d−​)=CH​(S); both implications apply when a2=0a_2=0a2​=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