Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section IV A: d^2 observable averages for n qubits

Proved
QAlgorithms.Papers.Independent.Advance50.P17.qubitObservables

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

prove2quantum

For n≥0n\ge0n≥0 qubits, put d=2nd=2^nd=2n. Let E\mathcal EE be CPTP and UUU unitary. Index Pauli products PjP_jPj​ and input states ρk\rho_kρk​ by strings in {0,1,2,3}n\{0,1,2,3\}^n{0,1,2,3}n, where each input factor is I/2,(I+X)/2,(I+Y)/2I/2,(I+X)/2,(I+Y)/2I/2,(I+X)/2,(I+Y)/2, or (I+Z)/2(I+Z)/2(I+Z)/2. Expand Pj=∑kajkρkP_j=\sum_k a_{jk}\rho_kPj​=∑k​ajk​ρk​ using the real tensor-product coefficients from I=2ρ0I=2\rho_0I=2ρ0​ and P=2ρP−2ρ0P=2\rho_P-2\rho_0P=2ρP​−2ρ0​. Define σk=∑jajkUPj†U†\sigma_k=\sum_j a_{jk}UP_j^\dagger U^\daggerσk​=∑j​ajk​UPj†​U†. Every ρk\rho_kρk​ is normalized and every σk\sigma_kσk​ is Hermitian, and

Fpro(E,U)=d−3∑ktr⁡(σkE(ρk)),∣{0,1,2,3}n∣=d2.F_{\rm pro}(\mathcal E,U)=d^{-3}\sum_k\operatorname{tr}(\sigma_k\mathcal E(\rho_k)),\qquad |\{0,1,2,3\}^n|=d^2.Fpro​(E,U)=d−3k∑​tr(σk​E(ρk​)),∣{0,1,2,3}n∣=d2.

Thus d2d^2d2 observable averages suffice. The source's one-qubit input matrices are normalized here and their coefficients recomputed accordingly.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P17
Formal statement
noncomputable section

open MeasureTheory Filter

open scoped Matrix ComplexConjugate Topology

namespace QAlgorithms.Papers.Independent.Advance50.P17

open QAlgorithms.Papers.Independent.Information100.P53 (fidelity)

open QAlgorithms.Papers.Independent.Information100.P08 (canonicalPurification)

open QAlgorithms.Papers.Independent.Information100.P75 (hermitianReal)

variable {I J K : Type} [Fintype I] [Fintype J] [Fintype K]
  [DecidableEq I] [DecidableEq J] [DecidableEq K]
  [Nonempty I] [Nonempty J] [Nonempty K]

/-- Section IV A, PDF pp.6--7: d^2 Hermitian averages for n qubits.
PRINTED inputs I,I+X,I+Y,I+Z have trace two. CHANGED: divide each factor by two;
productCoefficient is recomputed in that normalized basis. Zero qubits is permitted. -/
theorem qubitObservables (n : ℕ) (E : FiniteProcess (Qubits n) (Qubits n))
    (U : Matrix.unitaryGroup (Qubits n) ℂ) :
    (∀ k, IsDensityMatrix (tomographyProductInput n k) ∧ (productObservable n U k).IsHermitian) ∧
    (∀ j, productPauli n j = ∑ k : Fin n → Fin 4,
      (productCoefficient n j k : ℂ) • tomographyProductInput n k) ∧
    proFidelity E.val (conjSuperop (U : Matrix (Qubits n) (Qubits n) ℂ)) =
      (2 ^ n : ℝ)⁻¹ ^ 3 * ∑ k : Fin n → Fin 4,
        effectProb (productObservable n U k) (E.val (tomographyProductInput n k)) ∧
    Fintype.card (Fin n → Fin 4) = (2 ^ n) ^ 2 := by sorry

end QAlgorithms.Papers.Independent.Advance50.P17

