One popular picture of a quantum computer is a machine that tries every possible answer at the same time and simply picks the right one. It is a tidy image, and it is wrong. Quantum algorithms get their advantage by arranging a computation so that wrong answers cancel out and right ones reinforce each other, and that trick only works for certain kinds of problems. Two of the best-known examples, Shor’s and Grover’s, show how different those advantages can be.
The Core Idea Behind Quantum Algorithms
A classical computer works through bits that are either 0 or 1. A quantum computer uses qubits, which can be placed in combinations of states. A quantum algorithm is a carefully designed sequence of operations that steers those combinations so that measuring the result is likely to give the correct answer. The design is the hard part: for most everyday tasks, nobody has found a way to do better than a conventional machine.
That is why quantum computers are expected to complement ordinary computers rather than replace them. For background on the hardware itself, see our plain-English guide to quantum computing.
Shor’s Algorithm: The Big Speedup
In 1994, Peter Shor showed that a quantum computer could factor large numbers exponentially more efficiently than a classical one. IBM’s Shor’s algorithm module explains that it works by turning factoring into a related problem called order-finding, which is very difficult classically.
Factoring matters because the security of RSA encryption relies on it being hard. That is the reason Shor’s algorithm gets so much attention in security circles. IBM’s own course material is careful about timing, though: the algorithm will really only be useful on a large, fault-tolerant quantum computer, which it describes as still some years away. It is also probabilistic, so it sometimes has to be run again. Today’s noisy machines cannot run it on numbers anywhere near cryptographic size, which is closely tied to the error-correction challenge covered in our error correction explainer.
Grover’s Algorithm: The Modest Speedup
Grover’s algorithm, introduced by Lov Grover in 1996, tackles unstructured search: finding one item in a huge unsorted list. According to IBM’s Grover’s algorithm module, a classical computer needs about N/2 checks on average for N items, while Grover’s needs roughly (π/4) times the square root of N.
What a quadratic speedup looks like
Take a million items. A classical search averages around 500,000 checks. Grover’s needs about 785. That is a big improvement, but IBM stresses that it is only a quadratic speedup, not an exponential one like Shor’s. It also does not guarantee success on every run, and running it for too many iterations lowers the odds of a correct answer again.
Why the Difference Matters for Security
The two algorithms threaten different things. IBM notes that Grover’s algorithm will not break most modern encryption by itself, though it could speed up brute-force attacks. Shor’s is the one aimed at public-key schemes built on factoring. Our piece on how quantum computing threatens and fixes encryption covers this in more depth.
The response is already under way. NIST states on its post-quantum cryptography page that it has released three post-quantum cryptography standards, which are mandatory for federal systems. These are designed to resist attacks from quantum computers, so organizations can migrate before large machines exist.
Beyond Shor and Grover
Other algorithms target simulation of molecules and materials, optimization, and sampling problems. Whether any of them beats the best classical methods on a useful task is an active debate, which our explainer on quantum advantage unpacks.
FAQs
What is Shor’s algorithm used for?
It factors large integers. Because RSA encryption depends on factoring being hard, a large fault-tolerant quantum computer running Shor’s algorithm could in principle break it.
What is Grover’s algorithm used for?
It searches an unsorted collection faster than a classical computer can, with a quadratic rather than exponential speedup. It is a general search tool, not a codebreaker on its own.
Can quantum computers break encryption today?
No. IBM describes the machines needed to run Shor’s algorithm usefully as still some years away, and today’s quantum computers are too small and error-prone.
Do quantum computers try every answer at once?
No. They use interference to boost correct answers and suppress wrong ones, and that works only for problems with the right structure.
What is being done to prepare for the quantum threat?
NIST has released post-quantum cryptography standards for federal systems, and organizations are beginning to plan migrations to algorithms designed to resist quantum attacks.












Discussion about this post