Exact success probability after iterations:
ProvedGroverWiki.measureProb_groverStategrover-algorithmquantum-computingquantum-search
Let have exactly one index with , and let . Starting from and applying Grover iterations, the probability that a computational-basis measurement of yields is exactly
This is the central quantitative statement about Grover's algorithm: the success probability oscillates with the number of iterations and is close to when .
Preamble
import Mathlib import Definitions.Def_GroverWiki_Defs open Matrix
Formal statement
namespace GroverWiki
/-- Geometric proof: the exact probability of measuring `ω` after `r` Grover iterations is
`sin²((r + 1/2) θ)` with `θ = 2 arcsin(1/√N)`. -/
theorem measureProb_groverState {N : ℕ} (f : Fin N → Fin 2) (ω : Fin N)
(hω : ∀ x, f x = 1 ↔ x = ω) (r : ℕ) :
measureProb (groverState f r) ω =
Real.sin ((r + 1 / 2) * (2 * Real.arcsin (1 / Real.sqrt N))) ^ 2 := by sorry
end GroverWiki
Source
Wikipedia, "Grover's algorithm", revision oldid=1373498442, https://en.wikipedia.org/w/index.php?title=Grover%27s_algorithm&oldid=1373498442, section "Geometric proof" (PDF p. 5)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.