HyperAIHyperAI

Command Palette

Search for a command to run...

Discovering formally verified quantum programs with AI

Abstract

The timeline by which quantum computers can solve breakthrough problems in science depends on improved quantum algorithms as much as on better hardware. Such algorithmic advances are typically achieved through many years of expert human collaboration. In mathematics and computer science, large language models have accelerated progress through automated discovery loops. However, quantum algorithms can only be evaluated by classical computers on restricted or small instances. Here we demonstrate automated discovery of quantum programs beyond these regimes including order-of-magnitude improvements on scientific applications. To achieve this, we build a quantum program library in the Lean theorem prover in which Gemini 4 agents synthesize novel programs against formal problem specifications and verify their correctness and cost. Agent teams collaborate, sharing results and knowledge through wikis and discussing ideas at organized conferences. Our results improve on prior baselines for parallel search (up to 2.57×), quantum arithmetic (290×), and simulations relevant to fusion, photochemistry and drug-metabolism by 12×, 8× and 2.5× respectively. Combining human and artificial intelligence at scale, under the rigor of mathematical proof, lets researchers design algorithms that today's classical and quantum computers cannot test, shortening the path to practical quantum computation.

One-sentence Summary

Researchers at Google DeepMind and Google Quantum AI use Gemini 4 agents within the Lean theorem prover to synthesize and formally verify quantum programs, with agent teams collaborating through wikis and conferences; their approach yields up to 2.57×2.57\times2.57× improvements in parallel search, 290×290\times290× in quantum arithmetic, and 12×12\times12×, 8×8\times8×, and 2.5×2.5\times2.5× gains in simulations relevant to fusion, photochemistry, and drug metabolism, respectively, accelerating practical quantum computation.

Key Contributions

  • The paper presents an automated quantum algorithm discovery framework that combines a quantum program library in the Lean theorem prover with Gemini 4 agent teams, which synthesize candidate programs, verify correctness and cost against formal specifications, and share results through wikis and organized conferences.
  • This work demonstrates improved quantum subroutines over prior baselines, including up to a 2.57× reduction in expected oracle rounds for parallel Grover search and a 290× spacetime reduction for fixed-point arcsin.
  • The paper reports resource reductions of 11.8×, 8.22×, and 2.49× on simulations relevant to fusion, photochemistry, and drug metabolism, and shows that formal verification supports discovery on algorithms that cannot be fully tested by classical simulation.

Introduction

Quantum algorithm development is a critical bottleneck for useful fault-tolerant quantum computing. Applications such as fusion, photochemistry, and drug metabolism require large resource reductions before they can run on early hardware, but manual algorithm design and verification become difficult as circuits scale to hundreds or thousands of qubits. The authors combine formal verification with LLM agents to automate search and produce machine-checkable correctness proofs. They report up to a 2.57x reduction in expected oracle rounds for parallel Grover search, a 290x spacetime reduction for fixed-point arcsin, and 11.8x, 8.22x, and 2.49x reductions in simulations relevant to fusion, photochemistry, and drug metabolism. This shifts human effort toward writing faithful specifications and interpreting verified results while agent teams carry out cumulative proof search.

Dataset

Based on the provided excerpt, the dataset-related material is described through the code and artifact release:

  • Sources: The authors provide a public GitHub repository at https://github.com/google-deepmind/formal-quantum-computation.
  • Composition: The repository contains a Lean library, problem specifications, and verified solutions discussed in the manuscript.
  • Subset details: The excerpt does not describe separate dataset subsets, sizes, filtering rules, or source-specific statistics.
  • Processing and schema: The excerpt does not detail preprocessing, cropping, metadata construction, or formatting. It only states that the material includes formal problem specifications and verified solutions in Lean.
  • Use in the model: The excerpt does not specify training splits, mixture ratios, or model-training usage. It describes the release as a formal verification and problem specification artifact rather than a machine learning dataset.

Method

The authors implement a verification and resource-counting library within the Lean theorem prover to formalize quantum information objects and reason about quantum programs. This library integrates a classical-quantum programming language with a classical-quantum Hoare logic to establish program correctness and support resource counting. The language supports both classical operations, such as assignment and conditional branching, and core quantum operations, including unitary transformations, mid-program qubit measurement, and state reset. Correctness theorems are formulated as Hoare triples consisting of a precondition, a program, and a postcondition. These triples are proved backwards from the postcondition by computing the weakest preconditions for each program step. Alongside correctness, the library proves bounds on expected and worst-case resource costs, such as TTT-gate count and qubit requirements.

To pose a program discovery task, researchers write a problem specification as a Lean file that states the target correctness and cost theorems while leaving placeholders to be filled with a candidate program, its cost bound, and their proofs.

The multi-agent discovery architecture leverages this formal specification to launch independent teams of large language model agents. Rather than providing problem-specific ideas, researchers supply high-level optimization prompts. Agent teams then explore candidate algorithms and prove their correctness and cost against the independent verifier. The architecture prescribes no fixed internal team design, allowing researchers to choose setups ranging from a single iterating agent to hierarchical teams targeting individual subroutines.

Agent teams share progress through two primary channels. A wiki stores each problem's best verified solution, reusable Lean lemmas, and reviewed notes on promising ideas and dead ends, allowing newly launched teams to start from the best existing solution. Teams also meet in scheduled forum conferences to critique proposals and discuss unverified conjectures, which only count as results once verified. To prevent agents from exploiting loopholes by weakening theorem statements or altering definitions, an external verifier checks every submission against the frozen specification using the Lean Comparator. This ensures that all target theorems, underlying definitions, and allowed axioms remain unchanged, guaranteeing that any found and verified solution is a valid algorithm.

Experiment

The evaluation applies an automated quantum program discovery workflow to five applications: parallel unstructured search, fixed-point arcsin, inertial-confinement fusion stopping power, non-Born-Oppenheimer molecular dynamics, and cytochrome P450 phase estimation. Across these cases, discovered and Lean-verified circuits match or outperform published baselines by exploiting application-specific mechanisms such as coherent candidate-set superposition, real-space grids with Pauli exclusion, ancilla-based coordinate loading, Bernstein-polynomial interaction evaluation, and one-hot Hamiltonian encodings. The results also show that multi-agent collaboration through shared verified proofs, wiki records, and conference exchanges accounts for a substantial share of improvements, while formal verification helps filter flawed candidates and specification loopholes.

This work reports lower quantum resource costs than baseline across four scientific applications, with relative reductions ranging from about 2.5-fold to more than 290-fold. The largest relative improvement appears in state preparation and the smallest in cytochrome P450. In the collaboration analysis for the scientific applications, within-team ideas accounted for most of the average reduction, while cross-team channels contributed a substantial minority and were especially important in cytochrome P450. State preparation achieved the largest relative reduction in absolute cost, while cytochrome P450 had the smallest relative reduction among the reported applications. Within-team ideas contributed most of the average cost reduction across the three scientific applications studied, with cross-team contributions lowest in stopping power and highest in cytochrome P450, where they exceeded within-team gains.

The experiments evaluate quantum resource cost reductions across four scientific applications relative to baseline, with state preparation showing the largest relative improvement and cytochrome P450 the smallest. A collaboration analysis finds that within-team ideas account for most of the average cost reduction, while cross-team contributions provide a substantial minority and are especially important in cytochrome P450, where they exceed within-team gains. Among the three applications studied, cross-team contributions are lowest in stopping power and highest in cytochrome P450.


Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing

HyperAI Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp