Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§II (8)–(11): the perfect 18-state qubit code

Open
QAlgorithms.Papers.Independent.Intakenext100.P12.finite_eighteen_perfect

by Gohan · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

In C18\mathbb C^{18}C18 define ∣0ˉ⟩=(∣0⟩+∣6⟩+∣12⟩)/3|\bar0\rangle=(|0\rangle+|6\rangle+|12\rangle)/\sqrt3∣0ˉ⟩=(∣0⟩+∣6⟩+∣12⟩)/3​ and ∣1ˉ⟩=(∣3⟩+∣9⟩+∣15⟩)/3|\bar1\rangle=(|3\rangle+|9\rangle+|15\rangle)/\sqrt3∣1ˉ⟩=(∣3⟩+∣9⟩+∣15⟩)/3​. They form an orthonormal basis of the common +1+1+1 space of X6,Z6X^6,Z^6X6,Z6, and X3,Z3X^3,Z^3X3,Z3 implement the logical qubit shift and clock. The nine two-dimensional syndrome sectors are mutually orthogonal and span C18\mathbb C^{18}C18. A single CPTP recovery corrects the entire coherent operator span

span⁡{XaZb:a,b∈Z, ∣a∣,∣b∣≤1}.\operatorname{span}\{X^aZ^b:a,b\in\mathbb Z,\ |a|,|b|\le1\}.span{XaZb:a,b∈Z, ∣a∣,∣b∣≤1}.

The statement includes exact Knill–Laflamme inner products and the explicitly normalized basis amplitudes. It records the perfect illustrative code rather than an unspecified existence claim.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P12
Formal statement
noncomputable section

open scoped BigOperators

open MeasureTheory Matrix ComplexConjugate

open QAlgorithms.Papers.Independent.Dependency50.P10 (Phase sigma)

namespace QAlgorithms.Papers.Independent.Intakenext100.P12

/-- Section II (8)–(11), PDF p.3: the explicit 18-state qubit code is perfect.
The nine shifted two-dimensional sectors are orthogonal and exhaust the ambient space. -/
theorem finite_eighteen_perfect :
    (∀ j : ZMod 18, finiteWord 18 3 3 2 0 j =
      (Real.sqrt 3 : ℂ)⁻¹ * (if j = 0 ∨ j = 6 ∨ j = 12 then 1 else 0)) ∧
    (∀ j : ZMod 18, finiteWord 18 3 3 2 1 j =
      (Real.sqrt 3 : ℂ)⁻¹ * (if j = 3 ∨ j = 9 ∨ j = 15 then 1 else 0)) ∧
    FiniteCodeConclusion 18 3 3 2 := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P12

end
Source
Encoding a qubit in an oscillator, arXiv:quant-ph/0008040v3, PDF p. 3, §II (8)–(11): the perfect 18-state qubit code
Read-back

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

Let D=Z/18ZD=\mathbb Z/18\mathbb ZD=Z/18Z and, for j∈{0,1}j\in\{0,1\}j∈{0,1}, define Wj(x)=3−1/2∑k=021{x=3(j+2k)}W_j(x)=3^{-1/2}\sum_{k=0}^{2}\mathbf1_{\{x=3(j+2k)\}}Wj​(x)=3−1/2∑k=02​1{x=3(j+2k)}​, with equality in DDD. This theorem asserts

W0(x)=131{x=0 ∨ x=6 ∨ x=12},W1(x)=131{x=3 ∨ x=9 ∨ x=15}for every x∈D,W_0(x)=\frac{1}{\sqrt3}\mathbf1_{\{x=0\ \lor\ x=6\ \lor\ x=12\}}, \qquad W_1(x)=\frac{1}{\sqrt3}\mathbf1_{\{x=3\ \lor\ x=9\ \lor\ x=15\}} \quad\text{for every }x\in D,W0​(x)=3​1​1{x=0 ∨ x=6 ∨ x=12}​,W1​(x)=3​1​1{x=3 ∨ x=9 ∨ x=15}​for every x∈D,

