Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Six-copy qubit stabilizer testing

Open
QAlgorithms.Papers.Independent.Extend50.P30.qubitStabilizerTesting

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

prove2quantum

For every nnn, the fixed effect of Algorithm 1 is a valid six-copy accepting effect. Its verification unitary factors into nnn identical fixed-size six-qubit blocks, giving the stated efficient circuit realization. For every normalized pure nnn-qubit state ψ\psiψ, it accepts stabilizers with certainty. If every pure stabilizer SSS satisfies ∣⟨S∣ψ⟩∣2≤1−ε2|\langle S|\psi\rangle|^2\leq1-\varepsilon^2∣⟨S∣ψ⟩∣2≤1−ε2, then its acceptance probability obeys the bound below.

paccept(S)=1,paccept(ψ)≤1−ε24.p_{\rm accept}(S)=1,\qquad p_{\rm accept}(\psi)\leq1-\frac{\varepsilon^2}{4}.paccept​(S)=1,paccept​(ψ)≤1−4ε2​.

This gives the source's six-copy qubit stabilizer testing in the fixed computational-basis and phase conventions.

Formalization Note Pure states carry norm one; stabilizer averages use density matrices to discard global phases. All finite tensor indices are explicitly ordered by copy, then physical qudit.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P30
Formal statement
noncomputable section

open scoped BigOperators ComplexConjugate Matrix

namespace QAlgorithms.Papers.Independent.Extend50.P30

open QAlgorithms.Papers.Independent.Information100.P63 (tensorPower)

open QAlgorithms.Papers.Independent.Gap20.P06 (ketBra)

attribute [local instance] Classical.propDecidable

/-- PDF p.20, Theorem 3.3: Algorithm 1 is fixed, perfectly complete, and has the printed 1/4 constant. -/
theorem qubitStabilizerTesting (n : ℕ) :
    qubitVerificationUnitary 1 ∈ Matrix.unitaryGroup (QuditCopies 2 1 6) ℂ ∧
    qubitTest n = (2⁻¹ : ℂ) • (1 +
      (List.ofFn (fun j : Fin n => embeddedLocal j (qubitVerificationUnitary 1))).prod) ∧
    QAlgorithms.IsEffect (qubitTest n) ∧
    ∀ v : EuclideanSpace ℂ (ResidueRegister 2 n), ‖v‖ = 1 →
      (IsStabilizer v → QAlgorithms.effectProb (qubitTest n)
        (tensorPower 6 (QAlgorithms.pureDensity v)) = 1) ∧
      (∀ epsilon : ℝ, FarFromStabilizers v epsilon →
        QAlgorithms.effectProb (qubitTest n) (tensorPower 6 (QAlgorithms.pureDensity v)) ≤
          1 - epsilon ^ 2 / 4) := by sorry

end QAlgorithms.Papers.Independent.Extend50.P30

end
Source
Schur-Weyl Duality for the Clifford Group with Applications: Property Testing, a Robust Hudson Theorem, and de Finetti Representations, arXiv:1712.08628v3, PDF p. 20, theorem-3.3
Read-back

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

For each m∈Nm\in\mathbb Nm∈N, let Rm=(Z/2Z)mR_m=(\mathbb Z/2\mathbb Z)^mRm​=(Z/2Z)m, Zm=Rm×RmZ_m=R_m\times R_mZm​=Rm​×Rm​, and define Wp,q(a,b)=i−∑jval⁡(pj)val⁡(qj)(−1)∑jval⁡(pj)val⁡(aj)W_{p,q}(a,b)=i^{-\sum_j\operatorname{val}(p_j)\operatorname{val}(q_j)}(-1)^{\sum_j\operatorname{val}(p_j)\operatorname{val}(a_j)}Wp,q​(a,b)=i−∑j​val(pj​)val(qj​)(−1)∑j​val(pj​)val(aj​) when a=b+qa=b+qa=b+q, and zero otherwise. Set Bz(a,b)=2−m/2Wz(a,b)B_z(a,b)=2^{-m/2}W_z(a,b)Bz​(a,b)=2−m/2Wz​(a,b), Pw(a,b)=w(a)w(b)‾P_w(a,b)=w(a)\overline{w(b)}Pw​(a,b)=w(a)w(b)​, Da=∑z∈ZmPBz⊗PBz+aD_a=\sum_{z\in Z_m}P_{B_z}\otimes P_{B_{z+a}}Da​=∑z∈Zm​​PBz​​⊗PBz+a​​, and Tm=12∑a∈ZmDa⊗(I+Wa⊗Wa†)T_m=\frac12\sum_{a\in Z_m}D_a\otimes(I+W_a\otimes W_a^\dagger)Tm​=21​∑a∈Zm​​Da​⊗(I+Wa​⊗Wa†​) on six copies. The theorem asserts that V1=2T1−IV_1=2T_1-IV1​=2T1​−I is unitary and, for every n∈Nn\in\mathbb Nn∈N,

Tn=12(I+∏j=0n−1Lj(V1)),Tn⪰0,I−Tn⪰0.T_n=\frac12\left(I+\prod_{j=0}^{n-1}L_j(V_1)\right), \qquad T_n\succeq0,\qquad I-T_n\succeq0.Tn​=21​(I+j=0∏n−1​Lj​(V1​)),Tn​⪰0,I−Tn​⪰0.

The product is in increasing order of jjj; Lj(K)L_j(K)Lj​(K) acts by KKK on the six coordinates at site jjj, and its matrix entry is zero unless all six copies agree between row and column at every other site. For every unit vector v∈CRnv\in\mathbb C^{R_n}v∈CRn​, write pv=Re⁡tr⁡(TnPv⊗6)p_v=\operatorname{Re}\operatorname{tr}(T_nP_v^{\otimes6})pv​=Retr(Tn​Pv⊗6​), where tensor-power entries are products of the corresponding entries of PvP_vPv​. Let Sn\mathcal S_nSn​ consist of all matrices (tr⁡AG)−1AG(\operatorname{tr}A_G)^{-1}A_G(trAG​)−1AG​ that are rank-one matrices of unit vectors, where AG=∣G∣−1∑P∈GPA_G=|G|^{-1}\sum_{P\in G}PAG​=∣G∣−1∑P∈G​P, G⊆{ihWz:0≤h<4, z∈Zn}G\subseteq\{i^hW_z:0\le h<4,\ z\in Z_n\}G⊆{ihWz​:0≤h<4, z∈Zn​} contains III, is closed under multiplication and adjoints, and has no scalar matrix cIcIcI with c≠1c\ne1c=1. If Pv∈SnP_v\in\mathcal S_nPv​∈Sn​, then pv=1p_v=1pv​=1. For every real ϵ\epsilonϵ, if Re⁡tr⁡(SPv)≤1−ϵ2\operatorname{Re}\operatorname{tr}(SP_v)\le1-\epsilon^2Retr(SPv​)≤1−ϵ2 for every S∈SnS\in\mathcal S_nS∈Sn​, then pv≤1−ϵ2/4p_v\le1-\epsilon^2/4pv​≤1−ϵ2/4. No positivity restriction is placed on ϵ\epsilonϵ. When n=0n=0n=0, the local product is the empty product III.

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

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 29, 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