← Latest papers
⚛️ quantum physics

Formally verified harness for Shor's order finding algorithm with O(n2+ϵ)O(n^{2+\epsilon}) gate cost

This paper presents a formally verified harness that ingests recursive circuit design policies from external sources, such as AI agents, to automatically generate machine-checked proofs of mathematical correctness and O(n2+ϵ)O(n^{2+\epsilon}) gate cost scaling for Shor's order finding algorithm, thereby enabling an open challenge for discovering more efficient quantum factoring circuits with guaranteed correctness.

Original author: Anirudh Suresh, Joshua M. Courtney, Runzhou Tao, Yudong Cao

Published 2026-11-17
📖 8 min read🧠 Deep dive

Original author: Anirudh Suresh, Joshua M. Courtney, Runzhou Tao, Yudong Cao

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). ✨ This is an AI-generated explanation of the paper below. It is not written or endorsed by the author. For technical accuracy, refer to the original paper. Read full disclaimer

In the landscape of modern computing, there is a fundamental tension between the speed of calculation and the security of secrets. For decades, the safety of digital communication has relied on a mathematical lock: the difficulty of breaking a large number down into its two prime building blocks. While classical computers struggle with this task, taking thousands of years to crack a single code, a theoretical machine built on the laws of quantum physics could solve it in a fraction of a second. This potential threat has driven scientists to refine the blueprint for such a machine, specifically an algorithm known as Shor's algorithm. The challenge has never been whether the algorithm works in theory, but how to build the physical machinery to run it efficiently. The bottleneck lies in the arithmetic: the specific steps required to multiply and divide numbers within the quantum system. For years, the most efficient known methods for these steps required a number of operations that grew so rapidly with the size of the number that even the most powerful future computers might not have enough resources to perform the task.

A team of researchers has now introduced a new framework designed to navigate this complex design space, offering a way to find faster, more efficient circuits while guaranteeing that the math remains correct. They call their creation ForShor, a formally verified harness that acts as both a referee and a builder. Instead of asking scientists to manually construct every possible variation of the quantum circuit—a task that is prone to human error and impossible to check thoroughly—they have built a system where researchers can submit a set of rules, or a "policy," that describes how the multiplication should be broken down. The system then automatically checks these rules against a rigorous mathematical standard. If the rules pass, the system generates a complete, verified quantum program and calculates exactly how many physical components, known as gates, would be needed to run it. This approach allows for an open search for better designs, where human experts and artificial intelligence agents can compete to find the most efficient path, all while the system ensures that the resulting circuit is mathematically sound and ready for real-world resource estimation.

The core of the problem lies in how the algorithm handles multiplication. To factor a large number, the quantum computer must perform a massive series of multiplications. The researchers focused on a specific technique called recursive Toom-Cook multiplication, which works like a sophisticated form of long division. Instead of multiplying two large numbers directly, the method splits them into smaller chunks, multiplies those chunks, and then recombines the results. The efficiency of this process depends entirely on how the chunks are divided and how the results are reassembled. There are countless ways to arrange these steps, creating a vast design space. The researchers found that while an exact mathematical method exists to find the absolute best arrangement, it is computationally impossible to run for the sizes of numbers used in modern cryptography. The number of possibilities is so large that even with the fastest supercomputers, checking every single option would take longer than the age of the universe.

To solve this, the team created a system that separates the creative work of designing the circuit from the tedious work of verifying it. A participant in their challenge submits a "policy," which is essentially a set of instructions telling the computer how to split the numbers and what operations to perform at each step. The system then checks if these instructions follow a strict set of logical rules. These rules ensure that the steps are reversible, that no information is lost, and that the final result is mathematically equivalent to the intended multiplication. If the policy passes this check, the system automatically constructs the full quantum circuit and calculates its resource cost. This process is formalized in a way that leaves no room for doubt; the system proves that any valid policy will produce a correct result, regardless of who designed it or how complex the design is.

The results of this approach are significant. By allowing the search for better designs to continue without the fear of introducing errors, the researchers have demonstrated that it is possible to reduce the number of operations required for Shor's algorithm. Their analysis shows that with the right design choices, the number of operations can scale much more slowly than previously thought, moving from a cubic growth rate to something closer to a quadratic one. This means that for very large numbers, the new method could require far fewer resources than the standard approaches. However, the researchers are careful to note that while the theoretical improvements are substantial, the current best designs still require a number of physical components that is far beyond what today's technology can provide. For a number as large as those used in current encryption, the system estimates that the most efficient known design would still need over a trillion specific operations, known as T-gates.

The project also highlights a new way of doing science in the age of artificial intelligence. The framework is designed as an open challenge, inviting both human researchers and AI agents to submit their own designs. The system acts as a neutral judge, accepting any submission that meets the mathematical criteria and rejecting those that do not. This creates a safe environment for innovation, where the risk of a flawed design is eliminated by the machine-checked verification. The researchers found that even within a restricted set of design choices, finding the optimal solution is incredibly difficult. They tested their system with a specific example involving a number with 2048 bits, a size commonly used in encryption. The system confirmed that while an exact optimal solution exists in theory, finding it through brute force is impossible. Instead, the system allows for heuristic searches, where intelligent agents can explore the design space and propose better solutions that are then instantly verified.

One of the key findings is that the efficiency of the algorithm depends heavily on the size of the number being factored. The researchers discovered that the best way to split the numbers changes as the numbers get larger. A design that works well for a small number might be inefficient for a larger one. Their system can handle this by allowing different splitting strategies at different stages of the calculation. This flexibility is crucial for pushing the limits of what is possible. The team compared their results with previous methods and found that their approach offers a clear advantage in terms of the number of operations required, but only for numbers that are significantly larger than those currently in use. For the standard 2048-bit numbers, the improvement is present but not yet large enough to make the task feasible with near-term technology.

The work also bridges the gap between abstract mathematical proofs and practical engineering. The system takes the verified mathematical description of the circuit and translates it into a format that can be used by software tools designed to estimate the physical resources needed. This translation is a critical step, as it allows researchers to see exactly how many qubits, or quantum bits, and how many error-correction components would be required to run the algorithm on a real machine. The researchers used this pipeline to generate detailed estimates for various scenarios, confirming that the theoretical improvements hold up when translated into concrete resource counts. They found that the number of operations grows in a predictable way, following the mathematical patterns they had proven.

Despite the progress, the researchers acknowledge that there is still much work to be done. The current estimates are based on idealized models of the quantum computer, and real-world hardware will introduce additional challenges, such as noise and the need for error correction. The system does not yet account for the physical layout of the machine or the time it takes to move information between different parts of the processor. These are the next frontiers for the field. However, the ability to formally verify the correctness of the algorithm while simultaneously searching for the most efficient design is a major step forward. It provides a solid foundation upon which future improvements can be built, ensuring that every new idea is tested against the highest standards of mathematical rigor.

The project serves as a proof of concept for a new era of quantum software engineering. By combining formal verification with open, automated search, the researchers have created a tool that can handle the complexity of quantum algorithms in a way that was previously impossible. This approach not only accelerates the search for better algorithms but also builds trust in the results, as every claim is backed by a machine-checked proof. As the field of quantum computing continues to evolve, tools like this will be essential for navigating the vast design space and turning theoretical possibilities into practical realities. The researchers have made their framework available to the public, inviting the global community to contribute to the search for the most efficient way to factor large numbers, a task that remains one of the most important challenges in the field.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →