Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Universal Quantum Emulator: sample and gate complexity, Eqs.(28)–(29)

Open
QAlgorithms.Papers.Independent.Intakethird100.P67.sample_and_gate_complexity

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

prove2quantum

Let D=2nD=2^nD=2n and let the normalized pure samples {ϕk}k=1K\{\phi_k\}_{k=1}^K{ϕk​}k=1K​, K≥2K\ge2K≥2, generate the full matrix algebra on their span HinH_{\rm in}Hin​, of dimension ddd. Fix an anchor sample. Write λ⊥\lambda_\perpλ⊥​ for the operator norm of the vectorized compressed reflection channel. There is a single family of circuits, independent of the unknown samples, unitary UUU, and new input, that uses only supplied input/output density copies, single-qubit gates and controlled-controlled-SWAP gates. For every 0<ϵ<10<\epsilon<10<ϵ<1, its parameters can be chosen using ddd, λ⊥\lambda_\perpλ⊥​ and ϵ\epsilonϵ so that, uniformly for all density operators ρ\rhoρ supported on HinH_{\rm in}Hin​,

12∥EU(ρ)−UρU†∥1≤ϵ,Ntot≤Cd2ϵ(1−λ⊥)2Lp,ttot≤Cd2nϵ(1−λ⊥)2Lp,\tfrac12\|\mathcal E_U(\rho)-U\rho U^\dagger\|_1\le\epsilon,\qquad N_{\rm tot}\le C\frac{d^2}{\epsilon(1-\lambda_\perp)^2}L^p,\qquad t_{\rm tot}\le C\frac{d^2n}{\epsilon(1-\lambda_\perp)^2}L^p,21​∥EU​(ρ)−UρU†∥1​≤ϵ,Ntot​≤Cϵ(1−λ⊥​)2d2​Lp,ttot​≤Cϵ(1−λ⊥​)2d2n​Lp,

where L=1+log⁡(d+1)+log⁡(1+ϵ−1)L=1+\log(d+1)+\log(1+\epsilon^{-1})L=1+log(d+1)+log(1+ϵ−1), and C>0C>0C>0 and the integer p≥0p\ge0p≥0 are absolute. Counts are actual supplied-copy registers and elementary gate-list lengths. The number of erasure rounds is zero for d=1d=1d=1, and otherwise at least one and the ceiling of log⁡(8ϵ−2(d−1))/(1−λ⊥)\log(8\epsilon^{-2}(d-1))/(1-\lambda_\perp)log(8ϵ−2(d−1))/(1−λ⊥​). The density-matrix-exponentiation precision uses an absolute multiple of (4T+1)/ϵ(4T+1)/\epsilon(4T+1)/ϵ copies per reflection. This records the gap-dependent content of Eqs.(28)–(29), without a dimension-only convergence promise.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P67
Formal statement
noncomputable section

open scoped ComplexConjugate Matrix Matrix.Norms.L2Operator

attribute [local instance] Classical.propDecidable

open MeasureTheory Filter

namespace QAlgorithms.Papers.Independent.Intakethird100.P67

variable {I J K L A : Type*} [Fintype I] [DecidableEq I]
  [Fintype J] [DecidableEq J] [Fintype K] [DecidableEq K]
  [Fintype L] [DecidableEq L] [Fintype A] [DecidableEq A]

