← all environments 13 · Frontier · Quantum · v0.3.0

Grover 3-Qubit Search

Quantum

Grover’s algorithm searching an 88-item space with 33 qubits. Uniform superposition, then repeated rounds of oracle (phase-flip the target) and diffusion (invert about the mean) rotate the state vector toward the marked item. Real 88-amplitude linear algebra drives a live bar chart; after the optimal π8/4=2\lfloor\pi\sqrt{8}/4\rfloor=2 rounds the target probability peaks near 94%94\%.

11 components · 12 connections · amplitude amplification over 8 states

the aha

You cannot find the needle faster by looking harder — but you can rotate the entire haystack until the needle is all that remains.

why it works
Classically, finding one marked item among NN takes about N/2N/2 guesses; there is no cleverer way to check an unstructured list. Grover’s insight is geometric. Put all N=8N = 8 states in equal superposition s|s\rangle, then repeat two reflections. The oracle UfU_f flips the sign of the target’s amplitude only — a phase nudge you cannot see by measuring. The diffusion operator 2ssI2|s\rangle\langle s| - I reflects every amplitude about their mean, which converts that hidden sign into a taller bar. Each round rotates the state vector by a fixed angle toward the target, so the target’s probability grows like sin2 ⁣((2k+1)θ)\sin^2\!\big((2k{+}1)\theta\big). After the optimal kπ4N=2k \approx \frac{\pi}{4}\sqrt N = 2 rounds it peaks near 94%94\% — a quadratic N\sqrt N speedup you can watch happen bar by bar. Run too many rounds and it rotates past the target and back down.
governing model
s(DUf)ks,kπ4N    N=8|s\rangle \to (D\,U_f)^k|s\rangle,\quad k \approx \dfrac{\pi}{4}\sqrt{N} \;\cdot\; N = 8
structural inventory
  • 33-qubit uniform superposition
  • oracle UfU_f (phase flip)
  • diffusion 2ssI2|s\rangle\langle s|-I
  • 88-state amplitude readout
boundaries
  • N=8N=8 search space
  • optimal k=2k=2 rounds
  • peak P(target)0.945P(\mathrm{target})\approx0.945
fault relay oracle marks the wrong state
  1. Choose a target and apply one Grover round.

    The oracle flips the target’s sign; diffusion turns that into height. One round already lifts the target bar well above the uniform 18\tfrac{1}{8}.
  2. Apply the second round — the optimum.

    For N=8N = 8 the optimal count is k=2k = 2. The target probability peaks near 0.9450.945. This is N\sqrt N scaling made visible: two rounds, not four guesses.
  3. Over-rotate, or point the oracle at the wrong state.

    A third round rotates past the target and the bar shrinks — more work, worse answer. A miswired oracle amplifies the wrong item entirely. The geometry is unforgiving.
causal signal trace paused

Uniform superposition Three Hadamards spread one unit of probability evenly across all eight basis states.

step 1 / 8 Uniform superposition

Loading Grover 3-Qubit Search model…