A frontier LLM writes its own fault-tolerant quantum circuits, passing exhaustive fault checks on state prep, logical gates and code switching
Synopsis
Fault-tolerant quantum circuits have largely been designed by hand, task by task and code by code, which becomes intractable as circuits grow. This work recasts the design as agentic evolutionary program synthesis: a frontier large language model iteratively rewrites Python programs that build circuits, guided by a verifier that exhaustively enumerates faults to check the target and the fault-tolerance criterion. Across logical state preparation, logical gate design, and logical routines such as code switching and code growth, the search returned circuits that passed the exhaustive check, several of them shallower than existing reinforcement-learning or hand-built constructions.
Interpretation
Fault-tolerant circuit design moves from case-by-case hand construction to circuits evolved automatically by a large language model under verifier feedback, covering logical state preparation, logical gates, and routines such as code switching and code growth. Such circuits had mostly been designed by hand for each task and each error-correcting code, and prior automated methods were limited largely to logical state preparation for distance-five codes, not logical gates or higher-level routines. Every candidate circuit is checked by a verifier that enumerates fault combinations up to the code distance and tests whether each event fires a detector or leaves a residual below the correctable weight bound; the search returned circuits meeting that criterion for every listed task.
The evolved artifact is a Python function that builds a dynamic Clifford circuit, meaning a Clifford circuit with mid-circuit measurements and Pauli feedforward conditioned on their outcomes, from the numbers of data and ancilla qubits. Original FunSearch used the model only as a mutation operator scored by an evaluator; here the model can also call the verifier as a tool to test and amend proposals before submitting them. The search runs on independent islands over generations, each generation prompting the model with the island's best program, one with a different measurement count, and a random one, plus fault-tolerance metrics; on the rotated surface code's native layout it found circuits with zero silent events at all distances in the first generation, then spent five more generations reducing depth.
For logical gates and code switching, which sit mid-protocol, the criterion drops post-selection: a shot is discarded only when the detector pattern and code-check syndrome together cannot identify a unique correction. State preparation can discard and rerun a faulty shot, but discarding a mid-protocol gadget forces the whole protocol to restart, and the discard probability grows with the order of simultaneous faults, eventually dominating the code's logical error rate. For a logical CNOT on the perfect code, the found circuit has depth 16 and 29 two-qubit gates versus depth 84 and 65 two-qubit gates for the CNOT3f variant, both meeting the same fault-tolerance criterion; for three logical Hadamard instances on cube connectivity, the found circuits have depths 9, 10 and 14 versus 19, 15 and 18.
Perspective
The demonstrated scope is dynamic Clifford circuits, meaning Clifford gates, ancilla measurements and conditional Pauli gates, for logical state preparation, logical gate design and routines such as code switching and code growth; fault tolerance uses flag fault tolerance and enumerates fault combinations only up to the code distance. The authors note that code growth is inherently fault-tolerant only under post-selection, with its first discards appearing at events of roughly half the code distance.
The search does not always converge: the in-place phase gate on the rotated surface code failed at distance seven within the allotted generations and succeeded at both distances only after embedding the patch in a larger one, and the two code-growth runs were still improving or nearly stalled in their final generation. The authors also note that the multi-size colour-code search progressed more slowly than the rotated surface code and did not find a general program covering all distances.
