Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Repeated qudit test and local implementation

Open
QAlgorithms.Papers.Independent.Extend50.P30.repeatedQuditTesting

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

prove2quantum

Fix d≥2d\geq2d≥2 and s≥2s\geq2s≥2 coprime to ddd. There is C>0C>0C>0, depending only on these fixed parameters, such that for every nnn and ε>0\varepsilon>0ε>0, a test using k=2srk=2srk=2sr copies accepts every stabilizer certainly and rejects every normalized state with stabilizer fidelity at most 1−ε21-\varepsilon^21−ε2 with probability at least 2/32/32/3. The effect is the tensor product of rrr copies of Πs,accept\Pi_{s,\rm accept}Πs,accept​. Moreover VsV_sVs​ is a product of nnn embedded copies of a fixed 2s2s2s-qudit unitary; its controlled version is therefore a circuit of nnn fixed-size controlled blocks.

k≤CCd,sε2,preject≥23.k\leq\frac{C}{C_{d,s}\varepsilon^2},\qquad p_{\rm reject}\geq\frac23.k≤Cd,s​ε2C​,preject​≥32​.

This gives the source's repeated qudit test and local implementation 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.26, Corollary 3.13: constants may depend on fixed d,s, never on n,epsilon,psi.
The displayed local-unitary factorization supplies the efficient implementation at fixed d,s. -/
theorem repeatedQuditTesting (d s : ℕ) [NeZero d] (hd : 2 ≤ d)
    (hs : 2 ≤ s) (hcop : Nat.Coprime d s) :
    (quditInvolution d 1 s ∈ Matrix.unitaryGroup (QuditCopies d 1 (2 * s)) ℂ) ∧
    (∀ n : ℕ, quditInvolution d n s =
      (List.ofFn (fun j : Fin n => embeddedLocal j (quditInvolution d 1 s))).prod) ∧
    ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, ∀ epsilon : ℝ, 0 < epsilon →
      ∃ r : ℕ, ∃ A : CopyTest d n,
        A.copies = 2 * s * r ∧ HEq A.accept (repeatEffect r (quditTest d n s)) ∧
        (A.copies : ℝ) ≤ C / (soundnessConstant d s * epsilon ^ 2) ∧
        ∀ v : EuclideanSpace ℂ (ResidueRegister d n), ‖v‖ = 1 →
          (IsStabilizer v → A.prob v = 1) ∧
          (FarFromStabilizers v epsilon → A.prob v ≤ 1 / 3) := 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. 26, corollary-3.13
Read-back

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

For natural numbers d,sd,sd,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. For each natural number nnn, put Vn=(Z/dZ)nV_n=(\mathbb Z/d\mathbb Z)^nVn​=(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)^de^{\pi i/d}τd​=(−1)deπi/d, and define Wn,(p,q)(a,b)=τd−∑j[pj][qj]ωd∑j[pj][aj]W_{n,(p,q)}(a,b)=\tau_d^{-\sum_j[p_j][q_j]}\omega_d^{\sum_j[p_j][a_j]}Wn,(p,q)​(a,b)=τd−∑j​[pj​][qj​]​ωd∑j​[pj​][aj​]​ if a=b+qa=b+qa=b+q, and 000 otherwise, with standard integer representatives. Define

