Agentic AI for Discovering Fault-Tolerant Quantum Circuits

Aritra Lahiri, Florian MarquardtarXiv 2026 · arXiv

TL;DR

Researchers have developed "Agentic FunSearch," a system that uses Large Language Models (LLMs) as autonomous agents to discover fault-tolerant quantum circuits. By combining evolutionary program synthesis with a specialized circuit verifier, the AI successfully designed highly efficient circuits for logical state preparation, gates, and complex routines like code-switching, often outperforming previous human-designed and reinforcement-learning benchmarks.

What Problem Does This Paper Address?

Building a useful quantum computer requires Quantum Error Correction (QEC). Because individual physical qubits are incredibly fragile, we encode information into "logical qubits" spread across many physical ones. However, the circuits used to manipulate these logical qubits must themselves be fault-tolerant (FT). A single error in a gate shouldn't be allowed to spread and corrupt the entire logical state.

Designing these FT circuits is a massive headache. Traditionally, physicists design them by hand for specific codes, which is slow and doesn't scale. Recent automated attempts using Reinforcement Learning (RL) or SAT solvers have made progress but often struggle with larger code distances or complex logical operations. There is a need for a general, automated way to discover efficient FT circuits across the entire "quantum stack"—from preparing states to executing gates and switching between different types of codes.

Methods

The authors introduce a hybrid approach called Agentic FunSearch, building on the "FunSearch" paradigm originally developed by Google DeepMind.

  1. Evolutionary Program Synthesis: Instead of searching for a list of gates, the LLM writes Python programs that generate circuits. This allows the AI to discover general rules that work for entire families of codes (e.g., surface codes of any size) rather than just a single instance.
  2. The Agentic Loop: Unlike standard LLM generation, this is "agentic." The LLM (specifically GPT-6.1-sol) has access to a circuit verifier tool. It can write a proposal, test it, see the error report, and refine its code before submitting it to the evolutionary database.
  3. Island-Based Evolution: The system maintains several "islands" of programs. The best programs are periodically shared between islands to prevent the search from getting stuck in local optima.
  4. Scratchpad Memory: In each generation, the LLM writes "scratchpad notes"—natural language reflections on what worked and what didn't. these notes are passed to the next generation, acting as a form of long-term reasoning memory.
  5. Fault Verification: The verifier performs an exhaustive check of all possible single (and sometimes multiple) faults, ensuring the discovered circuits meet strict fault-tolerance criteria using "flag qubits" to detect errors.
FIG. 2: Overview of the agentic FunSearch method applied to quantum circuits. Left: the prompt, illustrated for a logical CNOT (CNOT) between two logical qubits encoded by the [[5, 1, 3]] perfect code (see Sec. III B). It starts with a natural-language description of the task, followed by a list of the target stabilizers, here the Choi state generators on all physical and reference qubits. These include the code stabilizers, labeled “checks”, and the stabilizers of the Bell pair between the logical and the reference qubits after applying the desired logical operation (here, CNOT), labeled “after CNOT”. Additionally, the prompt also specifies the qubit layout, including the locations of the data and ancilla qubits, the allowed couplings for two-qubit gates, the gate set, and a primer on the relevant physics and the fault tolerance requirement. Right: the hybrid agentic FunSearch loop. The LLM writes a Python program defining a circuit following our custom API. The verifier checks if the circuit achieves the target, and obtains the fault tolerance metrics. These metrics, along with the packed (maximizing parallel qubit utilization) circuit, are attached to each program as feedback. The program is then added to the island database, and ranked by these metrics (see Eq. (2)). The best programs from the islands, along with their feedback, are included in the prompt to the LLM in the subsequent generation. In each generation, we instruct the LLM to write scratchpad notes, which serve as memory and are appended to the next generation’s prompt. The best programs from each island migrate to the neighbouring islands periodically. The LLM also calls the verifier directly through tool calls, which lets it test its proposals before submitting its program in each generation. After some generations, we select the best program as the solution.

Datasets

