Paper commentary
Agentic AI for Discovering Fault-Tolerant Quantum Circuits
- Problem Fault-tolerant logical circuits are still designed largely by hand, and earlier automated methods cover few codes and rarely reach logical gates or routines.
- Method An LLM writes Python circuit programs inside an evolutionary island search, calls a verifier tool during generation, and is scored on silent, herald and waste metrics.
- Results On the native-layout rotated surface code, reached depth 6 at d=3 and depth 7 for d from 5 to 9, with zero silent events from the first generation.

FIG. 5 : The circuit for the Reed-Muller (RM) to Steane (S) switch, with all-to-all connectivity, and 16 ancillae. The dark-green boxes show random measurements, and the light-green box is a detector. The orange boxes show conditional Paulis, with their conditions beside them. We shade alternate layers grey and white. It readsq 7-q14 of the RM blockq 0-q14 in theXbasis, and moves the face q0-q6 to the fresh S blockq 15-q21.q 22-q37 are ancillae.
Original paper · CC BY 4.0 · Aritra Lahiri, Florian Marquardt · Agentic AI for Discovering Fault-Tolerant Quantum Circuits · Original paper figure · Extracted the figure area from page 17 of the original PDF.Why fault-tolerant circuits resist hand design
A logical circuit is built in layers: logical states are prepared, logical gates are implemented, and these pieces are combined into a logical routine. Each layer needs fault tolerance, because one fault at any location can snowball into an error that the code cannot undo. Stronger codes tolerate more faults, but they need more gates and therefore offer more places for faults, so the circuit objective and its fault tolerance must be balanced at once.
Designing each task, code and circuit by hand becomes impractical as circuits grow.
Automated approaches so far each cover part of the stack. Satisfiability solving produces gate- or depth-optimal state preparation circuits for small CSS codes, together with verification circuits. Logical gate methods have mostly been limited to small codes, and fault tolerance was either imposed through transversality restrictions or added afterwards.
The authors also state that reinforcement learning needs far more circuit simulations than their LLM-based method.
Representing targets as tableaux and Choi states
Circuits are checked in the stabilizer formalism. An n-qubit stabilizer state is the joint +1 eigenstate of n commuting Pauli operators, and each stabilizer is stored as a sign together with binary x and z vectors, so the full set forms an n by (2n+1) tableau. Because a state has many valid stabilizer sets, the verifier compares against a canonical tableau.
Targets are QEC codes [[n, k, d]], and the largest correctable Pauli weight is \( t=\lfloor (d-1)/2\rfloor \).
For logical state preparation, the target stabilizers are the n-k code stabilizers together with the k logical operators that fix the logical state. Gate design is reduced to state preparation by the channel-state duality: each logical qubit is paired with a reference qubit in a Bell state. The target then becomes the logical Choi state of the gate, generated by the code stabilizers and the mapped Bell-pair generators \( \bar U \bar X_j \bar U^\dagger \otimes X_{r_j} \) and \( \bar U \bar Z_j \bar U^\dagger \otimes Z_{r_j} \).
The reference qubits serve only as bookkeeping, remain isolated from the physical qubits, and receive no gates, so reaching this stabilizer state certifies the gate on every codeword.
How the agentic search loop operates
The search follows FunSearch: a pretrained LLM acts as a mutation operator over programs, and an evaluator scores each program. Each program is a Python function that builds a circuit through a custom API, and every search starts without seed programs. What makes the loop agentic is that the LLM can call the verifier before submitting, so it can test and amend a proposal within the same generation.
The prompt fixes the role, the task, the primer on the Choi construction and the fault tolerance requirement, and the qubit layout with the evaluated sizes. Each generation adds parent programs with their verifier reports, the scratchpad notes of the island and the recent errors, and asks for a program that differs from every parent.
Scored programs are stored in island databases, clustered by their score at the largest size and ranked by the scores at smaller sizes. Several islands run in parallel, and the best program of each island migrates to the next island at fixed intervals. Dynamic Clifford circuits, which allow mid-circuit measurements and Pauli feedforward, let the LLM place corrections for detected faults instead of discarding the shot.
The authors state that every discovered circuit satisfies the fault tolerance criterion across the tasks studied.
How the verifier scores faults
The verifier first simulates the circuit once with the random outcomes unforced and once for each random outcome forced in turn. A circuit is valid when every branch ends on the target tableau. For an invalid circuit the verifier still returns a graded match score, the mean of a tableau similarity and the fraction of branches whose signs agree.
The reduced weight of a residual is its minimum weight over its equivalents under the stabilizer group of the target, \( \mathrm{wt}_G(E_f)=\min_{G\in\mathcal{G}}\mathrm{wt}(E_f G) \). Enumerating the group is avoided by computing an extended syndrome against a chosen set R, which is built so that a zero syndrome means the residual lies in the group.
For state preparation the group is the stabilizer group of the target, while for gates it is generated by the code checks and R also includes the mapped logical operators. \[ R=\{g_m\}_{m=1}^{n-k}\cup\{\bar U\bar X_j\bar U^\dagger\}_{j=1}^{k}\cup\{\bar U\bar Z_j\bar U^\dagger\}_{j=1}^{k} \]
Heavy faults have a residual weight above min(1,t) on the data qubits. A heavy fault that flips no detector is a silent event, while one that flips detectors is heralded and can be discarded in postselection. Light faults whose detector pattern matches that of a heralded fault are counted as waste.
Logical state preparation results
The [[5,1,3]] code is non-CSS, so its generators mix X and Z Paulis and none is satisfied automatically by the initial product state. Because of this, the residuals are scored in full rather than with the simplification available for CSS codes. On all-to-all connectivity, the search found a notably shallower circuit than the RL agent of Ref.
[13] with the same number of two-qubit gates. Table I collects the state preparation results across the codes and connectivities discussed here.
The rotated surface code encodes one logical qubit in d^2 data qubits, and on the native layout the search ran jointly over d=3, 5, 7 and 9. Zero silent events appeared in the first generation at every distance, and five further generations reduced the depth. The final program branches on distance, giving depth 6 at d=3 and depth 7 at all other tested distances up to d=9.
For d≥5 the circuit resembles the measurement-based encoding of Ref. [44], measuring the X checks and applying conditional Z gates, while at d=3 it prepares the X checks unitarily as in the UEA variant. Z checks are measured in parallel as detectors for hook errors, so these events are heralded rather than left for a decoder. The authors report that the ME and UEA circuits show silent events already at order one, which they attribute to their stricter fault tolerance criterion.
On the hex layout the search reached depth 10 in the first generation. Afterwards the d=3 circuit became shallower, while larger distances stayed at depth 10 and lowered herald and waste. An ancilla that builds an X check uses a neighbouring Z check ancilla, since it cannot reach all four of its data qubits directly.
For the triangular colour codes between distances 3 and 9, the multi-size search gave fault-tolerant circuits in the first generation for d≤7, but only in generation 11 for d=9. No single program was valid for all distances, and the depths took about 15 generations to come within 20% of their final values, with the last drop at generation 43 for d=5.
For the d=3 Steane code the multi-size search matched the depth 7 of Ref. [45], and another multi-size search reached a depth-6 circuit.
Logical gate designs
Table II lists the gate design results together with the comparison works.
A logical CNOT between two [[5,1,3]] blocks is compared with the fault-tolerant construction of Ref. [51], and the fault criterion is applied to each block separately. The circuits found here report an undecodable cost of 0.00 in the table.
The table also includes logical S-bar gates on the [[9,1,3]] and [[25,1,5]] codes on native layouts, logical H-bar gates on the [[15,1,3]] code on all-to-all connectivity, and H-bar gates on the [[8,3,2]] code with the cube layout compared against Ref. [15].
Effect of the LLM tier
Three tiers were used: the base tier is GPT-6-luna with reasoning effort max, and the strong and elite tiers are GPT-6.1-sol with reasoning high and xhigh. Almost all reported circuits come from the strong tier, which produced the cold-start circuits in the first generations.
The authors find GPT-6.1-sol performs better than GPT-6-luna, particularly for non-CSS codes, certain gate tasks and logical routines. The text gives these tier differences without numerical rates, so the size of the gap is not quantified.
Reed-Muller to Steane switch
The circuit uses 16 ancillae with all-to-all connectivity, and random measurements, a detector and conditional Paulis are shown in the circuit diagram.
The generation-27 notes record a depth-20 body with 49 operations and 4 measurements, tested at n_data=15 and n_anc=2 with residual tolerance t=1. In that test the circuit is valid on every branch, with silent1, herald1 and waste1 all zero across 670 single faults, and all measurements give deterministic zero without feedforward or postselection.
These figures come from the LLM's own notes, which record the verifier output for the tested circuit.
The same notes record a depth-21 construction as also fully fault tolerant, and an alternative orientation of temporary data that reached depth 20 but left one silent fault, which reversing the orientation removed.
A second note from generation 10 reports a shortened flagged-probe construction at depth 38 with 59 operations and 5 deterministic measurements, with branch fraction 1. A sweep over probe orders and omitted readouts found 12 zero-cost variants, the best of them at depth 38, and the note makes no claim about fault orders above one.
Limits of the evidence
The depth-20 switch is certified only for single faults at n_data=15 with residual tolerance t=1, and the authors make no claim for fault orders above one. In Table I, silent entries of higher order are left unenumerated where the code distance does not require them, or where lower orders are already non-zero.
The colour code search did not yield one program valid across all distances and converged slowly.
The authors present the method as extensible to any target that can be written as a Clifford map, and to other objectives such as different noise models, measurement-free circuits or explicit two-qubit gate optimization. These extensions were not tested in the reported experiments.
Several table comparisons rely on the authors' stricter fault criterion, so silent counts for the circuits of Ref. [44] reflect that criterion. The circuits of Ref. [44] have no detectors, so they report no heralded or wasted events.
Paper info
- Authors
- Aritra Lahiri, Florian Marquardt
- Venue
- arXiv · Preprint
- First published
- 2026-11-13
- Added
- 2026-11-16
- Updated
- 2026-11-13
- Version
- v1
- arXiv
- 2611.18504
- Category
- quant-ph · cs.AI
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
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.
Quote from the paper
Aritra Lahiri, Florian Marquardt (2026). Agentic AI for Discovering Fault-Tolerant Quantum Circuits. arXiv:2611.18504v1. https://arxiv.org/abs/2611.18504v1
BibTeX
@misc{lahiri2026agentic,
title = {{Agentic AI for Discovering Fault-Tolerant Quantum Circuits}},
author = {Aritra Lahiri and Florian Marquardt},
year = {2026},
eprint = {2611.18504},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.18504v1}
}