§6, p. 1504 — the discrete-log circuit gives a good output with probability at least
ProvedShorAlgorithms.DiscreteLog.good_output_prob_geThroughout, is a prime, is a generator of the multiplicative group (an element of order ), is an integer with and (so is the discrete logarithm of ), and is a power of with .
Run Shor's discrete-logarithm circuit: prepare the state
apply the Fourier transform (entries ) to each of the first two registers, and measure all three registers, obtaining . The output is good if satisfies (6.10) with , and (6.11) . Then
This constant success probability is what makes the quantum discrete-logarithm algorithm run in expected polynomial time: from a few good outputs the discrete logarithm can be deduced.
Formalization Note The paper states the intermediate bound "at least "; its own count gives , which still yields because and are both even, so forces . Only is stated. The state preparation by testing and restarting is not formalized; the state (6.1) is taken as given.
import Mathlib import Definitions.Def_ShorAlgorithms_DiscreteLog_outcomeProb import Definitions.Def_ShorAlgorithms_DiscreteLog_IsGood
namespace ShorAlgorithms.DiscreteLog
open Classical in
/-- Shor (1997), §6, p. 1504 ("the probability of observing some good state is … at least
1/480"): for every prime `p`, generator `g` of `(ℤ/p)ˣ`, discrete logarithm `r` with
`0 ≤ r < p - 1` (`x = g^r`), and `q = 2^l` with `p < q < 2p`, the probability that the observed
state `|c, d, y⟩` of the discrete-logarithm circuit is good ((6.10) and (6.11)) is at least
`1/480`. -/
theorem good_output_prob_ge (p : ℕ) [hp : Fact p.Prime] (g : (ZMod p)ˣ) (hg : orderOf g = p - 1)
(r : ℕ) (hr : r < p - 1) (q l : ℕ) (hq : q = 2 ^ l) (hpq : p < q) (hqp : q < 2 * p) :
(1 : ℝ) / 480 ≤ ∑ c : Fin q, ∑ d : Fin q,
if IsGood p q r c d then ∑ y : (ZMod p)ˣ, outcomeProb p g (g ^ r) q c d y else 0 := by sorry
end ShorAlgorithms.DiscreteLog
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.