/-- PDF pp.7,19, Eqs.(28)–(29): a sample-only circuit family is fixed before every
unknown sample, target unitary, and new input. Copy counts are resource registers and gate
counts are elementary list lengths. d=1 uses exact reset. For d>=2 the sample-dependent
gap remains explicit. Single-qubit and systemControlled-systemControlled-SWAP gates are counted, with
D=2^n. B19's printed error allocation is corrected by fixed-factor rescaling. -/
theorem sample_and_gate_complexity :
    ∃ (C c : ℝ) (power : ℕ) (F : EmulatorFamily), 0 < C ∧ 0 < c ∧
    ∀ (n k : ℕ), 2 ≤ k → ∀ (a : Fin k) (phi : Fin k → EuclideanSpace ℂ (Qubits n)),
      (∀ j, IsState (phi j)) → Generates (pureSamples phi) →
      ∀ eps : ℝ, 0 < eps → eps < 1 →
      let d := sampleDimension (pureSamples phi)
      let lam := lambdaPerp phi a
      let T := precisionRounds d lam eps
      let m := max 1 ⌈c * (4*T+1) / eps⌉₊
      let budget := C * (d : ℝ)^2 * eps⁻¹ / (1-lam)^2 * slowFactor d eps power
      (∀ h : Fin T → Fin k, ((F n k a T m h).copies : ℝ) ≤ budget ∧
        ((F n k a T m h).gates.length : ℝ) ≤ budget * n) ∧
      (∀ (U : Matrix.unitaryGroup (Qubits n) ℂ) (rho : Matrix (Qubits n) (Qubits n) ℂ),
        IsDensityMatrix rho → InSampleSupport (pureSamples phi) rho →
        traceDistance
          (∑ h : Fin T → Fin k, (historyWeight (nonanchorProbability a) h : ℂ) •
            (F n k a T m h).output (inputOutputRecords phi (U : Matrix (Qubits n) (Qubits n) ℂ)) rho)
          (densityConjugation (U : Matrix (Qubits n) (Qubits n) ℂ) rho) ≤ eps) := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P67

end
Source
Universal Quantum Emulator, arXiv:1606.02734v2, PDF p. 7, Universal Quantum Emulator: sample and gate complexity, Eqs.(28)–(29)
Read-back

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

There exist positive real constants C,cC,cC,c, a natural number rrr, and one family FFF assigning a sample circuit to every choice of natural n,k,T,mn,k,T,mn,k,T,m, anchor a∈{0,…,k−1}a\in\{0,\ldots,k-1\}a∈{0,…,k−1}, and history h:{0,…,T−1}→{0,…,k−1}h:\{0,\ldots,T-1\}\to\{0,\ldots,k-1\}h:{0,…,T−1}→{0,…,k−1}, with the following property. A sample circuit has a natural number NNN of physical qubits, a natural number of sample copies, an injective placement of an nnn-qubit input and all nnn-qubit sample copies into those qubits, a label in Bool×{0,…,k−1}\mathrm{Bool}\times\{0,\ldots,k-1\}Bool×{0,…,k−1} for each copy, fixed computational-basis values on the remaining qubits, and a list of gates, each either an arbitrary unitary on one qubit or a swap of two target qubits controlled by two other, distinct qubits both being true; its output is obtained by initializing the input and sample registers in the specified matrices, applying the gates in list order, and tracing out all qubits except the original input ports. For every natural nnn, including 000, every k≥2k\ge2k≥2, every anchor aaa, and every collection of norm-one vectors ϕj∈C{0,1}n\phi_j\in\mathbb C^{\{0,1\}^n}ϕj​∈C{0,1}n, put Ej=ϕjϕj†E_j=\phi_j\phi_j^\daggerEj​=ϕj​ϕj†​ and Π=f(∑jEj)\Pi=f(\sum_jE_j)Π=f(∑j​Ej​), where f(0)=0f(0)=0f(0)=0, f(x)=1f(x)=1f(x)=1 otherwise, applied by continuous functional calculus. Assume that a matrix XXX belongs to the complex linear span of nonempty products of the EjE_jEj​ if and only if ΠXΠ=X\Pi X\Pi=XΠXΠ=X. For every 0<ε<10<\varepsilon<10<ε<1, define ddd to be the dimension of the range of Π\PiΠ, set pa=0p_a=0pa​=0 and pj=(k−1)−1p_j=(k-1)^{-1}pj​=(k−1)−1 for j≠aj\ne aj=a, and define

