Error of a sequence of gadgets grows linearly in their number
ProvedOPI.QG.circAll_errA gadget on system qubits (with a -qubit phase-gradient register used catalytically) has a data register and a resource register of qubits each, holding residues modulo , a -qubit control register , an accumulator and lookup scratch. Its system unitary is: a table phase on , phase estimation on with control , subtraction of the estimate from , inverse phase estimation, and a swap of and . Let and let be the matrix on valid encodings (zero on invalid ones), .
Statement. Assume , , and put . Let be gadgets that are pairwise compatible (the and registers of each avoid all wires used by the others). Let lie in the domain of every gadget: on its support each and is , each accumulator and scratch is clean, and each holds a value . Then
In the ideal output the resource registers are back to : the states are consumed.
The QFT over is realized as such gadgets acting on the blocks of a symbol after a re-encoding. This bound gives the error of the whole block.
import Definitions.Def_TwoFoldOPI_CL_Part01
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.QG
open QAlgorithms Matrix
variable {n b : ℕ}
variable {p w t : ℕ}
theorem OPI.QG.circAll_err (hp : 0 < p) (hpw : p ≤ 2 ^ w) (ht : 1 ≤ t) (ε : ℝ)
(hε : ε = 2 * Real.pi / 2 ^ b + 2 * (p / Real.sqrt (2 ^ t))) :
∀ (Gs : List (QG n b p w t)) (g : Qubits n → ℂ), AllDom Gs g → List.Pairwise Cross Gs →
vnorm ((UAll Gs).mulVec (prepAll Gs g) - idealAll Gs g) ≤ Gs.length * ε * vnorm g := by sorry