# Discovering formally verified quantum programs with AI

Quantum.world

> A Lean library and LLM agent loop let teams synthesize formally verified quantum programs with cost certificates, shifting algorithm discovery from unverified heuristics to checkable code.

**arXiv**: 2611.09822 · Preprint · not peer-reviewed

**Published**: 2026-11-06

**Authors**: Sergey Shirobokov, Ben Jaderberg, Katerina Hristova, George Tsoukalas, Johannes Bausch, Eric Wieser, Francisco J. H. Heras, Nicholas C. Rubin, Guang Hao Low, Sébastien Racanière, Nenad Tomašev, Lei M. Zhang, James Watson, Tanuj Khattar, Aws Albarghouthi, Stavan Jain, Harun Khan, Leopoldo Sarra, Andrew W. Senior, Michael Broughton, Hussain Masoom, Sergio Boixo, Ryan Babbush, Swarat Chaudhuri, Pushmeet Kohli

## In plain words

Quantum algorithms are hard to validate because classical computers can only test them on small or restricted instances, so AI-driven circuit search has been confined to classically simulable regimes.

## AI summary

## Overview

**Research area:** Quantum computing (quantum algorithm discovery), formal verification (Lean theorem prover, quantum Hoare logic), and AI-for-science (LLM agent teams).

**Technical level:** Advanced. The paper assumes familiarity with quantum circuits, fault-tolerant resource accounting (T gates, logical qubits), and interactive theorem proving, though its high-level argument is accessible.

**Scope:** The paper describes a Lean-based verification library for quantum programs plus a multi-agent LLM workflow that discovers new quantum algorithms with machine-checked proofs of correctness and cost, applied to five problems spanning search, arithmetic, and large-scale physics/chemistry simulation.

## What This Paper Is About

Quantum algorithms are hard to validate because classical computers can only test them on small or restricted instances, so AI-driven circuit search has been confined to classically simulable regimes. The authors instead let LLM agents propose programs that are checked by formal mathematical proof rather than by running them, so discovery can reach algorithms with thousands of qubits that no existing machine can test. The goal is to show that this combination produces genuinely better algorithms, not just correct ones.

## Key Contributions

