Google Open-Sources Quantum Algorithm Verification Framework After AI Agents Slash Computational Costs
Google DeepMind has released the Lean 4 framework that its Gemini 4 agents used to discover and verify quantum algorithms, including one that reduced estimated resource requirements by 290 times.

Google DeepMind has made publicly available the Lean 4 framework that powered its Gemini 4 agents in discovering quantum algorithms, with one breakthrough reducing estimated computational costs by a factor of 290. The GitHub repository includes mathematical definitions, specifications, and verified solutions, though Google has not released the internal system that orchestrated the agents' collaborative work.
The release follows a research paper titled "Discovering Formally Verified Quantum Programs with AI," which Google posted to arXiv on November 6. The paper outlines how the company merged multi-agent algorithm discovery with machine-checked proofs to develop and validate quantum programs.
The agents used a theorem prover to check whether their quantum programs met predefined requirements for correctness and computational cost.
This verification approach mirrors Google's earlier work using Gemini 4 Carbon to validate encryption properties in Signal's protocol using Lean.
Inside the Lean 4 framework
Google constructed the framework by building on Lean 4 and extending the Mathlib and Physlib libraries to enable quantum programming and validate computational expenses. The same theorem prover supports code-oriented initiatives like Mistral's Leanstral.
The framework contains two primary components: QuantumComputation supplies the essential quantum programming utilities and mathematical foundations, while QuantumComputationSpecs establishes the problems assigned to the agents and the criteria their answers must satisfy.
The system accommodates both traditional control flow and quantum operations, employing quantum Hoare logic to demonstrate that programs execute as intended. Computational expense is determined by multiplying the count of logical qubits by the quantity of T gates, allowing the framework to quantify resource consumption for each algorithm.
Developers can compile the codebase through Lean's Lake build system using the command:
lake exe cache get lake build
Google has distributed the verified algorithms through a separate discoveries branch under the Apache 2.0 license. The company has indicated intentions to broaden its cost models to encompass classical computation and control flow in subsequent iterations.
How the agent teams coordinated
Separate groups of Gemini 4 Carbon agents tackled optimization challenges with predetermined mathematical parameters. The agents iteratively enhanced their algorithms based on feedback from Lean's verification system.
The most collaborative effort involved a non-Born-Oppenheimer photochemistry simulation, with as many as seven teams working in parallel.
The groups shared a collective wiki documenting verified findings and held virtual synchronization meetings every four hours to exchange updates and leverage each other's advances.
Stopping agents from gaming proofs
Since agents could alter files within their respective work areas, there existed potential for them to relax specifications or introduce unstated conditions merely to achieve successful proofs. To prevent this, submissions underwent validation in isolated sandboxes against unchanging specifications. Lean Comparator identified alterations to definitions and theorems while rejecting proofs that included placeholders or unapproved axioms.
This safeguard strategy parallels the methodology employed by Anthropic's Claude Code team, which depends on automated validation rather than human assessment to review AI-generated code. While Google has disclosed the formal verification libraries and findings, it has withheld the infrastructure managing the Gemini agents' coordination.
What the algorithms save
The most significant improvement emerged from a fixed-point arcsin algorithm, where projected resource expenses decreased by 290 times. The optimized circuit needs 100 logical qubits and 3,698 T gates, compared to the original design's 245 qubits and minimum 440,576 T gates. Initial enhancements originated from classical testing, with formal verification subsequently enabling more sophisticated circuit designs that delivered an additional 11% reduction in costs.
Photochemical simulation costs fell roughly eightfold, while a simulation involving cytochrome P450 saw a 2.5-fold improvement.
For an inertial confinement fusion simulation, the agents achieved an 11.8-fold decrease in projected expenses and reduced the logical qubit count from 5,650 to 4,338. These represent formally verified resource projections derived from mathematical analysis rather than measurements obtained from actual quantum hardware; current quantum computers lack the capability to execute scientific simulations of this complexity.
Developers can autonomously validate the released proofs by using the repository's fixed versions of Lean, Mathlib, and Physlib, with the verified algorithms accessible through a distinct branch. Recreating the discovery mechanism presents a different challenge, as Google's agent coordination infrastructure remains proprietary.
The framework's resource calculation methodology carries certain constraints. As mentioned in Google's research announcement, it presently does not fully incorporate classical computation and control flow—limitations the team intends to resolve in forthcoming updates.