end
Source
Distance measures to compare real and ideal quantum processes, arXiv:quant-ph/0408063v2, PDF p. 7, Section IV A: d^2 observable averages for n qubits
Read-back

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

For every natural number nnn, including 000, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, let EEE be a channel on complex matrices indexed by QnQ_nQn​, and let UUU be a unitary matrix on that space; a channel means a map with a finite Kraus representation whose Kraus operators satisfy ∑aKa†Ka=1\sum_aK_a^\dagger K_a=1∑a​Ka†​Ka​=1. Set σ0=1,σ1=X,σ2=Y,σ3=Z\sigma_0=1,\sigma_1=X,\sigma_2=Y,\sigma_3=Zσ0​=1,σ1​=X,σ2​=Y,σ3​=Z, where

X=(0110),Y=(0−ii0),Z=(100−1),X=\begin{pmatrix}0&1\\1&0\end{pmatrix},\quad Y=\begin{pmatrix}0&-i\\i&0\end{pmatrix},\quad Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix},X=(01​10​),Y=(0i​−i0​),Z=(10​0−1​),

and put τ0=1/2\tau_0=1/2τ0​=1/2 times the identity and τa=(1+σa)/2\tau_a=(1+\sigma_a)/2τa​=(1+σa​)/2 for a=1,2,3a=1,2,3a=1,2,3. For j,k:{0,…,n−1}→{0,1,2,3}j,k:\{0,\ldots,n-1\}\to\{0,1,2,3\}j,k:{0,…,n−1}→{0,1,2,3}, define Pj=⨂tσjtP_j=\bigotimes_t\sigma_{j_t}Pj​=⨂t​σjt​​, Rk=⨂tτktR_k=\bigotimes_t\tau_{k_t}Rk​=⨂t​τkt​​, and cjk=∏tc(jt,kt)c_{jk}=\prod_t c(j_t,k_t)cjk​=∏t​c(jt​,kt​), where c(0,0)=2c(0,0)=2c(0,0)=2, c(0,b)=0c(0,b)=0c(0,b)=0 for b≠0b\neq0b=0, and, for a≠0a\neq0a=0, c(a,a)=2c(a,a)=2c(a,a)=2, c(a,0)=−2c(a,0)=-2c(a,0)=−2, and all other values are 000; define Bk=∑jcjkUPj†U†B_k=\sum_jc_{jk}UP_j^\dagger U^\daggerBk​=∑j​cjk​UPj†​U†. Then every RkR_kRk​ is positive semidefinite of trace one and every BkB_kBk​ is Hermitian, and Pj=∑kcjkRkP_j=\sum_kc_{jk}R_kPj​=∑k​cjk​Rk​ for every jjj. Put d=2nd=2^nd=2n, ϕ(x,y)=d−1/2\phi(x,y)=d^{-1/2}ϕ(x,y)=d−1/2 when x=yx=yx=y and 000 otherwise, and CG=(id⁡Qn⊗G)(ϕϕ†)C_G=(\operatorname{id}_{Q_n}\otimes G)(\phi\phi^\dagger)CG​=(idQn​​⊗G)(ϕϕ†), with GGG applied blockwise. Then

(Re⁡tr⁡CE CCUCE)2=(2n)−3∑kRe⁡tr⁡(BkE(Rk)),CU(X)=UXU†.\left(\operatorname{Re}\operatorname{tr}\sqrt{\sqrt{C_E}\,C_{\mathcal C_U}\sqrt{C_E}}\right)^2 =(2^n)^{-3}\sum_k\operatorname{Re}\operatorname{tr}(B_kE(R_k)), \qquad \mathcal C_U(X)=UXU^\dagger.(RetrCE​​CCU​​CE​​​)2=(2n)−3k∑​Retr(Bk​E(Rk​)),CU​(X)=UXU†.

The number of indices kkk is (2n)2(2^n)^2(2n)2. When n=0n=0n=0, the index sets each have one element and all tensor products and coefficient products are empty products.

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