Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Qudit stabilizer testing

Open
QAlgorithms.Papers.Independent.Extend50.P30.quditStabilizerTesting

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

prove2quantum

Let d≥2d\geq2d≥2 and s≥2s\geq2s≥2 with gcd⁡(d,s)=1\gcd(d,s)=1gcd(d,s)=1. For any nnn, Πs,accept=(I+Vs)/2\Pi_{s,\rm accept}=(I+V_s)/2Πs,accept​=(I+Vs​)/2 is a valid effect on 2s2s2s copies. It accepts every pure stabilizer certainly. On any normalized pure state whose stabilizer fidelities are all at most 1−ε21-\varepsilon^21−ε2, its acceptance probability obeys the following bound.

paccept≤1−Cd,sε2,Cd,s=1−(1−1/(4d2))s−12.p_{\rm accept}\leq1-C_{d,s}\varepsilon^2,\qquad C_{d,s}=\frac{1-(1-1/(4d^2))^{s-1}}2.paccept​≤1−Cd,s​ε2,Cd,s​=21−(1−1/(4d2))s−1​.

This gives the source's qudit 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.25, Theorem 3.11: composite d is allowed and all factors of C_{d,s} are retained. -/
theorem quditStabilizerTesting (d n s : ℕ) [NeZero d] (hd : 2 ≤ d)
    (hs : 2 ≤ s) (hcop : Nat.Coprime d s) :
    QAlgorithms.IsEffect (quditTest d n s) ∧
    ∀ v : EuclideanSpace ℂ (ResidueRegister d n), ‖v‖ = 1 →
      (IsStabilizer v → QAlgorithms.effectProb (quditTest d n s)
        (tensorPower (2 * s) (QAlgorithms.pureDensity v)) = 1) ∧
      (∀ epsilon : ℝ, FarFromStabilizers v epsilon →
        QAlgorithms.effectProb (quditTest d n s) (tensorPower (2 * s) (QAlgorithms.pureDensity v)) ≤
          1 - soundnessConstant d s * epsilon ^ 2) := 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. 25, theorem-3.11
Read-back

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

For natural numbers d,n,sd,n,sd,n,s, assume d≠0d\ne0d=0, d≥2d\ge2d≥2, s≥2s\ge2s≥2, and gcd⁡(d,s)=1\gcd(d,s)=1gcd(d,s)=1. Write V=(Z/dZ)nV=(\mathbb Z/d\mathbb Z)^nV=(Z/dZ)n, ωd=e2πi/d\omega_d=e^{2\pi i/d}ωd​=e2πi/d, and τd=(−1)deπi/d\tau_d=(-1)^d e^{\pi i/d}τd​=(−1)deπi/d, and define W(p,q)(a,b)W_{(p,q)}(a,b)W(p,q)​(a,b) to be τd−∑j[pj][qj]ωd∑j[pj][aj]\tau_d^{-\sum_j[p_j][q_j]}\omega_d^{\sum_j[p_j][a_j]}τd−∑j​[pj​][qj​]​ωd∑j​[pj​][aj​]​ when a=b+qa=b+qa=b+q, and 000 otherwise, using standard integer representatives of residues. Let

J(u,v)=d−n∑x∈V×V∏j=02s−1{Wx(uj,vj),j even,Wx†(uj,vj),j odd,T=I+J2.J(u,v)=d^{-n}\sum_{x\in V\times V} \prod_{j=0}^{2s-1} \begin{cases} W_x(u_j,v_j),&j\text{ even},\\ W_x^\dagger(u_j,v_j),&j\text{ odd}, \end{cases} \qquad T=\frac{I+J}{2}.J(u,v)=d−nx∈V×V∑​j=0∏2s−1​{Wx​(uj​,vj​),Wx†​(uj​,vj​),​j even,j odd,​T=2I+J​.

To specify the stabilizers in the assertion, put hd=2dh_d=2dhd​=2d for even ddd and hd=dh_d=dhd​=d for odd ddd, and form the finite set P={τdaWx:0≤a<hd, x∈V×V}\mathcal P=\{\tau_d^aW_x:0\le a<h_d,\ x\in V\times V\}P={τda​Wx​:0≤a<hd​, x∈V×V}. Consider every subset G⊆PG\subseteq\mathcal PG⊆P that contains III, is closed under multiplication and adjoints, and satisfies A=cI⇒c=1A=cI\Rightarrow c=1A=cI⇒c=1 for every A∈GA\in GA∈G and c∈Cc\in\mathbb Cc∈C. For each such GGG, set HG=∣G∣−1∑A∈GAH_G=|G|^{-1}\sum_{A\in G}AHG​=∣G∣−1∑A∈G​A; let S\mathcal SS consist of those matrices HG/tr⁡HGH_G/\operatorname{tr}H_GHG​/trHG​ that equal ww†ww^\daggerww† for some unit vector www. These formulas use total scalar inverses, with 0−1=00^{-1}=00−1=0. Then TTT and I−TI-TI−T are positive semidefinite. Moreover, for every unit vector v∈CVv\in\mathbb C^Vv∈CV, writing ρv=vv†\rho_v=vv^\daggerρv​=vv†, if ρv∈S\rho_v\in\mathcal Sρv​∈S, then

Re⁡tr⁡(Tρv⊗2s)=1.\operatorname{Re}\operatorname{tr}(T\rho_v^{\otimes 2s})=1.Retr(Tρv⊗2s​)=1.

For every real ϵ\epsilonϵ, if Re⁡tr⁡(Sρv)≤1−ϵ2\operatorname{Re}\operatorname{tr}(S\rho_v)\le1-\epsilon^2Retr(Sρv​)≤1−ϵ2 for every S∈SS\in\mathcal SS∈S, then

Re⁡tr⁡(Tρv⊗2s)≤1−1−(1−14d2)s−12 ϵ2.\operatorname{Re}\operatorname{tr}(T\rho_v^{\otimes 2s}) \le 1-\frac{1-\left(1-\frac1{4d^2}\right)^{s-1}}2\,\epsilon^2.Retr(Tρv⊗2s​)≤1−21−(1−4d21​)s−1​ϵ2.

Here ρv⊗2s(u,w)=∏jv(uj)v(wj)‾\rho_v^{\otimes 2s}(u,w)=\prod_jv(u_j)\overline{v(w_j)}ρv⊗2s​(u,w)=∏j​v(uj​)v(wj​)​. The assertion includes n=0n=0n=0, and the soundness implication quantifies over all real ϵ\epsilonϵ, including zero and negative values.

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