The gadget with exact phase is within of the ideal QFT
ProvedOPI.QLay.main_idealFix a layout of the gadget on qubits: a data register and a resource register ( qubits each, values read in binary), a control register of qubits, an accumulator and lookup scratch. Consider the operator
where with . is phase estimation (QFT on , controlled shifts of by modulo , QFT on ). sets , where is the rounded estimate from the control value , and restores the accumulator. swaps and .
For let be the total squared amplitude that phase estimation of the Fourier vector puts on control values with .
Statement. Assume . Let satisfy, on its support: , , accumulator and scratch clean, and . Let be such that for all . Then, with ,
This is the analytic core of the gadget. The implemented gadget differs from only in the rounded table phase, which is handled separately.
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.QLay
open QAlgorithms Matrix
variable {n : ℕ}
variable {p w t : ℕ} (L : QLay n p w t)
theorem OPI.QLay.main_ideal (hp : 0 < p) (hpw : p ≤ 2 ^ w) (g : Qubits n → ℂ) (hg : L.Dom g) (δ : ℝ)
(hδ : ∀ x < p, badMass p t x ≤ δ) :
vnorm ((L.swM * L.Qmᴴ * L.tauM * L.Qm * L.Dideal).mulVec (bfac L.bE (fvec p w 0) g) -
(embedOp (qftP p w) L.aE).mulVec g) ≤ 2 * Real.sqrt δ * vnorm g := by sorry