Quantum Complexity: BQP and Beyond
The complexity class that tells you what quantum computers can (and can't) efficiently do
By the end of this topic you'll be able to
Every algorithm covered so far secretly answers a complexity-theoretic question: how does the resource cost of solving a problem scale with the size of its input, and does a quantum computer change that scaling? The formal class capturing 'what a quantum computer can efficiently do' is called BQP.
BQP (Bounded-error Quantum Polynomial time) is the class of decision problems solvable by a quantum circuit whose size grows only polynomially with the input size, with the correct answer returned at least two-thirds of the time — an arbitrary but standard threshold, since repeating the computation a few times and taking a majority vote pushes the success probability arbitrarily close to 1. It is the direct quantum analogue of BPP, the classical class of problems efficiently solvable by a randomized algorithm.
Shor's factoring algorithm is exactly a demonstration that one specific, believed-to-be-hard problem sits inside BQP. That's strong evidence — though not a proof, since factoring has never been proven classically hard — that BQP is strictly larger than P, the class of problems an ordinary computer solves efficiently.
BQP is known to sit inside PSPACE, the class of problems solvable with a polynomial amount of memory regardless of running time: a quantum computation can always be simulated classically using memory that scales reasonably even though the simulation itself may take exponentially longer. Whether BQP sits inside NP, or contains all of NP, remains a genuinely open question — Grover's algorithm searches an NP-flavored space quadratically faster, but a quadratic speedup falls well short of showing NP ⊆ BQP.
This is precisely the distinction separating Shor's algorithm from Grover's in complexity-theoretic terms. Grover's √N speedup is proven optimal for unstructured search in the oracle model — no algorithm using only oracle queries can do better, full stop — while Shor's exponential speedup exploits deep algebraic structure (the periodicity of modular exponentiation) that has no counterpart in Grover's fully unstructured setting.
Aaronson's work relating BQP to the polynomial hierarchy is part of a broader research program locating BQP within the full landscape of classical complexity classes, not just P and PSPACE but the polynomial hierarchy — a tower of classes built by alternating quantifiers over NP. Settling these relationships precisely would resolve some of the deepest open questions in theoretical computer science generally, not only in quantum computing.
This framing matters directly when reading a paper: whenever a new quantum algorithm claims a 'speedup,' the meaningful question is always speedup relative to which class of classical algorithms, and whether that speedup is proven or merely conjectured. A claimed advantage measured against a needlessly weak classical baseline is one of the most common ways a quantum advantage claim gets walked back on closer inspection — exactly the kind of thing the credibility checklist from the previous topic is built to catch.
In short: BQP is quantum computing's answer to 'what's efficiently computable,' Shor's algorithm is the leading evidence that it's a genuinely bigger class than classical efficient computation, and Grover's algorithm is proof that not every quantum advantage is that dramatic — most problems, if they get a quantum speedup at all, get something far more modest than exponential.
Try It Yourself
A BQP algorithm succeeds with probability 2/3 on each run. If you run it 3 independent times and take the majority answer, what's the new success probability?
- 1The majority answer is wrong only if at least 2 of the 3 independent runs are wrong. Each run is wrong independently with probability 1/3.
- 2P(exactly 2 of 3 wrong) = C(3,2)·(1/3)²·(2/3) = 3 × (1/9) × (2/3) = 6/27.
- 3P(exactly 3 of 3 wrong) = (1/3)³ = 1/27.
- 4P(majority wrong) = 6/27 + 1/27 = 7/27, so P(majority correct) = 1 − 7/27 = 20/27 ≈ 0.741.
Success probability rises from 2/3 (≈0.667) to 20/27 (≈0.741) after just 3 repetitions with majority vote — and more repetitions push this arbitrarily close to 1, which is exactly why BQP's specific '2/3' threshold is an arbitrary, harmless convention rather than a real limitation.
Reference
| BQP | Problems solvable by a poly-size quantum circuit, correct ≥ 2/3 of the time | |
| Classical analogue | BQP is the quantum version of efficient randomized computation | |
| Known containment | Quantum computations remain classically simulable given enough memory | |
| Open question | Still unresolved — a central open problem in complexity theory |
Quick Check
What does it mean for a problem to be in BQP?
Why is Shor's exponential speedup fundamentally different from Grover's quadratic speedup, in complexity-theoretic terms?