Quantum Computing: Grover’s Algorithm
The Mathematics of Inversion about the Mean
1. Initial State & The “Root 8” Factor
In a 3-qubit system, there are 23 = 8 possible states. To maintain a total probability of 1, the starting amplitude for each state must be:
When we apply the HZH Diffusion Operator, the Hadamard gates redistribute this “0.353” energy through constructive and destructive interference.
2. Step 1.2: Hadamard Ket Expansion
Each state in the superposition expands into 8 terms. The Oracle has already marked |101> by making its coefficient negative:
(1/8)[+|000>+|001>+|010>+|011>+|100>+|101>+|110>+|111>] ← H|000>
(1/8)[+|000>-|001>+|010>-|011>+|100>-|101>+|110>-|111>] ← H|001>
(1/8)[+|000>+|001>-|010>-|011>+|100>+|101>-|110>-|111>] ← H|010>
(1/8)[+|000>-|001>-|010>+|011>+|100>-|101>-|110>+|111>] ← H|011>
(1/8)[+|000>+|001>+|010>+|011>-|100>-|101>-|110>-|111>] ← H|100>
-(1/8)[+|000>-|001>+|010>-|011>-|100>+|101>-|110>+|111>] ← Marked H|101>
(1/8)[+|000>+|001>-|010>-|011>-|100>-|101>+|110>+|111>] ← H|110>
(1/8)[+|000>-|001>-|010>+|011>-|100>+|101>+|110>-|111>] ← H|111>
3. The Full Interference Map
| Source Row | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
|---|---|---|---|---|---|---|---|---|
| H|000> | + | + | + | + | + | + | + | + |
| H|001> | + | – | + | – | + | – | + | – |
| H|010> | + | + | – | – | + | + | – | – |
| H|011> | + | – | – | + | + | – | – | + |
| H|100> | + | + | + | + | – | – | – | – |
| -H|101>* | – | + | – | + | + | – | + | – |
| H|110> | + | + | – | – | – | – | + | + |
| H|111> | + | – | – | + | – | + | + | – |
| Net Signs | 6+, 2- | 5+, 3- | 2+, 6- | 5+, 3- | 5+, 3- | 2+, 6- | 5+, 3- | 2+, 6- |
4. Final Amplitude Breakdown
The Net Count from the map is scaled by the original “1/√8” amplitude to give the final result:
| Output State | Net Count | Calculation (Net/8 × 0.353) | Final Amplitude |
|---|---|---|---|
| |000> (and others) | 6+, 2- | (6 – 2)/8 × 0.353 | +0.177 |
| |101> (Target) | 2+, 6- | (2 – 6)/8 × -0.353 | +0.884 |
The “Stopping Rule”
Grover’s algorithm is periodic. For 3 qubits, 2 rounds is the “sweet spot.” A 3rd round would actually decrease the success probability as the vector rotates past the target. Stopping at the peak amplitude of π/4 √N rounds ensures near-certainty!