Q=Π−Ea,Aj=Q(1−2Ej)Q,λ=∥∑jpj Aj⊗Aj‾∥op,T={0,d≤1,max⁡ ⁣{1,⌈log⁡(8ε−2(d−1))1−λ⌉N},d>1,m=max⁡ ⁣{1,⌈c(4T+1)ε⌉N},B=Cd2ε−1(1−λ)2(1+log⁡(d+1)+log⁡(1+ε−1))r.\begin{gathered} Q=\Pi-E_a,\qquad A_j=Q(1-2E_j)Q,\qquad \lambda=\left\|\sum_jp_j\,A_j\otimes\overline{A_j}\right\|_{\rm op},\\ T=\begin{cases} 0,&d\le1,\\ \displaystyle\max\!\left\{1, \left\lceil\frac{\log(8\varepsilon^{-2}(d-1))} {1-\lambda}\right\rceil_{\mathbb N}\right\},&d>1, \end{cases} \qquad m=\max\!\left\{1,\left\lceil\frac{c(4T+1)}{\varepsilon}\right\rceil_{\mathbb N}\right\},\\ B=\frac{Cd^2\varepsilon^{-1}}{(1-\lambda)^2} \left(1+\log(d+1)+\log(1+\varepsilon^{-1})\right)^r. \end{gathered}Q=Π−Ea​,Aj​=Q(1−2Ej​)Q,λ=​j∑​pj​Aj​⊗Aj​​​op​,T=⎩⎨⎧​0,max{1,⌈1−λlog(8ε−2(d−1))​⌉N​},​d≤1,d>1,​m=max{1,⌈εc(4T+1)​⌉N​},B=(1−λ)2Cd2ε−1​(1+log(d+1)+log(1+ε−1))r.​

Here Aj‾\overline{A_j}Aj​​ is entrywise complex conjugation, the operator norm is induced by Euclidean norms, and the natural ceiling is truncated at zero. Every history hhh, including histories with zero weight ∏tph(t)\prod_tp_{h(t)}∏t​ph(t)​, satisfies

copies⁡(F(n,k,a,T,m,h))≤B,length⁡(gates⁡(F(n,k,a,T,m,h)))≤Bn.\operatorname{copies}(F(n,k,a,T,m,h))\le B,\qquad \operatorname{length}(\operatorname{gates}(F(n,k,a,T,m,h)))\le Bn.copies(F(n,k,a,T,m,h))≤B,length(gates(F(n,k,a,T,m,h)))≤Bn.

Moreover, for every unitary UUU and every positive semidefinite trace-one matrix ρ\rhoρ satisfying ΠρΠ=ρ\Pi\rho\Pi=\rhoΠρΠ=ρ, initialize a sample labelled (false,j)({\rm false},j)(false,j) in EjE_jEj​ and one labelled (true,j)({\rm true},j)(true,j) in UEjU†UE_jU^\daggerUEj​U†, and denote the resulting circuit output by Oh(ρ)\mathcal O_h(\rho)Oh​(ρ). Then

12Re⁡tr⁡(∑h(∏tph(t))Oh(ρ)−UρU†)†(∑h(∏tph(t))Oh(ρ)−UρU†)≤ε.\frac12\operatorname{Re}\operatorname{tr} \sqrt{\left(\sum_h\Bigl(\prod_tp_{h(t)}\Bigr)\mathcal O_h(\rho) -U\rho U^\dagger\right)^\dagger \left(\sum_h\Bigl(\prod_tp_{h(t)}\Bigr)\mathcal O_h(\rho) -U\rho U^\dagger\right)} \le\varepsilon.21​Retr(h∑​(t∏​ph(t)​)Oh​(ρ)−UρU†)†(h∑​(t∏​ph(t)​)Oh​(ρ)−UρU†)​≤ε.

The family and constants precede all these universally quantified inputs. The formulas use total inverses and division, so zero denominators have value zero; empty histories and empty gate lists use their usual empty products.

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