1. **A Lean library for quantum programs.** The authors build a verification and resource-counting library in Lean (on top of Mathlib and Physlib's Lean-QuantumInfo) that combines a classical-quantum programming language, a quantum Hoare logic for correctness proofs, and proofs of resource bounds, including the spacetime cost Q·𝒯 (number of qubits Q times number of T gates 𝒯).
2. **A multi-agent discovery workflow.** Heterogeneous teams of LLM agents iterate against a frozen problem specification, sharing results through a wiki (best verified solutions, reusable lemmas, dead ends) and scheduled cross-team conferences for unverified proposals and critique.
3. **Tamper-proof verification.** Every submission is audited by an external Lean Comparator against the frozen specification, confirming that target theorems, definitions, and allowed axioms are unchanged, so agents cannot weaken theorems or add axioms to pass.
4. **Verified algorithmic improvements across five problems,** with reductions reported up to 290× on fixed-point arcsin, up to 1.41× on parallel Grover search, and 10.9×, 8.08× and 2.49× on three scientific simulations.

## Main Findings

- **Parallel Grover search:** Verified circuits match the strongest published baseline on the m = 1 and k = 1 boundaries and beat it in 100/121 grid points for finding one target (up to 1.22× fewer expected rounds) and in all 110/121 multi-target settings for finding all targets (up to 1.41×; the abstract quotes "up to 1.4×"). Settings were powers of two up to 1,024 for both m parallel queries and k marked targets.
- **Fixed-point arcsin:** For 25-bit input with error ≤ 1.25×10⁻⁷ over y ∈ [−1, 1], a two-stage search first used classically simulable "kickmix" circuits to reach 4.15×10⁵ spacetime cost (4,152 T gates on 100 qubits), then formal verification lifted that restriction to reach 3.70×10⁵ (3,698 T gates on 100 qubits), a 290× reduction versus the piecewise-polynomial baseline at >1.08×10⁸. A coefficient lookup component used 33% fewer gates, giving 11% lower overall cost.
- **Fusion stopping power:** For an α particle with 218 electrons among 216 fixed protons at error ε = 10⁻², the solution uses 4,374 logical qubits and costs 4.98×10¹⁴ versus a baseline of 5.42×10¹⁵ (built from 5,650 logical qubits), a 10.9× reduction. Quantum Fourier transforming electrons into real space to exploit Pauli exclusion cut walk steps 12.8× at 1.52× the T gates per step; caching total electron momentum in a 42-qubit register cut T gates per step by 10%.
- **Non-Born–Oppenheimer dynamics of C₂₃H₂₀N₃O:** With 47 nuclei and 187 electrons (5,616 system qubits) at t = 1 fs and ε = 10⁻², the verified solution costs 6.16×10¹⁴ versus a baseline of 4.98×10¹⁵, an 8.08× reduction, driven by measurement-based uncomputation, a Bernstein-polynomial 1/r routine, and hard-wired nuclear charges.
- **Cytochrome P450 Compound I:** For a 63-electron, 58-orbital active space with energies within Δ = 0.1 Ha of the ground state at 1 mHa root-mean-square error, the solution costs 4.37×10¹¹ versus a cumulative baseline of 1.09×10¹² on 481 logical qubits, a 2.49× reduction. A one-hot register replacing a 247-qubit table lookup accounts for over 95% of the per-step T-gate saving.
- **Collaboration mattered:** Averaged over the three scientific applications, 61% of cost reduction came from within-team ideas, 15% from the cross-team wiki, and 24% from conferences; the cross-team share ranged from 13% in stopping power to 63% in cytochrome P450. In non-Born–Oppenheimer dynamics the leading record changed teams seven times, and one stopping-power ancilla register was narrowed from 288 to 231 qubits across wiki records before a final 246-qubit version traded qubits for T gates.
- **Still far from hardware:** The authors state the end-to-end simulations demand far more resources than projected for the first fault-tolerant quantum computers.

## Methodology in Plain English

Researchers write a problem specification as a Lean file: a theorem saying what the program must compute, plus a theorem bounding its cost, with placeholders (`sorry`) for the missing program and proofs. They then launch agent teams with general optimization prompts rather than problem-specific hints. Agents fill in the placeholders, get errors from the Lean kernel, and iterate. Each team's design is up to the researcher, from a single agent to hierarchies targeting subroutines, using analytical derivation, simulation, and numerical optimization.

Because agents could cheat by editing definitions or adding axioms, an independent verifier checks each submission against the frozen specification. Solutions, reusable lemmas and notes on dead ends go to a shared wiki, and teams meet in scheduled conferences to argue about unproven ideas. An idea only counts once verified. Researchers review only the specification before a run, which is where human judgment is concentrated.

## Why This Matters

**Impact on research:** The work shifts human effort from manual circuit design and resource bookkeeping to problem specification and interpretation, and it shows formal proof can substitute for classical simulation as the validation signal in AI-driven algorithm search. Cost reductions are cumulative and machine-checked, which matters for asymptotic algorithms and thousand-qubit applications that cannot be tested.

**Real-world applications:**

- **Fusion energy:** Stopping power of α particles in warm-dense hydrogen underpins inertial-confinement fusion modeling, for which no classical method is both efficient and systematically improvable.
- **Photochemistry:** Non-Born–Oppenheimer dynamics of C₂₃H₂₀N₃O targets light-driven processes such as solar energy conversion, photocatalysis and biological photoreception, where classical-nuclei methods fail.
- **Drug metabolism:** Cytochrome P450 Compound I governs how most human medicines are broken down; its closely spaced spin states defeat approximate classical methods such as density functional theory.
- **Quantum arithmetic and state preparation:** Fixed-point arcsin is a subroutine for loading numbers into wavefunctions, used in algorithms including linear-system solvers.

**Industry relevance:** The work comes from Google DeepMind and Google Quantum AI and speaks directly to fault-tolerant roadmaps, where applications are estimated to need thousands of logical qubits and 10⁹ to 10¹⁵ logical operations, against roughly one million operations projected for early fault-tolerant processors.

## Future Directions

- Extending formal specifications to error-correcting codes, qubit routing and physical layout, so algorithms and fault-tolerant layouts can be co-designed before large-scale processors exist.
- Optimizing qubits and T gates unequally, since qubits are expected to be scarcer than gates on early machines, and possibly minimizing qubits times T depth for hardware where T gates run in parallel.
- Writing better specifications, since agents cannot optimize beyond them: the non-Born–Oppenheimer spec demands correctness on all input states including unphysical ones, and the cytochrome P450 spec fixes a factorization that excludes recent representation advances.
- Reaching early hardware, which the authors say still requires further orders-of-magnitude improvement; the Lean library, problem specifications and verified solutions are to be open sourced.

## Target Audience

Quantum algorithm researchers and compiler/resource-estimation specialists; formal verification and programming-languages researchers interested in quantum Hoare logic; AI-for-science groups studying LLM agent workflows and automated discovery; and computational chemists and plasma/fusion physicists who need to judge how close fault-tolerant quantum simulation is to practical relevance.

## Authors’ 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.…

[The full abstract on arXiv](https://arxiv.org/abs/2611.09822)

[Read the original paper](https://arxiv.org/abs/2611.09822)

## Related papers

- [A constructive solution to the $n$-representability problem](https://quantum.world/paper/a-constructive-solution-to-the-n-representability-problem-2610.20737) 2026-10-14 · quant-ph · Also by Nicholas C. Rubin
- [Verifying Quantum Programs Before Oracle Binding](https://quantum.world/paper/verifying-quantum-programs-before-oracle-binding-2611.36277) 2026-11-26 · quant-ph · Key terms of the title in common
- [Weight-Space Programming of Variational Quantum Circuits: Large Language Models Write Quantum Circuit Parameters Without an Optimizer](https://quantum.world/paper/weight-space-programming-of-variational-quantum-circuits-large-language-2611.11537) 2026-11-08 · quant-ph · Key terms of the title in common
- [Secure Information Flow in Quantum Programs](https://quantum.world/paper/secure-information-flow-in-quantum-programs-2611.14147) 2026-11-10 · quant-ph · Key terms of the title in common
- [Rule-based hardware-configurable static analysis for quantum programs](https://quantum.world/paper/rule-based-hardware-configurable-static-analysis-for-quantum-programs-2611.01995) 2026-11-01 · quant-ph · Key terms of the title in common

---

Canonical: https://quantum.world/paper/discovering-formally-verified-quantum-programs-with-ai-2611.09822
