Oracle
Flips the phase of the target state: |target⟩ → −|target⟩.
This marks the correct answer without revealing it — the
amplitude magnitude is unchanged, only the sign.
Diffusion
Reflects all amplitudes around their mean ⟨α⟩.
Below-mean states grow; above-mean states shrink.
Because the target was flipped it is now far below mean —
so it gains the most amplitude each iteration.
Convergence
After ⌊π√N/4⌋ iterations the state vector aligns with
|target⟩ and measurement succeeds with near-certainty.
Further Reading
Grover, L. K. (1996). A fast quantum mechanical algorithm
for database search. Proc. 28th ACM STOC, pp. 212–219.
arXiv:quant-ph/9605043 ↗
Interactive visualization of quantum amplitude amplification.
Watch how interference steers probability toward the target state
through oracle phase-flips and diffusion inversions.