The paper doesn't use a traditional training dataset. Instead, it evaluates the method against a "curated task list" of fundamental QEC challenges:

  • Logical State Preparation: For the [[5,1,3]] perfect code, Steane code, and rotated surface codes up to distance 9.
  • Logical Gates: Implementing operations like CNOT, Hadamard ($H$), and Phase ($S$) gates on various encoded blocks.
  • Logical Routines: High-level tasks like code-switching (moving a logical qubit from a Steane code to a Reed-Muller code) and code growth (increasing the distance of a surface code).

The results are benchmarked against existing state-of-the-art manual designs and RL-based discoveries.

Key Insights and Ideas

  • Tool-Use is Essential: The "aha moment" is that LLMs are much better at physics tasks when they can "think" by interacting with a simulator. The agentic loop allows the model to debug its own physical intuition.
  • Programs over Gate Lists: By evolving code, the AI discovered "multi-size" solutions. For example, it wrote a single Python function that correctly prepares surface codes for any distance $d$, effectively "learning" the underlying algorithm of the code.
  • Reasoning Tiers Matter: The authors found a massive performance gap between models. The "elite" tier (GPT-6.1-sol) was significantly more successful at finding records than the "base" tier (GPT-6-luna), particularly for non-CSS codes and complex routines.
  • Scratchpads Drive Innovation: The elite models wrote longer, more detailed scratchpad notes, which correlated with their ability to escape local minima in the fitness landscape.

Key Results

The AI consistently matched or beat human-designed benchmarks across the board.

  • State Preparation: For the [[5,1,3]] code, it found a circuit with a depth of 8, compared to the previous best of 12. For surface codes, it discovered "zero waste" circuits that maximize efficiency.
  • Logical Gates: It found a fault-tolerant logical CNOT for the [[5,1,3]] code with a depth of only 9, a massive improvement over the benchmark depth of 84.
  • Complex Routines: It successfully automated the discovery of circuits for code-switching and code growth, tasks that are notoriously difficult to design manually.
Table of results for logical-state preparation tasks
Table I shows the AI's performance on state preparation, highlighting improvements in circuit depth and gate counts (bold numbers).
Table of results for logical gate design tasks
Table II demonstrates the AI's success in designing logical gates, achieving zero "undecodable" errors in many complex scenarios.

Limitations and Future Work

  • Clifford Limit: The current work focuses on Clifford circuits (which can be simulated efficiently). Discovering non-Clifford gates (like the T-gate) would require a different, likely more computationally expensive, verification approach.
  • Noise Models: The study uses a standard depolarizing noise model. Future work could incorporate more realistic, hardware-specific noise (like biased noise or leakage).
  • Scalability of Verification: While the LLM scales well, the exhaustive verification of faults becomes computationally heavy as the code distance and circuit size grow very large.
  • Hardware Constraints: While the authors tested some specific layouts (like "hex" or "native"), further work could integrate even stricter real-world hardware connectivity constraints directly into the prompt.

Summary updated

Abstract

Scaling quantum computing toward practical quantum advantage is currently limited by the efficiency of circuits that operate on information encoded by quantum error-correcting codes. The full stack of quantum computing encompasses several tasks: preparation of logical code states, implementation of logical gates, logical routines on encoded qubits, etc. Yet, these circuits are largely designed by hand for individual cases, with some recent works incorporating machine learning for certain aspects. We formulate this problem as agentic evolutionary program synthesis, wherein a large language model, leveraging its pretraining knowledge and tool-use proficiency, and guided by a circuit verifier, evolves a program that defines a Clifford circuit for a wide range of curated tasks such as logical state preparation, logical gate design, and logical routines such as code-switching, code growth, etc. Our approach consistently finds fault-tolerant circuits for all of these tasks, each verified by an exhaustive check over faults.
BibTeX
@misc{lahiri2026agentic,
  author = {Aritra Lahiri and Florian Marquardt},
  title = {{Agentic AI for Discovering Fault-Tolerant Quantum Circuits}},
  year = {2026},
  eprint = {2611.18504},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.18504},
}
Figure