Failure bound of the full quantum program: gradient preparation followed by the trial loop
ProvedOPI.Lay.progQ_boundLet be a presented finite field with elements, qubits per symbol, an matrix over and a flag. The code is the row space of if holds and otherwise. Let and . For forbidden values let .
The program runs on the concrete wire layout with a gradient register of qubits. It first prepares the phase-gradient state, using majority tests per bit, and then runs at most trials of the Regev-style loop. Each trial uses repeat-until-success stages capped at attempts and gadgets of precision , . The parameters are classical memory cells, and an injective map sends the output bits to memory slots. Let "event" be any property of the output that holds whenever the output bits decode to a word in .
Assume is at most the preparation weight, is at least the phase-error term , , and . With
the probability of the event when is started on the all-zero state (any initial memory) satisfies
This combines the trial-loop bound with the error of the gradient preparation. The final theorem then chooses the parameters so that the right-hand side is at most .
import Definitions.Def_TwoFoldOPI_CL_Part04
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Circuit
import Definitions.Def_QAlgorithms_Defs_GradientMethods
import Definitions.Def_QAlgorithms_Defs_OPIOraclePrograms
import Definitions.Def_QAlgorithms_Defs_OPIUniformity
import Definitions.Def_QAlgorithms_Defs_Fourier
import Definitions.Def_TwoFoldOPI_elemBits
import Definitions.Def_TwoFoldOPI_schurSquare
import Definitions.Def_TwoFoldOPI_schurFailureSum
import Definitions.Def_CodingTheory
import Definitions.Def_OAIThreeMachineSched01
import Definitions.Def_CookLevin_Cost
import Definitions.Def_TwoFoldOPI_codeOf
import Definitions.Def_TwoFoldOPI_solves
import Definitions.Def_TwoFoldOPI_Input
import Definitions.Def_TwoFoldOPI_CLSerializableF
open OPI OPI.Lay
open QAlgorithms QAlgorithms.OPI TwoFoldOPI
open SymEnc
variable (F : AvgCaseTI.FieldPres) (m t : ℕ) (b' : ℕ) {r : ℕ} (gen : Bool) (H : Matrix (Fin r) (Fin m) F.F)
local notation "KD" => kdOf F m gen H
local notation "nI" => SymEnc.nIds m (kdOf F m gen H) (kdOf F m gen H * kdOf F m gen H)
local notation "PP" => parOf F m t (b' + 1) (SymEnc.nIds m (kdOf F m gen H) (kdOf F m gen H * kdOf F m gen H))
local notation "NN" => total (parOf F m t (b' + 1) (SymEnc.nIds m (kdOf F m gen H) (kdOf F m gen H * kdOf F m gen H)))
variable (ht : 1 ≤ t) (htb : t ≤ b' + 1)
set_option maxHeartbeats 1000000
open Classical
theorem OPI.Lay.progQ_bound (hq : 2 ≤ Fintype.card F.F) (hp : 0 < F.p) (β : Fin m → F.F) {c : ℕ}
(dG dz dst : Fin c) (slot : Fin (m * bitsPerSymbol F) → Fin c) (hslot : Function.Injective slot)
(event : Option (Fin (m * bitsPerSymbol F) → Bool) → Prop)
(hev : ∀ bits, decodeWord F m bits ∈ codeOf gen H ∧ decodeWord F m bits ∈ targetSet β → event (some bits))
(R : ℕ) (w e : ℝ) (hw0 : 0 < w) (hw1 : w ≤ 1)
(hw : w ≤ (prepC F m t (b' + 1) gen H ht htb).W β R *
(Complex.normSq (cAll (decC F m t (b' + 1) gen H ht htb).D KD) * (Dfin gen H).card))
(he : 2 * (m * (2 * Real.pi / 2 ^ (b' + 1))) * ((prepC F m t (b' + 1) gen H ht htb).W β R *
(Complex.normSq (cAll (decC F m t (b' + 1) gen H ht htb).D KD) * (Dfin gen H).card)) ≤ e)
(hP : 0 < decP F (b' + 1) t m (schurFailureSum (CodingTheory.dualCode F.F (Fin m) (codeOf gen H))))
(K Nt : ℕ) (η : ℝ) (hη : 0 < η) (hη1 : η ≤ 1) (hS : b' * (2 / 5 : ℝ) ^ Nt ≤ 1) (mem : Fin c → Bool) :
let P := decP F (b' + 1) t m (schurFailureSum (CodingTheory.dualCode F.F (Fin m) (codeOf gen H)))
let bT := (1 - w + w * ((Dfin gen H).card * (1 - P)) + e) / (w * P) + (1 - w * P) ^ K
1 - lawP (progQ F m t b' gen H ht htb β dG dz dst slot hslot R K Nt) event (sysZero (NN + (b' + 1))) mem ≤
max bT 0 + η + (b' * (2 / 5 : ℝ) ^ Nt) / η := by sorry