§4, eq. (4.5) — the amplitude of |a⟩ → |b⟩ through the QFT circuit
ProvedShorAlgorithms.QFT.path_amplitudep2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1quantum-algorithmsquantum-circuitsquantum-fourier-transform
Let and let and be -bit basis states. Run the gate sequence
of Shor's eq. (4.4) on the basis state , where is the one-bit gate (4.2) on bit and is the two-bit phase gate (4.3) on bits with angle . Then the amplitude of in the resulting state is
The factor collects the factors of the gates , and the phase is Shor's expression (4.5): contributes when , and contributes when the input bit and the output bit are both . That the second sum pairs with records the order in which the gates act.
Formalization Note The circuit is run on the basis state and the conclusion is the amplitude at . The prefactor is written and is natural-number subtraction under .
Preamble
import Mathlib import Definitions.Def_ShorAlgorithms_QFT_BitStrings import Definitions.Def_ShorAlgorithms_QFT_Circuit
Formal statement
namespace ShorAlgorithms.QFT
/-- Shor 1997, §4, eq. (4.5), p. 1496: the amplitude of going from `|a⟩` to `|b⟩` through the
gate sequence (4.4) is `2^{-l/2}` times `exp(i φ)`, where
`φ = ∑_{0 ≤ j < l} π a_j b_j + ∑_{0 ≤ j < k < l} (π / 2^{k-j}) a_j b_k`. -/
theorem path_amplitude (l : ℕ) (a b : Fin l → Fin 2) :
runCircuit (qftGates l) (basisState a) b =
((Real.sqrt (2 ^ l) : ℝ) : ℂ)⁻¹ *
Complex.exp
(((∑ j : Fin l, Real.pi * ((a j : ℕ) : ℝ) * ((b j : ℕ) : ℝ)) +
∑ j : Fin l, ∑ k : Fin l,
if j < k then
Real.pi / 2 ^ ((k : ℕ) - (j : ℕ)) * ((a j : ℕ) : ℝ) * ((b k : ℕ) : ℝ)
else 0 : ℝ) * Complex.I) := by sorry
end ShorAlgorithms.QFT
Source
Shor, Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer, SIAM J. Comput. 26(5) (1997), p. 1496, §4, eq. (4.5) ("To show that this operation actually performs a quantum Fourier transform, consider the amplitude of going from |a⟩ …")
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.