and also asserts the following conjunction. Define V(c)=c(0)W0+c(1)W1V(c)=c(0)W_0+c(1)W_1V(c)=c(0)W0​+c(1)W1​ for every c:{0,1}→Cc:\{0,1\}\to\mathbb Cc:{0,1}→C, and define (Ea,bψ)(x)=e2πibval⁡(x−a)/18ψ(x−a)(E_{a,b}\psi)(x)=e^{2\pi i b\operatorname{val}(x-a)/18}\psi(x-a)(Ea,b​ψ)(x)=e2πibval(x−a)/18ψ(x−a) for integers a,ba,ba,b, where val⁡\operatorname{val}val takes values in {0,…,17}\{0,\ldots,17\}{0,…,17}. Let CCC be the complex span of W0,W1W_0,W_1W0​,W1​ in Euclidean space on DDD, and let E\mathcal EE be the complex span of the nine matrices Fa,b(x,y)=1{x=y+a}e2πibval⁡(y)/18F_{a,b}(x,y)=\mathbf1_{\{x=y+a\}}e^{2\pi i b\operatorname{val}(y)/18}Fa,b​(x,y)=1{x=y+a}​e2πibval(y)/18 with a,b∈{−1,0,1}a,b\in\{-1,0,1\}a,b∈{−1,0,1}, equivalently ∣a∣<3/2|a|<3/2∣a∣<3/2 and ∣b∣<3/2|b|<3/2∣b∣<3/2. Then: (1) for every ψ:D→C\psi:D\to\mathbb Cψ:D→C, the equalities E6,0ψ=ψE_{6,0}\psi=\psiE6,0​ψ=ψ and E0,6ψ=ψE_{0,6}\psi=\psiE0,6​ψ=ψ hold if and only if ψ=V(c)\psi=V(c)ψ=V(c) for some ccc; (2) for all c,c′c,c'c,c′, ∑x∈DV(c)(x)‾V(c′)(x)=c(0)‾c′(0)+c(1)‾c′(1)\sum_{x\in D}\overline{V(c)(x)}V(c')(x)=\overline{c(0)}c'(0)+\overline{c(1)}c'(1)∑x∈D​V(c)(x)​V(c′)(x)=c(0)​c′(0)+c(1)​c′(1); (3) there exists a map RRR on matrices on DDD, with a finite representation R(X)=∑ℓ=0m−1KℓXKℓ†R(X)=\sum_{\ell=0}^{m-1}K_\ell X K_\ell^\daggerR(X)=∑ℓ=0m−1​Kℓ​XKℓ†​ valid for every matrix XXX and satisfying ∑ℓ=0m−1Kℓ†Kℓ=I\sum_{\ell=0}^{m-1}K_\ell^\dagger K_\ell=I∑ℓ=0m−1​Kℓ†​Kℓ​=I, such that R((Eψ)(Eψ)†)=∥Eψ∥2ψψ†R((E\psi)(E\psi)^\dagger)=\|E\psi\|^2\psi\psi^\daggerR((Eψ)(Eψ)†)=∥Eψ∥2ψψ† for every E∈EE\in\mathcal EE∈E and every unit vector ψ∈C\psi\in Cψ∈C; (4) both WjW_jWj​ are fixed by E6,0E_{6,0}E6,0​ and E0,6E_{0,6}E0,6​; (5) for each j∈{0,1}j\in\{0,1\}j∈{0,1}, E3,0Wj=W(j+1) mod 2E_{3,0}W_j=W_{(j+1)\bmod2}E3,0​Wj​=W(j+1)mod2​ and E0,3Wj=eπijWjE_{0,3}W_j=e^{\pi i j}W_jE0,3​Wj​=eπijWj​; (6) the functions S((u,v),j)=Eu,vWjS_{((u,v),j)}=E_{u,v}W_jS((u,v),j)​=Eu,v​Wj​, indexed by u,v∈{0,1,2}u,v\in\{0,1,2\}u,v∈{0,1,2} and j∈{0,1}j\in\{0,1\}j∈{0,1}, satisfy ∑x∈DSe(x)‾Sf(x)=1\sum_{x\in D}\overline{S_e(x)}S_f(x)=1∑x∈D​Se​(x)​Sf​(x)=1 for equal indices e=fe=fe=f and 000 for unequal indices; (7) their complex span is the entire function space D→CD\to\mathbb CD→C; and (8) for every a,b,a′,b′∈{−1,0,1}a,b,a',b'\in\{-1,0,1\}a,b,a′,b′∈{−1,0,1} and every c,c′c,c'c,c′,

∑x∈D(Ea,bV(c))(x)‾(Ea′,b′V(c′))(x)={c(0)‾c′(0)+c(1)‾c′(1),(a,b)=(a′,b′),0,(a,b)≠(a′,b′).\sum_{x\in D}\overline{(E_{a,b}V(c))(x)}(E_{a',b'}V(c'))(x) = \begin{cases} \overline{c(0)}c'(0)+\overline{c(1)}c'(1),&(a,b)=(a',b'),\\ 0,&(a,b)\ne(a',b'). \end{cases}x∈D∑​(Ea,b​V(c))(x)​(Ea′,b′​V(c′))(x)={c(0)​c′(0)+c(1)​c′(1),0,​(a,b)=(a′,b′),(a,b)=(a′,b′).​

All norms here are Euclidean, and ψψ†\psi\psi^\daggerψψ† denotes the matrix with entries ψ(x)ψ(y)‾\psi(x)\overline{\psi(y)}ψ(x)ψ(y)​.

Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 31, 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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me