Skip to content
Quantum ComputingAN INTERACTIVE OPEN TEXTBOOK
charithj.com.au

Classical versus quantum algorithmic complexity

Specify the problem, the input size and the resource before claiming a speedup.

10 min readDr. Charith Jayasekara↓ Chapter PDF
By the end, you’ll be able to
  • Separate query complexity from gate cost and wall-clock time.
  • State the assumptions behind Grover’s quadratic query advantage.

An algorithm’s complexity describes how a chosen resource grows with input size. The resource might be oracle queries, gates, memory, measurements or physical runtime. These are related, but they are not interchangeable.

For a list of NN possibilities with one marked item, unstructured classical search needs order NN queries in the usual black-box model. Grover search uses order N\sqrt N oracle queries for bounded success probability. This is a quadratic query improvement, not an exponential one.

If N=2nN=2^n, classical exhaustive search takes order 2n2^n queries and Grover takes order 2n/22^{n/2}. Both expressions are exponential in the bit-length n; the square-root relation in N remains the useful comparison.

Preparing inputs, constructing the oracle, compiling gates, correcting errors, running shots and extracting useful classical outputs can all matter. A formal oracle advantage does not automatically survive those costs in an application.

Small browser timing comparisons would mainly measure a classical simulator and JavaScript implementation choices. This site therefore does not present their runtime as hardware speedup evidence.

In the Grover explorer, compare one marked item among four and among eight possibilities. Count iterations and success probability. Explain what the small example verifies, then list the costs it excludes.

For a stronger claim, specify a matched classical baseline, the same task and success criterion, comparable budgets, and the uncertainty of any measured results.

Reference: IBM Quantum — Fundamentals of quantum algorithms.

ONE IDEA FURTHER

Ready for the next step?

Your progress stays in this browser.