Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

QFT occurrence counts and modeled quality

Open
QAlgorithms.Papers.Independent.Intakethird100.P39.qft_quality_counts

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

prove2quantum

Assign each QFTmQFT_mQFTm​ occurrence fidelity FQ∈[−1,1]F_Q\in[-1,1]FQ​∈[−1,1] and each type-jjj phase-swap occurrence fidelity Fj∈[−1,1]F_j\in[-1,1]Fj​∈[−1,1]. With independent occurrence errors, assigned schedule duration T≥0T\ge0T≥0, and TR>0T_R>0TR​>0, the modeled quality of the Fig. 7 circuit for m,k≥2m,k\ge2m,k≥2 is

q=FQk∏j=1k−1Fjk−j e−T/TR.q=F_Q^k\prod_{j=1}^{k-1}F_j^{k-j}\,e^{-T/T_R}.q=FQk​j=1∏k−1​Fjk−j​e−T/TR​.

For 2k2k2k blocks of size five, k≥2k\ge2k≥2, after truncation identifies every type j≥3j\ge3j≥3 with the same pure-swap module, write F5F_5F5​ for the five-qubit Fourier fidelity and F1,F2,F3F_1,F_2,F_3F1​,F2​,F3​ for the three remaining module fidelities. Then

q=F52kF12k−1F22k−2F3(2k2)−4k+3e−T/TR.q=F_5^{2k}F_1^{2k-1}F_2^{2k-2}F_3^{\binom{2k}{2}-4k+3}e^{-T/T_R}.q=F52k​F12k−1​F22k−2​F3(22k​)−4k+3​e−T/TR​.

The fidelity product is computed from the actual circuit list. The second expression concerns the approximating circuit. Its elapsed duration is assigned independently of the deferred timing formula (25).

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P39
Formal statement
namespace QAlgorithms.Papers.Independent.Intakethird100.P39

open scoped BigOperators

/-- PDF p.10, Eqs. (26)-(27): occurrence-count quality formulas. In the
second formula, all phase-swap types j>=3 have been replaced by the same
truncated pure-swap module. T is an assigned elapsed time, without Eq. (25). -/
theorem qft_quality_counts (Fq : ℝ) (Fc : ℕ → ℝ) (T TR : ℝ)
    (hT : 0 ≤ T) (hTR : 0 < TR)
    (hFq : Fq ∈ Set.Icc (-1) 1) (hFc : ∀ j, Fc j ∈ Set.Icc (-1) 1) :
    (∀ m k : ℕ, 2 ≤ m → 2 ≤ k →
      blockQuality Fq Fc T TR (qftAssembly m k) =
        Fq ^ k * (∏ j ∈ Finset.Icc 1 (k - 1), Fc j ^ (k - j)) *
          Real.exp (-T / TR)) ∧
    (∀ (k : ℕ) (F5 F1 F2 F3 : ℝ), 2 ≤ k →
      F5 ∈ Set.Icc (-1) 1 → F1 ∈ Set.Icc (-1) 1 →
      F2 ∈ Set.Icc (-1) 1 → F3 ∈ Set.Icc (-1) 1 →
      blockQuality F5 (fun j => if j = 1 then F1 else if j = 2 then F2 else F3)
        T TR (truncatedQftAssembly 5 (2 * k) 10) =
        F5 ^ (2 * k) * F1 ^ (2 * k - 1) * F2 ^ (2 * k - 2) *
          F3 ^ (Nat.choose (2 * k) 2 - (4 * k - 3)) * Real.exp (-T / TR)) := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P39
Source
Quantum CISC Compilation by Optimal Control and Scalable Assembly of Complex Instruction Sets beyond Two-Qubit Gates, arXiv:0712.3227v2, PDF p. 10, QFT counts and model quality, Eqs. (26)–(27)
Read-back

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

For all real numbers Fq,T,TRF_q,T,T_RFq​,T,TR​ and functions Fc:N→RF_c:\mathbb N\to\mathbb RFc​:N→R, assume T≥0T\ge0T≥0, TR>0T_R>0TR​>0, −1≤Fq≤1-1\le F_q\le1−1≤Fq​≤1, and −1≤Fc(j)≤1-1\le F_c(j)\le1−1≤Fc​(j)≤1 for every natural number jjj, including 000. Define the quality of a list to be the product of its step weights multiplied by e−T/TRe^{-T/T_R}e−T/TR​, assigning weight FqF_qFq​ to a Fourier step, Fc(j)F_c(j)Fc​(j) to either kind of phase-swap step of index jjj, and Fc(3)F_c(3)Fc​(3) to a swap. The theorem asserts both of the following equalities:

Q(Am,k)=Fqk(∏j=1k−1Fc(j)k−j)e−T/TRfor every m,k∈N with m≥2, k≥2,Q(\mathcal A_{m,k}) =F_q^k\left(\prod_{j=1}^{k-1}F_c(j)^{k-j}\right)e^{-T/T_R} \quad\text{for every }m,k\in\mathbb N\text{ with }m\ge2,\ k\ge2,Q(Am,k​)=Fqk​(j=1∏k−1​Fc​(j)k−j)e−T/TR​for every m,k∈N with m≥2, k≥2,

where Am,k\mathcal A_{m,k}Am,k​ is formed by concatenating, for t=0,…,k−1t=0,\ldots,k-1t=0,…,k−1 in increasing order, the phase-swap steps with offset smsmsm, half-width mmm, and phase index s+1s+1s+1, for s=t−1,…,0s=t-1,\ldots,0s=t−1,…,0 in decreasing order, followed by a Fourier step of offset 000 and width mmm; for t=0t=0t=0, that portion contains only the Fourier step. Also, for every k∈Nk\in\mathbb Nk∈N with k≥2k\ge2k≥2 and every four real numbers F5,F1,F2,F3∈[−1,1]F_5,F_1,F_2,F_3\in[-1,1]F5​,F1​,F2​,F3​∈[−1,1],

QF5,f(Tk)=F52kF12k−1F22k−2F3(2k2)−(4k−3)e−T/TR,f(j)={F1j=1,F2j=2,F3otherwise.Q_{F_5,f}(\mathcal T_k) =F_5^{2k}F_1^{2k-1}F_2^{2k-2} F_3^{\binom{2k}{2}-(4k-3)}e^{-T/T_R}, \qquad f(j)= \begin{cases} F_1&j=1,\\ F_2&j=2,\\ F_3&\text{otherwise}. \end{cases}QF5​,f​(Tk​)=F52k​F12k−1​F22k−2​F3(22k​)−(4k−3)​e−T/TR​,f(j)=⎩⎨⎧​F1​F2​F3​​j=1,j=2,otherwise.​

Here QF5,fQ_{F_5,f}QF5​,f​ uses the same weighting rule with Fourier weight F5F_5F5​ and phase weights fff, and Tk\mathcal T_kTk​ is formed from A5,2k\mathcal A_{5,2k}A5,2k​ by replacing each phase-swap step of offset ooo and index jjj by a swap of offset ooo and half-width 555 if 10<5(j−1)+110<5(j-1)+110<5(j−1)+1, and otherwise by a truncated phase-swap step with the same offset, half-width, and index and cutoff 101010. The subtraction j−1j-1j−1 in this rule is natural-number subtraction, truncated at zero; the generated indices are all positive. Every exponent displayed above is a natural number, and the stated bounds on kkk make all the displayed subtractions nonnegative. The second equality uses independently quantified weights F5,F1,F2,F3F_5,F_1,F_2,F_3F5​,F1​,F2​,F3​, while all the initial hypotheses remain assumptions of the conjunction.

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