Explainer
Quantum algorithms explained: Shor, Grover and quantum simulation
A quantum algorithm uses interference so that paths to the right answer reinforce each other and the rest cancel; the best known are Shor's algorithm, which factors numbers efficiently, and Grover's search, which gives a square-root speed-up.[1][2][3] Simulating molecules and materials is the use researchers expect quantum computers to be best at, while hybrid methods such as VQE and QAOA are designed for today's small, noisy machines.[4][5][6]
How a quantum algorithm works
A quantum computer does not just try every answer at once. A quantum algorithm is a recipe that sets up qubits so that the wrong answers cancel each other out and the right answer becomes likely. Grover’s search paper describes it this way: successful computations reinforce each other while the others interfere.[1]
Quantum algorithms prepare superpositions and then apply operations whose phases are chosen so that amplitudes for correct outcomes add up and others cancel.[1] How much this helps depends on the problem. Shor’s algorithms factor integers and compute discrete logarithms in polynomial time, problems generally thought to be hard classically.[7][2] For unstructured search Grover’s algorithm gives a square-root speed-up and is within a small constant factor of the fastest possible quantum algorithm.[3][8]
For the physics behind this, see Superposition and entanglement explained.
Shor’s algorithm: factoring and discrete logarithms
Shor’s algorithm was first published in 1994.[9] It solves two problems efficiently on a quantum computer: factoring whole numbers and finding discrete logarithms. Both are thought to be hard for ordinary computers, which is why several cryptosystems are built on them.[7] The number of steps grows only polynomially with the size of the input, such as the number of digits in the number being factored.[2]
This is why the algorithm matters for security. NIST’s 2016 report on post-quantum cryptography says a large-scale quantum computer would leave RSA, elliptic-curve and other public-key schemes based on factoring or discrete logarithms no longer secure.[10] Today’s machines are still small, noisy prototypes.[6] How quantum computers break encryption covers current resource estimates, and How post-quantum cryptography works covers the replacement algorithms.
Grover’s algorithm: searching faster
Imagine looking for one name in a phone book whose pages are in random order. An ordinary computer has to check about half the entries to have an even chance of finding it. Grover’s algorithm needs only about the square root of the number of entries.[3] For a million entries, the square root is 1,000, so the search takes on the order of a thousand steps instead of half a million (this is simple arithmetic on those two rules, not a figure from the paper).[3]
For an unstructured list of N items, any classical algorithm needs at least N/2 queries to find a marked item with probability one half, while Grover’s algorithm uses O(√N) steps.[3] It was first presented at STOC in 1996, and the quadratic advantage is close to optimal for quantum computers.[11][8]
A quadratic speed-up is useful but limited. NIST says Grover’s algorithm does not make symmetric ciphers such as AES obsolete, and doubling the key size would keep them secure if it ever became practical.[12]
Quantum simulation
The Department of Energy says researchers expect quantum computers to be especially good at calculating the properties of systems that are quantum in nature, such as molecules used as chemical catalysts.[4] See What quantum computers are good for for the applications researchers are pursuing.
Algorithms for today’s noisy machines
As of 2026 the Department of Energy describes current quantum computers as small, noisy prototypes.[6] Two widely studied families of algorithm combine quantum and classical steps:
- Variational quantum eigensolver (VQE). A small quantum processor and a conventional computer work together, which greatly cuts how long the quantum hardware must stay coherent.[5] The first experiment, in 2013, calculated the ground-state energy of the helium hydride ion to within chemical accuracy.[13]
- Quantum approximate optimization algorithm (QAOA). Proposed in 2014, it looks for good approximate answers to combinatorial optimization problems, and its answers improve as the circuit gets deeper.[14] The Department of Energy lists optimization as another area where quantum computers may do well.[15]
Linear algebra and its caveats
The HHL algorithm, published in 2009, works on large sparse systems of linear equations, and for one specific task its authors report an exponential improvement over the best classical algorithm. The catch is that it does not output the full solution. It estimates one number derived from the solution.[16] Caveats like this are why claims of quantum speed-up need careful reading, a point taken up in the quantum advantage debate.
Read next
Next in the crash course
Complexity classes explained: P, NP, BQP and beyond
A plain guide to P, NP, NP-complete, NP-hard, BPP and BQP: what each class means, how they relate, and which questions about them are still open.
Questions readers ask
Does a quantum computer speed up every calculation?
No. Speed-ups come from specific algorithms. Shor's algorithm factors numbers in a number of steps that grows only polynomially with their size, a problem thought to be hard for ordinary computers; Grover's gives only a square-root speed-up for search; and the Department of Energy describes today's machines as small, noisy prototypes.[2][7][3][6]
Will Grover's algorithm break AES encryption?
NIST says Grover's speed-up does not make symmetric cryptography obsolete; doubling the key size would be enough to keep it secure.[12]
What is a hybrid quantum algorithm?
One that splits the work between a quantum processor and a conventional computer, as the variational quantum eigensolver does, so the quantum part needs to stay coherent for less time.[5]
Sources
· 16 claims from 7 publishers
Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.
- [1]
Grover's search paper describes adjusting the phases of operations so that successful computations reinforce each other while others interfere. reportedas of 1996-11-19
- A fast quantum mechanical algorithm for database search (arXiv:quant-ph/9605043) · arXiv (Proceedings of STOC 1996) · Secondary source · 1996-05-29 (retrieved 2026-11-21)
- [2]
Shor's algorithms take a number of steps that grows only polynomially with the input size, such as the number of digits of the integer to be factored. reportedas of 1996-01-25
- Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer (arXiv:quant-ph/9508027) · arXiv (SIAM Journal on Computing 26, 1997) · Secondary source · 1995-08-30 (retrieved 2026-11-21)
- [3]
For an unsorted list of N items, a classical algorithm needs to check at least N/2 items to find a target with 50% probability, while Grover's quantum algorithm needs on the order of the square root of N steps. reportedas of 1996-11-19
- A fast quantum mechanical algorithm for database search (arXiv:quant-ph/9605043) · arXiv (Proceedings of STOC 1996) · Secondary source · 1996-05-29 (retrieved 2026-11-21)
- A fast quantum mechanical algorithm for database search (arXiv:quant-ph/9605043) · arXiv (Proceedings of STOC 1996) · Secondary source · 1996-05-29 (retrieved 2026-11-21)
- [4]
The Department of Energy says researchers expect quantum computers to be particularly good at calculating properties of inherently quantum systems, such as molecules used as chemical catalysts. confirmedas of 2026-08-24
- DOE Explains...Quantum Computing · US Department of Energy, Office of Science · Primary source (retrieved 2026-11-21)
- DOE Explains...Quantum Computing · US Department of Energy, Office of Science · Primary source (retrieved 2026-11-21)
- [5]
The variational quantum eigensolver, demonstrated in 2013, splits the work between a small quantum processor and a conventional computer, which greatly reduces how long the quantum hardware must stay coherent. reportedas of 2013-04-10
- A variational eigenvalue solver on a quantum processor (arXiv:1304.3061) · arXiv (Nature Communications 5, 2014) · Secondary source · 2013-04-10 (retrieved 2026-11-21)
- A variational eigenvalue solver on a quantum processor (arXiv:1304.3061) · arXiv (Nature Communications 5, 2014) · Secondary source · 2013-04-10 (retrieved 2026-11-21)
- [6]
As of August 2026 the Department of Energy describes today's quantum computers as small, noisy prototypes. confirmedas of 2026-08-24
- DOE Explains...Quantum Computing · US Department of Energy, Office of Science · Primary source (retrieved 2026-11-21)
- [7]
Shor's algorithms solve factoring integers and finding discrete logarithms, problems thought to be hard for classical computers and used as the basis of several cryptosystems, efficiently on a hypothetical quantum computer. reportedas of 1996-01-25
- Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer (arXiv:quant-ph/9508027) · arXiv (SIAM Journal on Computing 26, 1997) · Secondary source · 1995-08-30 (retrieved 2026-11-21)
- Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer (arXiv:quant-ph/9508027) · arXiv (SIAM Journal on Computing 26, 1997) · Secondary source · 1995-08-30 (retrieved 2026-11-21)
- [8]
Grover's algorithm is within a small constant factor of the fastest possible quantum algorithm for this search problem. reportedas of 1996-11-19
- A fast quantum mechanical algorithm for database search (arXiv:quant-ph/9605043) · arXiv (Proceedings of STOC 1996) · Secondary source · 1996-05-29 (retrieved 2026-11-21)
- [9]
Shor's factoring result was first published in 1994, at the 35th Annual Symposium on Foundations of Computer Science. confirmedas of 2016-04-28
- Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer (arXiv:quant-ph/9508027) · arXiv (SIAM Journal on Computing 26, 1997) · Secondary source · 1995-08-30 (retrieved 2026-11-21)
- Report on Post-Quantum Cryptography (NISTIR 8105) · NIST · Primary source · 2016-04-28 (retrieved 2026-11-21)
- [10]
NIST's 2016 report on post-quantum cryptography says a large-scale quantum computer would make RSA, elliptic-curve and finite-field public-key schemes no longer secure, because Shor's algorithm efficiently solves the problems they rely on. confirmedas of 2016-04-28
- Report on Post-Quantum Cryptography (NISTIR 8105) · NIST · Primary source · 2016-04-28 (retrieved 2026-11-21)
- Report on Post-Quantum Cryptography (NISTIR 8105) · NIST · Primary source · 2016-04-28 (retrieved 2026-11-21)
- [11]
Grover's database-search algorithm was first presented at the ACM Symposium on the Theory of Computing (STOC) in 1996. reportedas of 1996-11-19
- A fast quantum mechanical algorithm for database search (arXiv:quant-ph/9605043) · arXiv (Proceedings of STOC 1996) · Secondary source · 1996-05-29 (retrieved 2026-11-21)
- [12]
NIST says Grover's quadratic speed-up does not make symmetric cryptography obsolete but may require larger keys, and that doubling the key size would be enough to preserve security if the algorithm ever becomes practically relevant. confirmedas of 2016-04-28
- Report on Post-Quantum Cryptography (NISTIR 8105) · NIST · Primary source · 2016-04-28 (retrieved 2026-11-21)
- Report on Post-Quantum Cryptography (NISTIR 8105) · NIST · Primary source · 2016-04-28 (retrieved 2026-11-21)
- [13]
The first variational eigensolver experiment calculated the ground-state energy of the helium hydride ion (HeH+) to within chemical accuracy. reportedas of 2013-04-10
- A variational eigenvalue solver on a quantum processor (arXiv:1304.3061) · arXiv (Nature Communications 5, 2014) · Secondary source · 2013-04-10 (retrieved 2026-11-21)
- [14]
The quantum approximate optimization algorithm (QAOA), proposed in 2014, produces approximate solutions to combinatorial optimization problems, with quality that improves as a depth parameter p increases. reportedas of 2014-11-14
- A quantum approximate optimization algorithm (arXiv:1411.4028) · arXiv · Secondary source · 2014-11-14 (retrieved 2026-11-21)
- A quantum approximate optimization algorithm (arXiv:1411.4028) · arXiv · Secondary source · 2014-11-14 (retrieved 2026-11-21)
- [15]
The Department of Energy says quantum computers may also be especially good at optimization problems, which involve choosing the best option from a huge range. confirmedas of 2026-08-24
- DOE Explains...Quantum Computing · US Department of Energy, Office of Science · Primary source (retrieved 2026-11-21)
- [16]
The 2008 HHL algorithm estimates a quantity derived from the solution of a sparse system of linear equations in time that grows with the logarithm of the system size, an exponential improvement over the best classical algorithm for that task, but it does not output the full solution vector itself. reportedas of 2009-09-30
- Quantum algorithm for solving linear systems of equations (arXiv:0811.3171) · arXiv (Physical Review Letters 103, 2009) · Secondary source · 2008-11-19 (retrieved 2026-11-21)
- Quantum algorithm for solving linear systems of equations (arXiv:0811.3171) · arXiv (Physical Review Letters 103, 2009) · Secondary source · 2008-11-19 (retrieved 2026-11-21)
Revision history (1)
- Page created.
Created Nov 21, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: Jul 12, 2027.
Cite this page
"Quantum algorithms explained: Shor, Grover and quantum simulation." ContentLora, updated Nov 21, 2026. https://contentlora.com/explain/quantum-algorithms-explained
Spotted an error? Suggest a correction or emailcorrections@contentlora.com.