Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Two-qudit second moment and operator locality

Open
QAlgorithms.Papers.Independent.Intakethird100.P71.twoQudit_secondMoment

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

prove2quantum

In the complete locally scrambled two-qudit toy experiment, let d≥2d\ge2d≥2, 2d/(d2+1)≤w≤12d/(d^2+1)\le w\le12d/(d2+1)≤w≤1, and the snapshot features be (1,w,w,1)(1,w,w,1)(1,w,w,1). Fix a density matrix ρ\rhoρ and a traceless Hermitian observable OOO. Write T=Tr⁡(O2)T=\operatorname{Tr}(O^2)T=Tr(O2) and

K=Tr⁡[(Tr⁡2O)2]+Tr⁡[(Tr⁡1O)2].K=\operatorname{Tr}[(\operatorname{Tr}_2O)^2]+\operatorname{Tr}[(\operatorname{Tr}_1O)^2].K=Tr[(Tr2​O)2]+Tr[(Tr1​O)2].

The second moment averaged over local Haar conjugations of ρ\rhoρ is

Qav(O)=d2−1d3(Kdw−1+(d2−1)(dT−K)d2−2dw+1).Q_{\mathrm{av}}(O)=\frac{d^2-1}{d^3}\left(\frac{K}{dw-1}+\frac{(d^2-1)(dT-K)}{d^2-2dw+1}\right).Qav​(O)=d3d2−1​(dw−1K​+d2−2dw+1(d2−1)(dT−K)​).

For nonzero OOO, putting ktot=K/Tk_{\rm tot}=K/Tktot​=K/T recovers Eq. (31). The undivided identity also includes O=0O=0O=0, where both sides vanish. This records the exact dependence on observable locality without introducing undefined purity ratios.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P71
Formal statement
noncomputable section

open MeasureTheory

open scoped Matrix ComplexConjugate ENNReal Matrix.Norms.Elementwise

namespace QAlgorithms.Papers.Independent.Intakethird100.P71

attribute [local instance] Classical.propDecidable

local notation "Config" n:max d:max =>
  QAlgorithms.Papers.Independent.Information100.P21.Config (P := Fin n) (fun _ => d)

local notation "Op" n:max d:max =>
  QAlgorithms.Papers.Independent.Information100.P21.Op (Config n d)

attribute [local instance] QAlgorithms.Papers.Independent.Intakethird100.P71.matrixContinuousENorm

local notation "Unitary" n:max d:max => Matrix.unitaryGroup (Config n d) ℂ

local notation "Local" n:max d:max => Fin n → Matrix.unitaryGroup (Fin d) ℂ

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

/-- PDF p.6 Eqs.(29)–(31): undivided two-qudit formula. K is the sum of the
unnormalized partial purities; for O≠0, k_tot=K/Tr(O²). O=0 is included. -/
theorem twoQudit_secondMoment {d : ℕ} (hd : 2 ≤ d) (E : ProjectiveEnsemble 2 d)
    (hls : LocallyScrambled (prior E)) (hc : Complete (prior E))
    (w : ℝ) (hw : 2*(d : ℝ)/((d : ℝ)^2+1) ≤ w ∧ w ≤ 1) (hf : ToyFeature (prior E) w)
    (H : Measure (Local 2 d)) [IsProbabilityMeasure H] [H.IsMulLeftInvariant]
    (rho O : Op 2 d) (hrho : IsDensityMatrix rho) (hO : O.IsHermitian) (ht : O.trace = 0) :
    averagedSecondMoment H (prior E) hc rho O =
      ((d : ℝ)^2-1)/(d : ℝ)^3 *
        (localityNumerator O / ((d : ℝ)*w-1) +
          ((d : ℝ)^2-1) * ((d : ℝ)*hsSquare O - localityNumerator O) /
            ((d : ℝ)^2-2*(d : ℝ)*w+1)) := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P71

