BQP: which problems can a quantum computer solve quickly?
BQP is the class of problems that a quantum computer can solve quickly. More precisely, it contains the questions with a yes/no answer for which a quantum computer has a procedure that finishes in polynomial time and gives the wrong answer with probability at most one in three. The name is short for bounded-error quantum polynomial time. It was introduced in 1993 by Ethan Bernstein and Umesh Vazirani, and it is the most honest answer computer scientists have to the question “what are quantum computers actually good for?”
What is surprising is how little we know about it for certain. We know a few problems that lie in BQP and for which nobody knows a fast algorithm for an ordinary computer. Factoring large numbers is the famous one. But nobody can prove that an ordinary computer really can't do the same. Whether BQP equals P, the class of problems an ordinary computer solves quickly, is an open question, and we will see why it is so hard to settle.
What does “quickly” mean?
Computer scientists don't measure speed in seconds. They look at how the number of steps grows with the size of the input n, for example with the number of digits of a number. If an algorithm needs n2 or n3 steps, we say it runs in polynomial time, and we consider it fast. If it needs 2n steps, it is hopeless for large n. The article on P versus NP explains the difference at length.
The class P contains the yes/no questions that an ordinary computer can answer in polynomial time. For example, “is this 600-digit number a prime?” belongs to P; a polynomial algorithm for it was found in 2002 by Manindra Agrawal, Neeraj Kayal and Nitin Saxena.
Computers that toss coins
Between ordinary and quantum computers there is a step in between: an ordinary computer that is allowed to toss coins. Some algorithms make random choices along the way and may, with bad luck, give a wrong answer. The class BPP (bounded-error probabilistic polynomial time) contains the problems that such a computer solves in polynomial time with an error of at most one in three, for every input.
One wrong answer in three sounds dreadful. Would you trust a calculator that lies every third time? The trick is to run the algorithm several times and take the majority answer. Each run tosses its own coins, so the runs are independent. With three runs the majority is wrong if exactly two runs are wrong (the correct one can be any of the three) or if all three are wrong:
That is only a small improvement on
| runs | probability that the majority is wrong |
|---|---|
| 1 | 0.33 |
| 3 | 0.26 |
| 25 | 0.042 |
| 101 | 0.00027 |
| 301 | 0.0000000013 |
After 301 runs the majority is wrong roughly once in 800 million attempts. The error falls exponentially with the number of runs, while the time grows only 301 times, and a polynomial multiplied by 301 is still a polynomial. So the “one in three” in the definition doesn't matter much. Any fixed error probability below one half would give the same class.
An algorithm that never errs is a special case, so P is part of BPP. Most computer scientists suspect that the two classes are in fact equal and that coins don't really help, but that hasn't been proved either.
BQP has exactly the same definition as BPP, only with a quantum computer instead of a coin-tossing one. The error is there for a good reason: the result of a quantum computation is read by a measurement, and measurement in quantum physics is random.
What does a quantum computer do differently?
An ordinary computer stores bits, each of which is 0 or 1. A quantum computer has qubits. You have probably heard that a qubit can be 0 and 1 at the same time, so a hundred qubits supposedly try all 2100 possibilities at once. That is misleading. When you measure the qubits at the end, you get just one random result. If that were all a quantum computer could do, it would be no better than the coin-tossing computer.
The real difference is subtler. In a quantum computer each possible result has an amplitude instead of a probability. The probability of seeing that result when you measure is the square of its amplitude. And amplitudes, unlike probabilities, can be negative. (In general they are complex numbers, but negative numbers are enough to show the idea.) Probabilities can only add up. Amplitudes can cancel out.
Here is the smallest example. Toss an ordinary coin once and you get heads or tails with probability one half. Toss it a second time and it is still fifty-fifty, whatever happened before. Now a quantum “coin”, one step of which works like this:
- from 0 the qubit goes to 0 with amplitude
and to 1 with amplitude , - from 1 it goes to 0 with amplitude
and to 1 with amplitude .
Start at 0 and do one step. The probabilities are
The two paths that end at 0 each have amplitude
The qubit is back at 0 with certainty. Two “random” steps in a row have produced a completely certain result, which can never happen with an ordinary coin. This effect is called interference, the same thing that happens when a wave crest meets a wave trough on water.
A quantum algorithm is a carefully planned choreography: the paths leading to wrong answers should cancel out and the paths leading to the right answer should add up. Peter Shor managed this in 1994 for finding a hidden repetition (period) in a sequence of numbers, such as the remainders of the powers of 2 divided by 15: 1, 2, 4, 8, 1, 2, 4, 8 and so on, repeating every four steps. That is the heart of Shor's algorithm for factoring. The catch: such a choreography is only known for problems with a special hidden structure.
BQP describes an idealised, error-free quantum computer; today's machines are small and noisy, and BQP asks what such machines could do in principle.
What a quantum computer can solve quickly
Everything in BPP is also in BQP: a quantum computer can imitate an ordinary one, and it can get its random coins from measuring a qubit. Beyond that, we know a few problems in BQP that look hard for ordinary computers:
- Factoring and discrete logarithms. Shor's algorithm factors an n-digit number in polynomial time. The best known ordinary algorithm, the number field sieve, needs a number of steps that grows faster than any power of n, but much slower than 2n. On this gap rest the RSA cipher, Diffie–Hellman key exchange and elliptic curve cryptography, which is why we are moving to post-quantum cryptography.
- Simulating quantum physics. How electrons behave in a molecule or a new material is a quantum process, and an ordinary computer has to keep track of exponentially many amplitudes: n particles with two states each give 2n combinations, each with its own amplitude, so 50 particles already mean about 1015 numbers. Richard Feynman suggested in 1982 that a computer built from quantum parts could do it more naturally, and in 1996 Seth Lloyd showed that it really can. Many physicists consider this the most useful application.
What a quantum computer probably can't solve quickly
The class NP contains the problems whose answer is easy to check once someone shows it to you; a proposed divisor of a number, for example, is checked by one division. The hardest of them are NP-complete: a fast algorithm for one of them, such as the travelling salesman or sudoku, would give one for all of NP. The most common myth is that a quantum computer will crack them by trying all the solutions at once. We have already seen why it doesn't work like that. What it can do was found by Lov Grover in 1996.
Imagine N boxes, one of which hides a prize, and nothing tells you which one it is. An ordinary computer has to open the boxes one by one: half of them on average and all N in the worst case. Grover's algorithm gets by with about
looks. For a million boxes that is
Instead of hundreds of thousands of looks, fewer than a thousand. That's impressive, but a typical hard problem has 2n candidate solutions, for example all settings of n yes/no switches. Grover then needs about
steps. That is still exponential: for n = 100 about 1015.
And we can't do better by searching blindly. In 1997 Bennett, Bernstein, Brassard and Vazirani proved that no quantum algorithm can find the prize among N boxes with substantially fewer than
A map of the classes
We know for certain that P ⊆ BPP ⊆ BQP ⊆ PSPACE, where the sign ⊆ means “is part of”.
The class PSPACE contains the problems an ordinary computer can solve with a polynomial amount of memory, however long it takes. Why is BQP inside it? Look back at the tree of paths: an ordinary computer can simulate a quantum one by going through the paths one by one and adding up their amplitudes. That needs very little memory, just a running total. There are exponentially many paths, though, so it takes an exponentially long time.
The relation between BQP and NP is not known. Factoring is a strange member of NP. As a yes/no question it reads “does N have a divisor other than 1 smaller than k?” A “yes” is checked with the divisor. But a “no” can be checked quickly too: the complete factorisation of N shows that all its prime factors are at least k, and we can check quickly that they really are primes. Problems like this are believed not to be NP-complete. That is why factoring sits in the overlap of NP and BQP, away from the NP-complete problems.
Proven are only the chain above, P ⊆ NP ⊆ PSPACE and the fact that factoring lies in both NP and BQP. Everything else in the picture, the overlaps and the gaps, is what most computer scientists believe.
P versus BQP
Is every problem that a quantum computer can solve quickly also solvable quickly by an ordinary computer? If P = BQP, quantum computers would bring no fundamental advantage, at most a speedup by some polynomial factor. Most computer scientists believe that P ≠ BQP, but nobody can prove it.
Why is it so hard? Look at the chain of classes again. If someone proved P ≠ BQP, then, since BQP lies inside PSPACE, they would also have proved P ≠ PSPACE. And P versus PSPACE, a little brother of P versus NP, has been open for more than fifty years.
What do we have instead of a proof? Three kinds of evidence.
Factoring. People have looked for fast ways to factor numbers since antiquity, and intensively since the 1970s, when RSA started to depend on it. Nobody has found a polynomial algorithm. That is evidence, but not proof.
Black boxes. Sometimes computer scientists study a simplified game: the algorithm can't see the problem and may only ask questions of a black box, called an oracle. We count the questions, and in this game things can be proved. In 1994 Daniel Simon found a task that a quantum computer solves with about n questions, while an ordinary one needs exponentially many. In 2018 Ran Raz and Avishay Tal found a black box where a quantum computer wins even against an ordinary computer with a helper that answers any NP question. But real problems are not black boxes, so such results don't settle questions about them.
Dequantisation, the warning. In 2016 Iordanis Kerenidis and Anupam Prakash published a quantum algorithm for recommendation systems, the kind that guess which films you'd like, and it was exponentially faster than any known ordinary algorithm. In 2018 Ewin Tang, then an undergraduate student, found an ordinary algorithm that is slower than the quantum one only by a polynomial factor, say n3 times rather than exponentially, and the exponential advantage vanished. The lesson is that “no ordinary algorithm is known” and “no ordinary algorithm exists” are two very different statements.
Why is BQP in the news?
On 4 December 2026 a post spread on the social network X claiming that OpenAI had proved P = BQP and informed American intelligence agencies. It came with no paper and no algorithm, and an OpenAI researcher denied it the same day. If it were true, ordinary computers could in principle factor quickly too, which would break RSA. It would not mean P = NP, though: NP-complete problems are probably not in BQP at all. More in the blog post P = BQP: what would it mean if OpenAI had really proved it?