Explainer18 min read20 sources
Formally verified quantum algorithms from AI agents: what DeepMind's Lean proofs check
Google DeepMind and Google Quantum AI report AI agent teams that wrote cheaper quantum programs with Lean proofs. What Lean checked, the costs, and what stays open.
Researchers at Google DeepMind and Google Quantum AI set teams of AI agents, run on models their paper calls Gemini 4 Carbon, to write quantum programs together with Lean proofs about them. For each of five problems, the researchers first wrote a formal specification in Lean, a language in which proofs are checked by computer, and the agents filled in the program, its claimed cost and the proofs. For each accepted solution, Lean checked two theorems: that the compiled circuit does what the specification demands, for example simulating a fusion-relevant system to within a stated error, and that its cost is no more than the number claimed. A second tool, Lean's Comparator, checked that the agents had not changed the theorems, the definitions behind them or the allowed axioms. On that basis the preprint, Discovering formally verified quantum programs with AI1, reports a cost cut of more than 290 times for one arithmetic routine, and of 11.8, 8.22 and 2.49 times for simulations relevant to fusion, photochemistry and drug metabolism.
What is not established matters as much. A Lean proof here covers the program against its specification, and the cost under the paper's cost model. It does not show that a specification asks the right physics question, that the cost model matches what real fault-tolerant hardware will charge, or that the baselines are the strongest available. The baseline numbers are the authors' own calculations from published papers, made outside Lean. When we looked on 25 November, we found no public report from anyone outside the team who had re-run the checks, and the preprint had not been peer reviewed. The library and specifications were on GitHub from 17 November; the solutions followed on 23 November.
Below: what was published and when, key terms, how the agent teams worked, what Lean checked, the reported costs, why news reports disagree, how to check the code yourself, and what stays open. Earlier posts cover how to check a Lean proof that comes with a paper and how to report which AI model you used. Every source was checked on 25 November 2026, between 08:30 and 09:00 UTC.
What did Google DeepMind and Google Quantum AI publish?#
The preprint has 25 authors, from Google DeepMind and Google Quantum AI. Three of them "performed this work as research consultants on assignment at Google", and the corresponding authors are Sergey Shirobokov and Ben Jaderberg.2 arXiv's submission history shows three versions: the first on Friday 6 November 2026 at 18:08 UTC, a second on 9 November at 18:55 UTC and a third on 16 November at 18:30 UTC.1
On 23 November Google DeepMind published a blog post by Shirobokov, Jaderberg and Ryan Babbush, Finding faster quantum algorithms with agents and formal verification5. It says: "we used teams of Gemini 4 agents to improve well-known quantum algorithms, creating highly efficient quantum circuits." It also announces that the team is "open-sourcing our Lean library, problem specifications, and verified solutions on GitHub."
The five problems are parallel Grover search, a classic method for finding marked items in a list; computing arcsin, a routine used to load numbers into quantum states; the stopping power of hydrogen fuel in inertial-confinement fusion; the motion of electrons and nuclei together in a 47-atom molecule, relevant to light-driven chemistry; and energy levels of Compound I, a short-lived intermediate of the cytochrome P450 enzymes, which break down most human medicines.2
Key terms#
- Quantum circuit and quantum program: a circuit is a sequence of operations, called gates, on qubits. The paper's programs add classical control: measurements partway through, branches and loops.
- Logical qubit: an error-corrected qubit, built from many physical qubits.
- T gate and Toffoli gate: the T gate is a basic operation that is expensive on error-corrected machines; the paper counts T gates "which are costly in error-corrected quantum computers." A Toffoli gate is priced at four T gates.2
- Spacetime cost Q·T: the paper's main cost measure, the number of logical qubits Q times the number of T gates. For Grover search the cost is instead the expected number of rounds of queries to the list.
- Specification: a Lean file that states what a solution must achieve, a correctness theorem and a cost theorem, with blanks left for the program and the proofs.
- Quantum Hoare logic: rules for proving what a program does, using triples of precondition, program and postcondition. In the paper's words, triples "state that all executions of a program starting in a state satisfying a specified precondition end in a state satisfying a chosen postcondition." The library adapts the version for programs with classical and quantum variables by Yuan Feng and Mingsheng Ying15.
- Lean, sorry and the kernel: Lean is a programming language and theorem prover; its kernel is the small program that checks each proof.
sorryis "Lean’s placeholder for an unfilled definition or proof".2 - Comparator: a tool from the Lean developers that checks a submitted solution against a separately written challenge file, in a sandbox.
- Kickmix: "a restricted gate set" whose circuits an ordinary computer can test quickly, used in the first stage of the arcsin search.2
How did the AI agents work?#
The division of work, as the paper describes it: researchers wrote each specification and then "launch independent teams of LLM agents with high-level optimization prompts rather than problem-specific ideas". Each researcher chose the agent framework, models, prompts and division of labour. Setups ranged from one agent revising one candidate to hierarchies with separate agents for subroutines, error analysis and Lean proofs. Seven teams took part, by the caption of the paper's Figure 5.2
On the model, the paper says one thing: "All large-scale experimental runs of autonomous discovery were performed using Gemini 4 Carbon models." It gives no version string or settings, and does not describe each team's framework and prompts in detail. The authors also write that "researchers put their domain knowledge, discussion, and design into the problem specification itself rather than seeding domain knowledge or steering the research while underway".2
Teams shared results in two ways. A version-controlled wiki held each problem's best checked solution, reusable Lean files and reviewed notes on ideas marked verified, promising or dead ends. A new solution entered the wiki only after the same automatic check and, by default, a cost gain of at least 5%. Every four hours, teams met in a forum the paper calls a conference, where "statements and cost projections posted in a conference carry no weight until independently verified and published to the wiki."2
The paper prints one exchange from the fusion problem. One team re-checked another team's wiki record and proposed shrinking a subroutine from 1,098 Toffoli gates to 109, marked "UNVERIFIED, Lean proof in progress". A third team asked how it would be proved and, in the next session, pointed out where the proof plan would break and how to avoid it. The combined change entered the wiki as a checked record 14.5% cheaper than the one before.2
The authors estimate where the gains came from. Averaged over the three science problems, 61% of the cost reduction came from ideas within a team, 15% from other teams' wiki entries or Lean files, and 24% from conferences. They add: "Credit is often hard to separate cleanly".2
What exactly did Lean check?#
The fusion specification, shown in the paper's Figure 2, has two theorems. The correctness theorem says that some operation W on the system and extra qubits approximates the system's time evolution to within an error of 0.01 for every physically allowed state of the electrons, returns the extra qubits to zero, and is exactly what the compiled program does. The cost theorem says the program uses no Toffoli gates as single steps, so each must be built from cheaper gates the proof also covers, and that its qubits times its T gates, over 500 runs, is at most a claimed number. The agents fill every sorry: the number of extra qubits, the circuit, the claimed cost and both proofs.2
Every submission was then replayed in a clean sandbox by an external verifier running Comparator. In the paper's words, a submission passes only if:
(i) all target theorem statements and every transitive definition they depend on match the specification; (ii) the compiled proof terms depend solely on standard Lean axioms (propext, Quot.sound, and Classical.choice), with no sorry or custom axioms; and (iii) the proved resource theorem reduces to the claimed closed-form cost.2
The authors explain why: agents "may exploit loopholes by weakening theorem statements, altering definitions, or adding axioms."2 The repository adds why both theorems are always checked together: "A cost bound on its own is met by a trivial program, so every configuration lists the *_correctness theorem."8
The published files show what the claimed costs look like. The arcsin specification leaves arcsinK25ConstCost as a blank;9 the solution fills it with 369800, the paper's 369,800 (100 qubits times 3,698 T gates).10 The fusion solution's constant is 229,357,900,876,653,900, the paper's total over all 500 runs, which averages 4.59 × 10^14 per run.11 For P450, the proof uses a bound on the lowest energy from a 3,000-determinant wavefunction, "whose energy is checked in Lean." For Grover search, Lean certifies a constant that bounds the expected number of query rounds for all large enough lists.2
The authors' conclusion from this set-up: "Researchers thus review only the specification before a run and can trust that any found and verified solution is a valid algorithm."2
How much cheaper are the AI-found quantum programs?#
| Problem | Application | Baseline Q·T | This work Q·T | Reduction | Logical qubits, baseline → this work |
|---|---|---|---|---|---|
| Fixed-point arcsin | State preparation | > 1.08 × 10^8 | 3.70 × 10^5 | > 290× | 245 → 100 |
| α + hydrogen stopping power | Fusion | 5.42 × 10^15 | 4.59 × 10^14 | 11.8× | 5,650 → 4,338 |
| C23H20N3O non-Born–Oppenheimer dynamics | Photochemistry | 4.98 × 10^15 | 6.06 × 10^14 | 8.22× | 6,198 → 6,033 |
| Cytochrome P450, ground and low-lying state energies | Drug metabolism | 1.09 × 10^12 | 4.37 × 10^11 | 2.49× | 481 → 333 |
For parallel Grover search, the cost is the expected number of query rounds. To find one marked item, the Lean-checked circuits match the best published method when there is one query per round or one marked item, and need up to 1.22 times fewer rounds in the other settings. To find all marked items, they need up to 2.57 times fewer.2
Arcsin. The 290-fold figure has two parts worth separating. The baseline is a 2018 design by Häner, Roetteler and Svore16, whose error, about 10^-6, is looser than the new target of 1.25 × 10^-7. The authors compute "a lower bound of the full circuit spacetime cost" for it, leaving some registers out, and note in a footnote that a more recent square-root circuit could cut that baseline's cost by up to three times. The search also ran in stages. Agents first searched kickmix circuits, which an ordinary computer can test, and reached 498,168. They then worked in the Lean library but still with kickmix-expressible gates, reaching 415,200. Only the last step used gates that are "hard to verify outside Lean", and it brought the cost "a further 11%" lower, to 369,800.2 By our arithmetic, the 415,200 circuit was already about 260 times below the baseline.
Fusion. The new circuit Fourier-transforms the electrons onto a grid in space, where it can use the Pauli exclusion principle: no more than two electrons of opposite spin share a grid point. That cuts the number of repeated steps by 12.8 times, at 1.42 times the T gates per step.2
Photochemistry and P450. For the 47-atom molecule, the main changes copy particle positions into spare qubits and clear them by measurement, compute 1/r without multiplication, and set nuclear charges with simple logic. For P450, most of the saving per step comes from giving each term its own qubit, a one-hot register, in place of table lookups; the paper notes that earlier work had found that idea "narrowly worse than the baseline because it needs more qubits".2
The scale still matters. The blog post says: "Running these algorithms in scientific simulations would still demand more computational resources than the first error-corrected quantum computers are likely to provide".5
Why do news reports give different numbers, model names and code status?#
Mostly because the preprint changed between versions, and each report's figures match one of them.
| Version 1, 6 November | Version 2, 9 November | Version 3, 16 November | |
|---|---|---|---|
| Model in the abstract | "large language model agents" | "Gemini 4 agents" | "Gemini 4 agents" |
| Model in the main text | none named | "Gemini 4 Carbon models" | "Gemini 4 Carbon models" |
| Fusion | 10.9×, 4,374 qubits | 10.9×, 4,374 qubits | 11.8×, 4,338 qubits |
| Photochemistry | 8.08× | 8.08× | 8.22× |
| Drug metabolism (P450) | 2.49× | 2.49× | 2.49× |
| Arcsin | > 290× | > 290× | > 290× |
| Grover, find all items | up to 1.41× | up to 2.55× | up to 2.57× |
| Code | to be released later | to be released later | GitHub address given |
The first two versions say: "Our Lean library will be open sourced shortly, together with the problem specifications and verified solutions discussed in this manuscript."3 The Quantum Insider, on 10 November, reported 10.9 times for fusion and 1.41 for parallel search, and that "The team said it plans to release its Lean library, problem specifications and verified solutions as open-source resources."18 Quantum Computing Report, the same day, gave 2.55 times and described "heterogeneous Gemini agent teams".19 A Quantum Zeitgeist article, also dated 10 November, wrote that "All the large-scale runs used Google’s Gemini 4 Carbon models" and that "the Lean code is not yet public".20
Each matches the paper as it stood in at least one version. The model name comes from the authors, from version 2 on,4 and the code was not yet public when these reports appeared.
Is the Lean code public, and can you check it yourself?#
Yes, as of 25 November. The repository google-deepmind/formal-quantum-computation6 was created on 14 November. The single commit on its main branch is dated 17 November 2026 and holds the library and the specifications. The solutions are on a separate discoveries branch, whose single commit is dated 23 November, the day of the blog post.13 The project pins Lean 4.35.0 with matching releases of Mathlib and Physlib, the community libraries for mathematics and physics. Software is under the Apache 2.0 licence, other material under CC-BY, and the README states: "This is not an official Google product."6
The discoveries README lists one lake comparator command per problem and says the proofs "can be checked (slowly)" with them. Its own table puts the largest solution, for Grover find-all, at 554,952 lines, and the fusion solution at 457,154 lines, with a Comparator run of 2 hours 27 minutes and about 232 GB of memory plus swap. The P450, photochemistry and fusion checks each need around 230 GB.7 Building a Lean project runs its code, so do it on an isolated machine; our guide to checking a Lean proof covers the steps.
The repository's automatic checks build the library and specifications on the main branch, and both runs on 17 November passed. No such run appears for the discoveries branch, and the Comparator runs behind the paper's results are the authors' own. At 08:35 UTC on 25 November, and again at 08:45 UTC, the repository had no issues or pull requests, and we found no public report of an outside rebuild.13 Its metadata file gives the review status as "self-assessed" and says each pull request gets "both AI code review and human maintainer review".12
The same file says who wrote what in the library itself: "Hand-written core definitions, quantum Hoare logic framework and Comparator specifications", alongside "Interactive AI coding agents" used for "library formalization, refactoring, and specification engineering, subject to human maintainer review".12 Judging by file names, neither branch holds the agent prompts, the wiki pages or the conference posts.
What does “formally verified” leave open for quantum algorithms?#
Whether the specification is the right one. The authors put it plainly: "Part of the challenge is for us to choose specifications well, as agents cannot optimize beyond them." To match its baseline, the photochemistry specification demands correctness even on input states that are not physically valid, and the P450 specification fixes one mathematical form of the molecule's energy, which "excludes the representation advances behind recent gains."2 The fusion specification costs the time evolution only; its file says it "does not target an estimate of the stopping power to a given relative accuracy".11 Specifications also had holes. The paper reports "loopholes in the specifications themselves (such as exploiting how Toffoli gates were counted without improving the circuit), which researchers and teams closed by revising the specification." The repository's history starts with a single commit, so earlier versions of the specifications, and the changes made to them, are not public.
Whether the cost model matches real hardware. Q·T models one family of designs: error-corrected qubits laid out on a flat grid (the planar surface code). The paper names two kinds of machine where real costs depart from it, those with many parallel sources of T gates and those with long-range connections or denser memory. It argues that because every science result lowers both qubits and T gates, "our improvements hold under any monotone weighting of logical space and non-Clifford-gate count". In the photochemistry circuit, about 3.3 million rotation angles are fixed in Lean by existence proofs; the paper says they are computable but "have not been computed at this degree", and that the same holds for the baseline. The circuits are far beyond today's quantum processors, which is why the team relied on proofs, and the authors write that "Our end-to-end simulations still demand far more resources than projected for the first fault-tolerant quantum computers".2
How the baselines were chosen. Every baseline figure is the authors' own calculation, set out in Appendices E to I, and none is in Lean. Some are made harder to beat on purpose. For P450 the best published cost is 2.26 × 10^12; the authors add later compilation improvements to bring the baseline down to 1.09 × 10^12, so against the published figure alone the factor would be about five, by our arithmetic. For photochemistry they note that the published baseline is only guaranteed to meet their error standard at about 0.041, "four times our target".2 Others rest on the authors' choices: the arcsin baseline is a lower bound for a looser target, and for Grover search the authors turn a published method that leaves some costs only in order-of-magnitude form into a concrete schedule of their own. The fusion baseline comes from a 2024 study17 whose authors include Nicholas Rubin, Tanuj Khattar and Ryan Babbush, who are also authors of the new preprint.
What else Lean relies on. A check assumes Lean's kernel, Mathlib, Physlib and the library's own definitions are sound. The library adapts Feng and Ying's logic with documented changes; the paper says: "We follow the source closely but not fully faithfully".2 Comparator's documentation14 lists its own assumptions, including a trustworthy challenge file and a working sandbox, and notes it is now part of Lean as lake comparator from version 4.35.0.
Review and reproduction. The arXiv page lists no journal reference, and no outside group has reported re-running the checks so far as we could find.
| Claim | Checked by | Still open |
|---|---|---|
| Each solution meets its correctness theorem | Lean's kernel, in the authors' Comparator runs | Whether the theorem asks the right scientific question |
| Each cost bound (Q·T, or query rounds for Grover) | The same Lean proofs | Whether Q·T matches cost on real hardware |
| Theorems, definitions and axioms unchanged | Comparator, run by the authors | An outside re-run; commands public since 23 November |
| Baseline costs | The authors' own calculations from published papers | Not machine-checked; the choice of baseline is the authors' |
| The library's logic matches Feng and Ying's | The authors, who document their changes | Outside review; the repository says "self-assessed" |
| Model and agent set-up | The authors' report only | Prompts, frameworks, logs and wiki are not published |
| The paper as a whole | arXiv preprint | Peer review |
What this means for a research record#
This paper already records several things well: a frozen specification for each problem, a public commit for the library and one for the solutions, and the exact Lean version. A researcher who uses AI agents for similar work can write down the rest at the time, with dates. Which model, as the provider names it, and in which version or settings. Which agent set-up each team used, with its prompts. Which commit of each specification each run worked against, and every revision of a specification after a loophole was found. Which results were checked by machine, with which tool versions, and which by people, such as the baselines, the choice of cost model and the reading of a specification against the physics. On Papex, an AI app can prepare a private draft of such a record, and the researcher reviews and signs it before anything is published, as the guide to AI apps describes. A record of this kind says who claims what, and when; it does not check the claim.
Sources#
- arXiv:2611.09822, Discovering formally verified quantum programs with AI, abstract page and submission history (arXiv; v1 6 November 2026, v2 9 November 2026, v3 16 November 2026), checked 25 November 2026 a b
- Sergey Shirobokov, Ben Jaderberg and 23 others, Discovering formally verified quantum programs with AI, version 3, PDF (arXiv, 16 November 2026), checked 25 November 2026 a b c d e f g h i j k l m n o p q r s t u v w
- Discovering formally verified quantum programs with AI, version 1, PDF (arXiv, 6 November 2026), checked 25 November 2026 ↩
- Discovering formally verified quantum programs with AI, version 2, PDF (arXiv, 9 November 2026), checked 25 November 2026 ↩
- Sergey Shirobokov, Ben Jaderberg and Ryan Babbush, Finding faster quantum algorithms with agents and formal verification (Google DeepMind, 23 November 2026), checked 25 November 2026 a b
- google-deepmind/formal-quantum-computation, README, lean-toolchain and lakefile on the main branch (GitHub, commit 489edc70 of 17 November 2026), checked 25 November 2026 a b
- QuantumComputationDiscoveries README, with Comparator commands and build statistics (GitHub, discoveries branch, commit a88de8ff of 23 November 2026), checked 25 November 2026 ↩
- Challenge configurations README, QuantumComputationSpecs/ChallengeJsons (GitHub, main branch), checked 25 November 2026 ↩
- Arcsin specification, QuantumComputationSpecs/Primitives/Arcsin.lean (GitHub, main branch), checked 25 November 2026 ↩
- Arcsin solution, QuantumComputationDiscoveries/Primitives/Arcsin.lean (GitHub, discoveries branch), checked 25 November 2026 ↩
- Stopping power solution, QuantumComputationDiscoveries/Algorithms/StoppingPower.lean (GitHub, discoveries branch), checked 25 November 2026 a b
- formalization.yaml, repository metadata on authorship, automation and review status (GitHub, main branch), checked 25 November 2026 a b
- google-deepmind/formal-quantum-computation, branches, commit dates, Actions runs and issues, read through the GitHub API (GitHub), checked 25 November 2026 at 08:35 and 08:45 UTC a b
- leanprover/comparator, README: a trustworthy judge for Lean proofs, with its assumptions and deprecation note (GitHub), checked 25 November 2026 ↩
- Yuan Feng and Mingsheng Ying, Quantum Hoare logic with classical variables, arXiv:2008.06812; ACM Transactions on Quantum Computing 2 (2021), checked 25 November 2026 ↩
- Thomas Häner, Martin Roetteler and Krysta M. Svore, Optimizing Quantum Circuits for Arithmetic, arXiv:1805.12445 (31 May 2018), checked 25 November 2026 ↩
- Nicholas C. Rubin and others, Quantum computation of stopping power for inertial fusion target design, arXiv:2308.12352; PNAS 121 (2024), checked 25 November 2026 ↩
- Matt Swayne, Google Researchers Use AI And Mathematical Proofs to Cut Quantum Computing Requirements (The Quantum Insider, 10 November 2026), checked 25 November 2026 ↩
- Google DeepMind and Google Quantum AI Use Lean 4 to Discover Formally Verified Quantum Algorithms (Quantum Computing Report, 10 November 2026), checked 25 November 2026 ↩
- Lean Quantum Algorithms: Google AI Cuts Cost Up To 290x (Quantum Zeitgeist, 10 November 2026), checked 25 November 2026 ↩