The gradient algorithm for approximately linear functions
ProvedQAlgorithms.Nannicini.gradientAlg_approxLinearThis proposition is the gradient algorithm for approximately linear functions.
Let and be integers, , and with . Let . Consider the grid
where denotes the grid point of the -bit string , and let be the -fold product grid with points. Algorithm 3 does the following:
- It applies to each of registers of qubits in .
- It applies the phase oracle .
- It applies the inverse of the shifted Fourier transform to each register.
- It measures the registers and outputs .
If
holds for at least of the points , then
The result makes the gradient algorithm robust: need only be close to linear on most grid points, for instance when is evaluated by a circuit that sometimes fails.
Formalization Note is taken on all of , because only its values on the grid enter the algorithm. The fraction condition is stated as the number of good grid points being at least .
import Definitions.Def_QAlgorithms_Defs_GradientMethods import Definitions.Def_QAlgorithms_Nannicini_Ch05a_Model set_option autoImplicit false
namespace QAlgorithms.Nannicini
/-- Nannicini p.110, Proposition 5.6 (based on Lem. 5.1 of Gilyén et al. 2019). Let `q > 0`,
`b ∈ ℝ`, `g ∈ ℝ^d` with `‖g‖_∞ ≤ 1/3`, and `f : [−1/2, 1/2]^d → ℝ` (taken on `ℝ^d`; only its
values on the grid are used). Let `G_q = {j/2^q − 1/2 + 1/2^{q+1} : j = 0, …, 2^q − 1}` (p.109)
and `x̂` the grid point of the register contents `x`. If `|f(x̂) − ⟨g, x̂⟩ − b| ≤ 1/(20π2^q)` for at
least `99.9%` of the `2^{dq}` points `x̂ ∈ G_q^d`, then the output `g̃ = (k̂_1, …, k̂_d)` of the
gradient algorithm (Alg. 3, p.110: `H^{⊗q}` on each of `d` registers in `|0⟩`, the phase oracle
`|x⟩ ↦ e^{2πi 2^q f(x̂)}|x⟩`, `Q_{G_q}†` on each register, measure) satisfies
`Pr(|g̃_j − g_j| ≤ 1/2^q) > 3/5` for every `j = 1, …, d`. -/
theorem gradientAlg_approxLinear (d q : ℕ) (hq : 0 < q) (b : ℝ) (g : Fin d → ℝ)
(hg : ∀ i, |g i| ≤ 1 / 3) (f : (Fin d → ℝ) → ℝ)
(hf : (999 / 1000 : ℝ) * (2 : ℝ) ^ (d * q) ≤
((Finset.univ.filter fun x : Fin d → Qubits q =>
|f (fun i => gridPoint q (x i)) - ∑ i, g i * gridPoint q (x i) - b| ≤
1 / (20 * Real.pi * (2 : ℝ) ^ q)).card : ℝ)) :
∀ j : Fin d, 3 / 5 < probEvent (gradientAlgState d q f)
fun k => |gridPoint q (k j) - g j| ≤ 1 / (2 : ℝ) ^ q := by
sorry
end QAlgorithms.Nannicini
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setup. Let be natural numbers with . Let , let with for every , and let be arbitrary.
Grid. For a -bit string with integer value (most significant bit first), the grid point is
These are equally spaced points in with spacing . For a -tuple of -bit strings, write .
Hypothesis. At least of the tuples satisfy
The state. Let be the matrix with entries
The state on blocks of qubits is obtained in three steps:
- Apply to each block of . This gives the uniform superposition with amplitudes .
- Multiply amplitude by the phase .
- Apply (conjugate transpose) to each block.
Conclusion. For every coordinate , measuring in the computational basis gives an outcome satisfying
with probability strictly greater than .
Edge cases.
- enters only through its values at the grid points.
- need not lie on the grid.
- If , the conclusion is vacuous.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.