AI builds a quantum library, linking physics to its mathematics

An agentic AI system has autonomously formalized an entire undergraduate-level physics curriculum, correcting errors in a standard textbook while doing so. Researchers from Axiomatic AI, the Institut de Ciències Fotòniques, and Massachusetts Institute of Technology used the Lean 4 proof assistant to build a machine-checked library of finite-dimensional quantum mechanics, starting only with the postulates of quantum mechanics and the text of Nielsen & Chuang. The system formalized 505 of 509 items within the book’s scope and corrected 24 errors, demonstrating a new approach to verifying physics with AI. The researchers write.

AI Autoformalization of Finite-Dimensional Quantum Mechanics

The agentic AI system employed grounding linters to maintain consistency between formal mathematical statements and the original textbook content. These linters function as automated checks, ensuring the AI’s formalizations accurately reflect the physics described in the source material, a critical step beyond simple translation of equations. This approach addresses a key challenge in autoformalization; ensuring the mathematics genuinely captures the intended physical meaning, rather than merely creating a mathematically valid but physically meaningless representation.

The system’s foundation rests on six postulates of quantum mechanics, deliberately chosen to encompass the four foundational postulates presented in Nielsen & Chuang’s widely-used textbook on quantum mechanics. These postulates, covering Hilbert spaces, unitary evolution and composite systems, were not selected arbitrarily; reconstructions demonstrate their derivation from operational principles, and alterations to them result in physical inconsistencies, such as superluminal signalling. Frank H.L.

Agentic System Architecture Using Knowledge Graphs

The agentic AI system uses live knowledge graphs to coordinate its autonomous work, moving beyond simple translation of text into formal code. These graphs facilitate planning, writing, reviewing, and repairing a Lean 4 library focused on finite-dimensional quantum mechanics, allowing the AI to manage the complex task of autoformalization. This architecture differs from traditional approaches by enabling the system to not only generate equations but also verify their validity within a rigorously defined mathematical system.

The system could be applied to any field of physics with a core of formal postulates. A key element of this approach is the separation of physics from mathematics through a “postulate layer,” a small, human-checkable set of core principles. This layer ensures that the mathematical representation accurately reflects the underlying physics, distinguishing between a physical concept and its formalization. To their knowledge, this is the first physics library with such a feature.

During the formalization of the Nielsen & Chuang textbook, the agents operated without accessing external internet resources, relying solely on the book’s content and its internal model for knowledge, solutions and error detection. The system uses tools exposed by the Model Context Protocol (MCP), including a Lean language server that allows for compilation and inspection of proof states. This integration with Lean 4, a proof assistant, means that every definition, theorem, and proof is expressed as code, elaborating to a term in dependent type theory.

This success extended beyond the textbook itself; the same formalized library then underpinned the autonomous formalization of results from three separate research papers and 28 landmark theorems. J.M.T. initially proposed and executed the agentic formalization approach.

Error Correction & Research Theorem Formalization

Formal verification of the corrections made by the agentic AI system extended beyond simple identification of errors; the system distinguished between outright mistakes and ambiguities within the Nielsen & Chuang text itself. The AI categorized each identified issue as either an “Error”, a definitively false statement, or “Ambiguous”, a claim valid under some interpretations but failing under others, a nuance often missed by automated checkers.

This granular assessment is documented in the published work, providing a level of detail beyond a simple error count. The system’s ability to flag ambiguities demonstrates a capacity for contextual understanding, rather than merely pattern matching. For 24 identified errors, the system successfully generated Lean refutations, confirming the corrections within the formal system.

Further scrutiny revealed subtle errors in the treatment of angular momentum, as seen in Exercise 7.27, where the AI flagged an incorrect sign convention affecting multiple equations. The system also identified a missing normalisation factor in equations 7.141 and 7.142 (Exercise 7.36), a detail that would significantly impact quantitative results.

Postulate Layer Enforces Physics-Mathematics Separation

A newly constructed postulate layer enforces a clear separation between physics and mathematics within an autonomously formalized quantum mechanics library. The approach, detailed in recent work, establishes a machine-checked boundary of 280 lines of code that a human auditor must review to ensure correctness, rather than scrutinizing the mathematical representation of every derived concept. The system’s ability to define these primitives without external reference is notable; grounding linters, typically used to verify formal statements, had no pre-existing benchmarks against which to assess the initial definitions.

While a larger, pre-defined postulate layer could be created and audited by humans, the current implementation prioritizes autonomous growth and scalability. The organization of these knowledge graphs mirrors the topics within quantum information, providing a structured framework for the agentic system. The researchers believe this approach is trustworthy because of the limited size of the postulate layer, making human audit feasible and allowing the library to expand autonomously.

Semantic Challenges: Capturing Physical Meaning

