Skip to content
ContentLora

    Tip: press / anywhere to search.

    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]

    Editor reviewedUpdated Explainer16 claims · 38% primaryQuantum computing, Computing, Mathematics research
    Reading level: 2 passages differ; the rest is the same for everyone.

    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.

    Next in the crash course

    More in Quantum computing

    Developing in AI & Computing

    Go deeper

    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. [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

    2. [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

    3. [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

    4. [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

    5. [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

    6. [6]

      As of August 2026 the Department of Energy describes today's quantum computers as small, noisy prototypes. confirmedas of 2026-08-24

    7. [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

    8. [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

    9. [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

    10. [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

    11. [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

    12. [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

    13. [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

    14. [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

    15. [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

    16. [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

    Revision history (1)
    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.