end
Source
Classical Shadow Tomography with Locally Scrambled Quantum Dynamics, arXiv:2107.04817v4, PDF p. 6, §II C, Eqs.(29)–(31): two-qudit shadow norm
Read-back

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

Let d≥2d\ge2d≥2, let X={0,…,d−1}2\mathcal X=\{0,\ldots,d-1\}^2X={0,…,d−1}2, and let EEE specify a probability law λ\lambdaλ on global unitary matrices. Set ν=d−2∑b(U↦U†∣b⟩⟨b∣U)∗λ\nu=d^{-2}\sum_b(U\mapsto U^\dagger|b\rangle\langle b|U)_*\lambdaν=d−2∑b​(U↦U†∣b⟩⟨b∣U)∗​λ, and assume that ν\nuν is invariant under S↦LV†SLVS\mapsto L_V^\dagger SL_VS↦LV†​SLV​ for every LV=V0⊗V1L_V=V_0\otimes V_1LV​=V0​⊗V1​ with unitary factors. Define M(X)ij=∑k,l(∫d2SijSlk dν(S))Xkl\mathcal M(X)_{ij}=\sum_{k,l}(\int d^2S_{ij}S_{lk}\,d\nu(S))X_{kl}M(X)ij​=∑k,l​(∫d2Sij​Slk​dν(S))Xkl​, assume it is injective, and write R=M−1\mathcal R=\mathcal M^{-1}R=M−1. Let www satisfy 2d/(d2+1)≤w≤12d/(d^2+1)\le w\le12d/(d2+1)≤w≤1, and suppose that ∫Re⁡tr⁡((Tr⁡AcS)2) dν(S)\int\operatorname{Re}\operatorname{tr}((\operatorname{Tr}_{A^c}S)^2)\,d\nu(S)∫Retr((TrAc​S)2)dν(S) equals www for each singleton A⊆{0,1}A\subseteq\{0,1\}A⊆{0,1} and equals 111 for the empty and full subsets; here the partial trace sums matching complementary indices. Let HHH be a probability measure on pairs of local unitary matrices invariant under left multiplication by every fixed pair. Let ρ\rhoρ be positive semidefinite of trace 111, and let OOO be Hermitian of trace 000. Define z(S)=Re⁡tr⁡(OR(S))z(S)=\operatorname{Re}\operatorname{tr}(O\mathcal R(S))z(S)=Retr(OR(S)), dνσ=[d2Re⁡tr⁡(Sσ)]+dνd\nu_\sigma=[d^2\operatorname{Re}\operatorname{tr}(S\sigma)]_+d\nudνσ​=[d2Retr(Sσ)]+​dν, and

Q‾=∫(∫z(S)2 dνLV†ρLV(S))dH(V),L(O)=Re⁡tr⁡((Tr⁡{1}O)2)+Re⁡tr⁡((Tr⁡{0}O)2),K(O)=Re⁡tr⁡(O2).\overline Q=\int\left(\int z(S)^2\,d\nu_{L_V^\dagger\rho L_V}(S)\right)dH(V), \quad L(O)=\operatorname{Re}\operatorname{tr}((\operatorname{Tr}_{\{1\}}O)^2) +\operatorname{Re}\operatorname{tr}((\operatorname{Tr}_{\{0\}}O)^2), \quad K(O)=\operatorname{Re}\operatorname{tr}(O^2).Q​=∫(∫z(S)2dνLV†​ρLV​​(S))dH(V),L(O)=Retr((Tr{1}​O)2)+Retr((Tr{0}​O)2),K(O)=Retr(O2).

The theorem asserts the exact equality

Q‾=d2−1d3[L(O)dw−1+(d2−1)(dK(O)−L(O))d2−2dw+1].\overline Q=\frac{d^2-1}{d^3} \left[ \frac{L(O)}{dw-1} +\frac{(d^2-1)(dK(O)-L(O))}{d^2-2dw+1} \right].Q​=d3d2−1​[dw−1L(O)​+d2−2dw+1(d2−1)(dK(O)−L(O))​].
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