Presenting a key hurdle in formalizing physics, the ability to discern intended meaning, rather than merely verifying mathematical correctness, is a critical capability of the system, as a formally verified statement can still misrepresent the original physical concept. Researchers identified three potential failure modes, with the first concerning whether a formalized statement accurately reflects the semantics of the concept it represents. A second failure mode involves formal correctness but logical weakness, where the formalized claim proves only a portion of the original or introduces unstated assumptions.

Every proposed addition to the growing library undergoes a rigorous three-step review process before integration, ensuring adherence to established standards and physical accuracy. Lean 4, the chosen proof assistant, confirms the completeness of each proof and its reliance solely on standard axioms.

Grounding linters then verify that all physics statements are constructed from the foundational postulates, while a panel of AI judges assesses faithfulness to the source material, physical meaning, lack of triviality and overall code quality. This parallelized approach uses a shared queue, allowing agents to interact with persistent sources of information according to their designated roles.

Scale Challenges: Parallel Agent Coordination

Scaling the autoformalization process beyond isolated proofs requires careful coordination between multiple AI agents, a task complicated by the potential for redundant effort and fragmentation of the resulting library. To address this, the system uses live knowledge graphs, enabling agents to concurrently query a shared information source and coordinate their work on the Chuang textbook’s content. These graphs aren’t static repositories; they are actively updated as agents formalize new concepts, preventing independent re-implementation of the same ideas and ensuring a cohesive, interconnected library.

The architecture employs a deterministic program to orchestrate parallel formalization of multiple items, assigning tasks to agents and managing revisions as they progress. This approach allows agents to work simultaneously on different parts of the book, significantly accelerating the overall formalization process.

Agents first extract items, classifying them as mathematics, physics, or non-formalizable and then construct an informal knowledge graph linking formalized concepts to existing declarations in Mathlib or the foundational postulates. This graph is a central hub, allowing agents to discover related work and build upon existing formalizations. A key challenge identified is ensuring consistency across agents working in parallel; the system must prevent the creation of formally unrelated pieces despite their semantic equivalence.

The researchers identified that without shared knowledge, agents might independently formalize the same concept, leading to redundancy and hindering the library’s overall coherence. “Agents working on different parts of the book may not see each other’s progress and may independently re-implement the same concept or lemma, fragmenting the library into formally unrelated pieces,” the paper explains.

The autonomous formalization workflow relies on a sequence of pull requests, proposed code changes planned and revised by each author agent, which are then integrated into the growing library. The system’s ability to manage these parallel contributions is important for achieving the scale necessary to formalize an entire textbook.

Grounding Linters Ensure Postulate-Based Formalization

Grounding linters operate as a critical component of the autoformalization process, enforcing adherence to a pre-defined set of postulates even as agents independently construct proofs. These linters do not simply verify existing mathematical structures; they actively reject physics statements that circumvent the foundational axioms, ensuring all derivations trace back to the established postulate layer. This approach necessitates keeping the core postulates deliberately concise, with the system using six standard postulates to cover the four found in Nielsen & Chuang’s treatment of quantum mechanics.

The system’s architecture allows for a degree of flexibility in defining foundational elements, but also highlights a trade-off between automation and human oversight. While agents initially defined primitives during formalization without a pre-existing reference, the researchers suggest these could be pre-defined, frozen and incorporated into the linters’ checks.

This would require a larger, auditable postulate layer, but could enhance consistency and reduce the need for extensive post-hoc verification. The formal knowledge graph, central to the system’s operation, organizes concepts into topics within quantum information, facilitating discovery and building upon existing formalizations. Formalising mathematics that would otherwise exist only in natural language or diagrams therefore sets a standard of rigour where no assumption is left implicit and no step is left as an exercise to the reader. This process is, however, tedious and demands highly specialised knowledge beyond the subject matter being formalised.

By ensuring statements adhere to established structures, the system lowers the barrier to entry for understanding the underlying logic. The statistics gathered at the end of the run reveal the scope of the formalized library, and the frozen postulates are available as files under AxQM/Postulates. The methodology developed is not limited to quantum information, and could be applied to other fields with axiomatic cores, such as thermodynamics, mechanics, optics, or control theory.

👉 More information
🗞 Autonomous formalisation of finite-dimensional quantum mechanics grounded in axiomatic foundations
✍️ Weichen Winston Yin, Jacob M. Taylor, Dirk R. Englund and Frank H. L. Koppens
🧠 ArXiv: https://arxiv.org/html/2612.02353v1

Stay current

See today’s quantum computing news on Quantum Zeitgeist for the latest breakthroughs in qubits, hardware, algorithms, and industry deals.

Avatar of Muhammad Rohail T.

Latest Posts by Muhammad Rohail T.: