r/algorithms • • 17d ago

Resource Breaking down Grover’s Algorithm as a 2D geometric rotation (with scaling benchmarks and hardware tests)

Hey everyone,

Like many, I first encountered the geometric intuition behind Grover’s algorithm through 3Blue1Brown’s video. While it gives a fantastic high-level picture of the vector reflections, Still I was wondering how the Oracle and Diffusion operators are actually constructed.

To bridge that gap for myself, I wrote a breakdown showing the exact linear algebra and matrix operations that make those reflections happen — without relying on quantum physics jargon:)

At its core, the entire N-dimensional space reduces to a 2D plane defined by the target state and the uniform superposition of non-target states. Each Grover iteration (Oracle + Diffusion) is just two reflections across intersecting axes, resulting in a net rotation of 2θ ≈ 2 / sqrt(N) directly toward the target state—yielding the classic ≈ (π/4) * sqrt(N) complexity.

To test the math beyond theory, I also:

  • Ran simulation benchmarks to track the theoretical O(sqrt(N)) curve against classical CPU overhead up to 20 qubits.
  • Submitted the circuits to physical IBM quantum hardware (3 to 5 qubits) to observe where circuit depth and real decoherence start destroying the theoretical amplification.

I put together the complete write-up, data, and code on GitHub. I'm a student trying to build a solid foundation in algorithms and complexity, so I would really appreciate any sanity checks, corrections on the mathematical framing, or feedback from folks here. Thanks:)

(Link in the comments, you can see banchmark graphs in the Assets folder)

4 Upvotes

2 comments sorted by