Physic Labs

Frontier physics

Quantum algorithms (Shor, Grover)

Illustrate Grover's algorithm: amplitude amplification of a target state among NN items. Watch the state vector rotate in a two-dimensional plane and verify the optimal iteration count ≈π4N\approx \frac{\pi}{4}\sqrt{N}.

Research

Equipment

  • Model of the state vector rotating in a 2D plane
  • Sliders for size N and iteration count k
  • Display of target amplitude/probability per iteration

Procedure

  1. Set the problem size

    Drag the "Size N" slider to choose the number of items in the simulated database (e.g. N = 25). Look at the initial state axis: the target amplitude starts at 1/N1/\sqrt{N} — small for large N. Compare with classical search, which needs on average N/2N/2 trials.

  2. Increase the iteration count

    Step the "Iterations" slider and watch the state vector rotate toward the target axis: each Grover iteration adds an angle 2θ2\theta with sin⁡θ=1/N\sin\theta = 1/\sqrt{N}. Read the probability of measuring the target after k iterations: P(k)=sin⁡2((2k+1)θ)P(k) = \sin^2((2k+1)\theta).

  3. Find the optimal iteration count

    For each N, scan k for the maximum probability and compare with k∗≈π4Nk^* \approx \frac{\pi}{4}\sqrt{N}. Push past the optimum to see the probability fall again — the vector overshoots the target. Try a large N (e.g. 100) and repeat: k∗k^* grows as N\sqrt{N}, not NN.

Simulation

Experiment history

In 1982 Richard Feynman proposed using quantum systems to simulate other quantum systems — the seed of quantum computing. David Deutsch (1985) defined the universal quantum Turing machine. In 1994 Peter Shor published polynomial-time factoring, and in 1996 Lov Grover presented a search algorithm needing O(N)O(\sqrt{N}) queries — a quadratic speedup over any classical method. Unlike Shor's number-theoretic machinery, Grover's uses only two geometric transformations: reflection about the target state (the oracle) and reflection about the mean (diffusion). Bennett, Bernstein, Brassard, and Vazirani proved Ω(N)\Omega(\sqrt{N}) is also the lower bound for quantum search, so Grover is asymptotically optimal. Small-scale demonstrations have run on trapped ions and superconducting qubits.

Related physicists

Related library topics