Jn(u,v)=d−n∑x∈Vn×Vn∏i=02s−1{Wn,x(ui,vi),i even,Wn,x†(ui,vi),i odd,Tn=I+Jn2,cd,s=1−(1−14d2)s−12.J_n(u,v)=d^{-n}\sum_{x\in V_n\times V_n} \prod_{i=0}^{2s-1} \begin{cases} W_{n,x}(u_i,v_i),&i\text{ even},\\ W_{n,x}^\dagger(u_i,v_i),&i\text{ odd}, \end{cases} \qquad T_n=\frac{I+J_n}{2}, \qquad c_{d,s}=\frac{1-(1-\frac1{4d^2})^{s-1}}2.Jn​(u,v)=d−nx∈Vn​×Vn​∑​i=0∏2s−1​{Wn,x​(ui​,vi​),Wn,x†​(ui​,vi​),​i even,i odd,​Tn​=2I+Jn​​,cd,s​=21−(1−4d21​)s−1​.

Then J1J_1J1​ is unitary, and for every nnn, JnJ_nJn​ is the product, in increasing site order, of the nnn matrices obtained by applying J1J_1J1​ to that site's values across all 2s2s2s copies and the identity to every other site. Explicitly, the factor for site jjj has entry J1((ui,j)i,(vi,j)i)J_1((u_{i,j})_i,(v_{i,j})_i)J1​((ui,j​)i​,(vi,j​)i​) when ui,ℓ=vi,ℓu_{i,\ell}=v_{i,\ell}ui,ℓ​=vi,ℓ​ for every copy iii and every ℓ≠j\ell\ne jℓ=j, and entry 000 otherwise. Furthermore, there is a real C>0C>0C>0 such that for every nnn and every real ϵ>0\epsilon>0ϵ>0, there exist a natural number rrr and a test with a natural copy count mmm and an acceptance matrix AAA satisfying A≥0A\ge0A≥0, I−A≥0I-A\ge0I−A≥0,

m=2sr,A(u,v)=∏j=0r−1Tn((u2sj+i)i=02s−1,(v2sj+i)i=02s−1),m≤Ccd,sϵ2,m=2sr,\qquad A(u,v)=\prod_{j=0}^{r-1} T_n\bigl((u_{2sj+i})_{i=0}^{2s-1},(v_{2sj+i})_{i=0}^{2s-1}\bigr), \qquad m\le\frac{C}{c_{d,s}\epsilon^2},m=2sr,A(u,v)=j=0∏r−1​Tn​((u2sj+i​)i=02s−1​,(v2sj+i​)i=02s−1​),m≤cd,s​ϵ2C​,

where the matrix equality uses the identification of indices supplied by m=2srm=2srm=2sr. To define the relevant stabilizer set Sn\mathcal S_nSn​, take Pn={τdaWn,x:0≤a<hd, x∈Vn×Vn}\mathcal P_n=\{\tau_d^aW_{n,x}:0\le a<h_d,\ x\in V_n\times V_n\}Pn​={τda​Wn,x​:0≤a<hd​, x∈Vn​×Vn​}, with hd=2dh_d=2dhd​=2d for even ddd and ddd otherwise; for every subset G⊆PnG\subseteq\mathcal P_nG⊆Pn​ containing III, closed under products and adjoints, and having no scalar element cIcIcI except with c=1c=1c=1, form HG=∣G∣−1∑P∈GPH_G=|G|^{-1}\sum_{P\in G}PHG​=∣G∣−1∑P∈G​P, and retain HG/tr⁡HGH_G/\operatorname{tr}H_GHG​/trHG​ exactly when it is ww†ww^\daggerww† for a unit vector www, using total scalar inverses. For every unit v∈CVnv\in\mathbb C^{V_n}v∈CVn​, the test's probability is Re⁡tr⁡(A(vv†)⊗m)\operatorname{Re}\operatorname{tr}(A(vv^\dagger)^{\otimes m})Retr(A(vv†)⊗m); it equals 111 if vv†∈Snvv^\dagger\in\mathcal S_nvv†∈Sn​, and is at most 1/31/31/3 if Re⁡tr⁡(Svv†)≤1−ϵ2\operatorname{Re}\operatorname{tr}(Svv^\dagger)\le1-\epsilon^2Retr(Svv†)≤1−ϵ2 for every S∈SnS\in\mathcal S_nS∈Sn​. The constant CCC is chosen before n,ϵn,\epsilonn,ϵ; both n=0n=0n=0 and r=0r=0r=0 are allowed, with empty matrix products equal to the identity.

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