Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Algorithm Sheet — QFT, Phase Estimation, Shor, Grover, Trotter, VQE (L08–L12)

Quantum Fourier Transform (L08)

QFTj=1Nk=0N1e2πijk/Nk\text{QFT}|j\rangle = \frac{1}{\sqrt N}\sum_{k=0}^{N-1} e^{2\pi i jk/N}|k\rangle, N=2nN=2^n.
Circuit: HH + controlled-RkR_k (Rk=diag(1,e2πi/2k)R_k=\text{diag}(1,e^{2\pi i/2^k})) + final swaps.
Cost: O(n2)\mathcal O(n^2) gates vs classical FFT O(n2n)\mathcal O(n2^n).
Caveat: amplitudes, not data — you cannot read them all out. QFT pays off inside period-finding structures.

Quantum Phase Estimation (L09)

Given Uu=e2πiφuU|u\rangle = e^{2\pi i\varphi}|u\rangle: tt ancillas in HtH^{\otimes t}, controlled-U2jU^{2^j}, inverse QFT, measure \to φ\varphi to tt bits.
Success 1ϵ\ge 1-\epsilon with t=nprec+log(2+12ϵ)t = n_{\text{prec}} + \lceil\log(2+\tfrac{1}{2\epsilon})\rceil.
Materials use: U=eiHτU=e^{-iH\tau} \Rightarrow eigenphases give energies EkE_k — the fault-tolerant route to spectra.

Shor / Order Finding (L09)

Factor NN: pick aa; find order rr of amodNa \bmod N via QPE on Uy=aymodNU|y\rangle=|ay \bmod N\rangle; if rr even and ar/21a^{r/2}\ne-1: gcd(ar/2±1,N)\gcd(a^{r/2}\pm1, N) gives factors.
Continued fractions recover rr from measured φs/r\varphi \approx s/r.
Cost: O((logN)3)\mathcal O((\log N)^3) vs. sub-exponential classical (GNFS).

Grover / Amplitude Amplification (L10)

Oracle Ofx=(1)f(x)xO_f|x\rangle = (-1)^{f(x)}|x\rangle; diffusion D=2ssID = 2|s\rangle\langle s| - I, s=Hn0|s\rangle=H^{\otimes n}|0\rangle.
Iterate G=DOfG=DO_f about Rπ4N/MR \approx \frac\pi4\sqrt{N/M} times (MM marked of NN).
Geometry: each GG rotates by 2θ2\theta, sinθ=M/N\sin\theta=\sqrt{M/N}.
Overshooting reduces success — Grover is not monotone.
Quadratic speedup is provably optimal for unstructured search.

Trotterization (L11)

H=khkHkH=\sum_k h_kH_k: eiHt(keihkHkt/r)re^{-iHt}\approx\left(\prod_k e^{-ih_kH_kt/r}\right)^r,
error O ⁣(t2rj<k[Hj,Hk])\mathcal O\!\big(\tfrac{t^2}{r}\sum_{j<k}\|[H_j,H_k]\|\big); 2nd-order symmetric: O(t3/r2)\mathcal O(t^3/r^2).
Pauli-string evolution eiθPe^{-i\theta P}: basis rotations + CNOT ladder + Rz(2θ)R_z(2\theta) + undo.
Jordan–Wigner: aj(k<jZk)Xj+iYj2a_j\mapsto \big(\prod_{k<j}Z_k\big)\tfrac{X_j+iY_j}{2}.

VQE (L12)

E(θ)=ψ(θ)Hψ(θ)E0E(\boldsymbol{\theta})=\langle \psi(\boldsymbol{\theta})|H|\psi(\boldsymbol{\theta})\rangle\ge E_0; hybrid loop: QPU measures Pauli groups, CPU optimizes.
Parameter-shift: θE=12[E(θ+π2)E(θπ2)]\partial_\theta E=\tfrac12[E(\theta{+}\tfrac\pi2)-E(\theta{-}\tfrac\pi2)].
Shots for precision ε\varepsilon: (khk)2/ε2\sim(\sum_k|h_k|)^2/\varepsilon^2. Chemical accuracy: 1.6 mHa.
Watch for: barren plateaus (deep random ansätze), noise floor, local minima.

When to Use What

ProblemAlgorithmEra
Spectra (exact)QPE + Trotterfault-tolerant
Ground state (approx.)VQE / ADAPTNISQ
Dynamics/quenchTrotterNISQ–FT
Search/optimizationGrover / QAOAFT / NISQ
Factoring, cryptoShorfault-tolerant

Complexity Snapshot

BQP \supseteq BPP; believed BQP \ne NP-complete-solving.
Speedups: exponential (structured: factoring, simulation), quadratic (unstructured search).
Exam habit: always report qubit count, circuit depth, and shot/repetition cost.