Quantum Circuit Design with Claude
Quantum circuit design with Claude is a research project, published by Anthropic on 16 October 2026, in which the large language model Claude Mythos 5 designed reversible quantum circuits for eight computational primitives used in chemistry, optimization, physics simulation, numerical computing and number theory.[1][2] An automated evaluator checked each candidate design for correctness and scored it on its Toffoli-gate count and peak qubit count. According to the accompanying paper, "Discovering state-of-the-art quantum circuits with large language models" (arXiv:2610.22367), the discovered circuits significantly reduce both Toffoli and qubit counts relative to the state of the art in seven of the eight tasks, and in the eighth the search found a new reversible architecture for prime-field modular inversion.[2] The work was led by Andi Gu as part of Anthropic's STEM Fellows Program, with mentorship from Anthropic quantum physicist Alek Kemeny, in collaboration with Susanne Yelin and Mikhail Lukin of Harvard University (Lukin is also affiliated with QuEra Computing).[1][2]
All results are logical-level resource counts for circuits intended for future fault-tolerant machines. The evaluator establishes correctness by classical simulation, and all of the comparisons with earlier circuits come from the authors themselves.[2]
Background
Quantum computing hardware built to date has hundreds to thousands of qubits, which Anthropic describes as too few to run many of the algorithms that promise practical advantages over classical computers.[1] Because qubits and computing time are both scarce, much of the progress toward useful quantum algorithms has come from redesigning the circuits that carry out a computation rather than from better hardware.[1]
Anthropic's post uses FeMoco, the iron-sulfur cofactor at the heart of the nitrogenase enzyme, as an illustration.[1] A 2017 study by Reiher, Wiebe, Svore, Wecker and Troyer in PNAS gave the first resource estimate for computing its ground-state energy on a quantum computer.[4] A table compiled by Low et al. (2025) for the same 54-orbital FeMoco model traces how the estimated cost has fallen since then:[5]
| Year (as tabulated) | Method | Logical qubits | Toffoli gates |
|---|---|---|---|
| 2017 | First resource estimate by Trotterization (Reiher et al.) | 111 | 5.0 x 10^13 |
| 2019 | Qubitization of single factorization | 3,320 | 9.5 x 10^10 |
| 2020 | Qubitization of double factorization | 3,600 | 2.3 x 10^10 |
| 2020 | Tensor hypercontraction (THC) | 2,142 | 5.3 x 10^9 |
| 2024 | Symmetry compression of double factorization | 1,994 | 2.6 x 10^9 |
| 2025 | Spectrum amplification and DFTHC (Low et al.) | 1,137 | 3.41 x 10^8 |
Anthropic rounds this to a fall from about 50 trillion Toffoli gates to about 340 million, a roughly 150,000-fold reduction.[1] Low et al. estimate that their FeMoco-54 calculation would need 3.2 million physical qubits running for 2.7 hours.[5] Anthropic notes that this 150,000-fold drop took many research groups eight years, and it presents automated circuit design as a way to speed up that kind of work.[1]
Why reversible circuits are hard to optimize
The paper studies circuits that compute a classical function f on quantum data, mapping each computational-basis state |x>|y> to |x>|y XOR f(x)>. Two constraints separate this from ordinary programming.[2] First, because the input can be in superposition, a circuit cannot branch on an intermediate value. Every branch has to be expressed as controlled operations within one fixed gate sequence, so each branch adds to the cost even if it applies only to some inputs. Second, the computation must be reversible. Temporary values cannot simply be overwritten or discarded; they must eventually be "uncomputed" and their qubits returned to zero, and until then they occupy extra qubits.[2] Anthropic's post describes the resulting trade-off between space and time: uncomputing intermediate results early frees qubits but forces recomputation later, while keeping them avoids repeated work at the cost of more qubits.[1]
The authors argue that redesigning such circuits is usually difficult because testing a general quantum circuit can require exponentially expensive classical simulation. As a result, automated circuit optimizers typically restrict themselves to predefined equivalence-preserving rewrites of a fixed design.[2] The class of circuits studied here avoids that problem: by linearity, a candidate is correct on every superposition if it performs the required map on every computational-basis input, so the evaluator only needs to track one bit string and its phase.[2]
Method
Evaluator and scoring
The circuits are written in the "kickmix" circuit model of Babbush et al., which allows classical reversible gates (X, CNOT, Toffoli, swap), diagonal sign gates (Z, CZ, CCZ) and destructive X-basis measurements. It also supports measurement-based uncomputation (MBU), a technique introduced by Craig Gidney that clears a temporary AND with one Toffoli instead of two.[2] Kickmix circuits remain efficiently classically simulable. For each sampled input and measurement record, the evaluator checks that the output matches the target, that the inputs are unchanged, that every ancilla has returned to zero and that the phase is exactly right.[2] For large input domains the evaluator samples trajectories rather than checking them all, and the paper derives statistical bounds on the failure probability from the number of passing tests.[2]
Valid circuits are ranked by their "TQ-cost": the Toffoli count multiplied by the peak number of logical qubits.[2] The authors note that weighting space and time equally is a simplification. Depending on the hardware, a cost that weights qubits more heavily, or that uses Toffoli depth or active volume, may be more appropriate, and the search can run with any computable objective.[2]
Evolutionary search with Claude
Each candidate is a Python program that constructs a circuit, using functions, loops and named registers so that the algorithmic structure stays visible to the model.[2] The search runs on OpenEvolve, an open-source evolutionary coding framework, with Claude Mythos 5 proposing architectures and program rewrites.[2][11] It proceeds in three stages:[2]
- Ideation. Given only the hand-written task specification, the circuit model and the correctness criteria, the model proposes several qualitatively different circuit architectures (up to five in the example prompt the paper reproduces). Each architecture founds a separate family of candidate programs, starting from a blank program.
- Evolution. Each iteration starts a new agent session with the task specification, a parent program and its evaluator feedback, plus a limited sample of other programs, summaries of earlier attempts and short "discovery" notes recorded by the model. Within a session the agent can run drafts on test inputs, query a classical oracle for the required function, and delegate subtasks to subagents before submitting a revised program.
- Selection. Within each family, a MAP-Elites archive divides the Toffoli-qubit plane into cells and keeps the lowest-TQ circuit in each cell, so space-efficient designs survive even when their TQ-cost is worse. Strong programs are periodically shared between families.
The model has no access to the evaluator beyond the feedback returned after each submission, and the paper states that the discovered circuits were produced "without substantive human intervention."[2] Anthropic's post gives more detail on the human role. Early in the project, it says, Claude was "conservative by nature": it second-guessed apparent improvements and preferred well-known approaches. The researchers responded by requiring parallel development of several different approaches and by occasionally prompting Claude to broaden its search.[1] The elliptic-curve result came from a run of 53 hours whose human input was limited to a one-paragraph brief and occasional prompts to think more broadly.[1]
Results
The paper reports the following comparison across its eight tasks. G_TQ is the ratio of the baseline's TQ-cost to that of the discovered circuit.[2]
| Task | Baseline (Toffolis, qubits) | Discovered (Toffolis, qubits) | G_TQ |
|---|---|---|---|
| Reed-Solomon decoder for DQI | 5.1 x 10^6, 1,938 (Khattar et al.) | 4.4 x 10^5, 1,837 | 12 |
| Hermitian-code decoder for DQI | 1.0 x 10^8, 1.9 x 10^5 (naive reversible implementation) | 9.3 x 10^5, 2,395 | not given |
| HHL rotation angle (arcsin) | 1.6 x 10^4, 300 | 1,348, 115 | 32 |
| Coulomb potential (inverse distance) | 6,355, 252 | 1,140, 142 | 9.9 |
| Fixed-point Gaussian | 2.4 x 10^4, 362 | 1,583, 139 | 39 |
| Fe2S2 alias-Select (chemistry) | 5.5 x 10^4, 139 | 1.5 x 10^4, 126 | 4.1 |
| Nonabelian lattice-gauge simulation | 1.3 x 10^6, 1,927 | 1.7 x 10^5, 1,859 | 7.7 |
| Prime-field modular inversion (in elliptic-curve point addition) | several prior trade-offs; no single baseline | 4.0 x 10^6, 935 | not given |
For the Hermitian-code decoder, no prior reversible compilation exists, so the baseline is a naive reversible implementation.[2] For modular inversion, earlier constructions trade Toffolis against qubits in different ways, and the authors report no single gain figure.[2] Anthropic's post summarizes the eight tasks as designs that "used both fewer qubits and fewer gates than the best previously published algorithms"; the paper's own wording is seven of eight, with the eighth described separately.[1][2]
Across tasks the paper identifies three recurring design principles:[2]
| Principle | Idea |
|---|---|
| Conditional routing | Instead of a separately controlled arithmetic block for each branch, cheap controlled swaps route the right values into a single shared, uncontrolled arithmetic block. |
| Decoding computational history | Instead of storing every branch decision on a history stack, the circuit recovers the decision from patterns left in the registers during uncomputation. |
| Using the failure budget | Most quantum algorithms tolerate a small failure probability, so resources needed only for rare, costly inputs are removed and failure is confined to those inputs. |
Reed-Solomon decoding for decoded quantum interferometry
Decoded quantum interferometry (DQI), introduced by Jordan et al. in 2024, uses the quantum Fourier transform to turn certain optimization problems into decoding problems. For optimal polynomial intersection (OPI), a form of polynomial fitting over finite fields, it achieves a superpolynomial speedup over known classical algorithms.[6] Khattar et al., whose work Anthropic attributes to Google Quantum AI, later compiled DQI circuits for OPI using reversible Reed-Solomon decoders built on the extended Euclidean algorithm, which their abstract identifies as the decoder's bottleneck.[1][7] Anthropic's post says estimates by Google Quantum AI researchers imply that one OPI instance would take about three months on the Frontier supercomputer, compared with roughly an hour on a future quantum computer running DQI, with most of that hour spent on decoding.[1]
The benchmark instance is Khattar et al.'s primary Reed-Solomon case: a [4095, 4025, 71] code over a 4,096-element field, in which 70 twelve-bit syndromes (840 qubits) determine up to 35 errors.[2] The authors' implementation of the baseline, based on Khattar et al.'s released code, uses 5.1 million Toffolis and 1,938 qubits, and the synchronized Euclidean solve for the error locator alone needs about 1.9 million Toffolis.[2] The discovered circuit replaces the Euclidean solve with the Berlekamp-Massey recurrence, which by the paper's figures needs about 140,000 Toffolis for the locator step but, implemented naively, accumulates a large history of overwritten values.[2]
The circuit avoids most of that history in two ways. Because the error-locator polynomial is needed only up to a nonzero constant factor, both Berlekamp-Massey update cases can be rescaled to share one arithmetic path; this also lets the circuit recover each discarded value from the locator's constant coefficient instead of storing it.[2] Only one rare update type still needs a stored value. A stack large enough for the worst case would take 35 entries (665 qubits). Under the DQI input distribution a second entry is needed with probability 1.0 x 10^-4, so the circuit reserves a single 19-qubit entry and accepts failure on those rare inputs.[2] Anthropic says Claude wrote its own simulator and ran 403 million sample decodings to measure how often these exceptions occur.[1] The circuit also computes the single phase bit that DQI needs directly, rather than materializing the full decoded error word.[2] Overall, the Toffoli count fell from 5.1 million to 440,000, which Anthropic describes as making DQI's costliest step about 12 times cheaper.[1][2]
Modular inversion and elliptic-curve point addition
Modular inversion (finding x with wx = 1 mod p) is the dominant cost of point addition on elliptic curves, the core step of Shor-type quantum algorithms for the elliptic-curve discrete logarithm problem.[1][2] The benchmark is a complete reversible point adder over a 256-bit prime field, on the curve y^2 = x^3 + 7 with p = 2^256 - 2^32 - 977.[2] Recent constructions by Schrottenloher (2026) and Luo et al. (2026) use binary-gcd and Euclidean approaches; Luo et al. report a space-efficient design needing 835 logical qubits for a 256-bit prime-field curve.[8][9]
The search instead built the inversion on divsteps, a variant of the Euclidean algorithm by Bernstein and Yang that replaces division with conditional additions, subtractions and halvings and is used in constant-time classical cryptographic code.[2] Divsteps had been impractical for reversible integer arithmetic because a direct quantum version must store which of three updates was applied at every step.[1][2] Claude's approach was to infer those branch decisions from the updated registers. Simple tests recover about two thirds of the decisions in a typical walk. For the remaining "ambiguous" decisions, the model identified an invariant from which the branch bit can be read off the updated state, and the paper's appendix proves that every decision is exactly recoverable.[2] Anthropic says Claude first tried simple decoding rules that worked on small cases but failed on 256-bit numbers, then derived new algebraic identities, checked the resulting formula by large-scale simulation and formalized the claim in Lean.[1] The paper describes the result as, to the authors' knowledge, the first reversible divstep inversion circuit over a prime field.[2]
Decoding costs gates, so a tunable cutoff decides which decisions are decoded and which are stored. With the chosen cutoff, only 12.4% of ambiguous decisions are stored; the circuit reserves 60 history qubits instead of the worst-case 263 and fails on stack overflow with probability 2.4 x 10^-6 per inversion. It also schedules 533 divsteps instead of the worst-case 590.[2] The complete point adder uses 4.0 million Toffolis and 935 qubits, with a union-bound failure probability of about 1.6 x 10^-4 against a budget of 2 x 10^-4; four of 100,000 test runs failed.[2] Varying the cutoff yields a family of circuits from 3.6 million Toffolis and 1,031 qubits to 7.9 million Toffolis and 893 qubits.[2]
| Point-addition construction | Inversion strategy | Toffolis | Qubits | TQ-cost |
|---|---|---|---|---|
| Schrottenloher (2026) | Binary gcd with dialog trick | 1.9 x 10^6 | 1,446 | 2.7 x 10^9 |
| Divstep circuit (this work) | Divsteps with decoding | 4.0 x 10^6 | 935 | 3.7 x 10^9 |
| Luo et al. (2026), as rebuilt by the authors | Packed Euclidean walk | 7.0 x 10^7 | 838 | 5.8 x 10^10 |
| Specialized Euclidean (this work) | Specialized packed walk | 2.1 x 10^7 | 843 | 1.7 x 10^10 |
The divstep circuit does not have the lowest TQ-cost in this comparison; Schrottenloher's construction does. Its contribution is a new point on the Toffoli-qubit trade-off.[2] Anthropic's post makes the same comparison against the smallest previous design: 12% more qubits but 17 times fewer gates.[1] Separately, the search specialized Luo et al.'s design for this prime, cutting its Toffoli count from 69.5 million to 20.5 million (a factor of 3.4) at the cost of five more qubits.[2]
Other tasks
- Numerical functions. For the HHL rotation angle, the Coulomb potential and a fixed-point Gaussian, the baselines are tuned versions of the piecewise-polynomial method of Häner, Roetteler and Svore. The discovered circuits keep that approximation family but use power-of-two-aligned intervals that can be located from the input bits without comparisons, lower-degree polynomials, and coefficients fitted to the exact truncated integer arithmetic the circuit performs. They also clear loaded coefficients with MBU.[2]
- Chemistry. The Fe2S2 task implements the Select operation for an iron-sulfur cluster Hamiltonian (30 electrons in 20 spatial orbitals, from data by Li and Chan) with 41,052 Pauli terms.[2] Anthropic's post says Claude exploited the molecule's symmetries and repeated structure to compute some results once and reuse them.[1]
- Lattice gauge theory. The lattice task compiles one magnetic-evolution layer of an improved Hamiltonian on a periodic 4 x 4 x 4 lattice, with link variables restricted to a 216-element subgroup of SU(3).[2]
Limitations
The authors say the framework is bounded by the choices that define each task.[2] The TQ objective is one reasonable choice among several, and the right weighting of qubits, depth, routing and measurements depends on hardware and error-correction details. Tasks are specified in a fixed computational basis, which excludes optimizations that change the encoding itself, such as coset representations for modular addition. The task boundary, input distribution and accuracy target also encode assumptions about how a circuit fits into a larger algorithm.[2] Several of the discovered circuits rely on a failure budget and are therefore correct only up to a stated small failure probability on a specified input distribution.[2] The authors also note that their chemistry task uses a sparse Pauli representation because validating the state-of-the-art double-factorized tensor-hypercontraction walk operator lies outside the kickmix framework.[2]
Related work
The paper places the work alongside earlier LLM-guided algorithm discovery, citing FunSearch and AlphaEvolve, which it describes as having produced new algorithms in combinatorics and linear algebra.[2][10] It also cites earlier attempts to generate quantum circuits with LLMs, which represented candidates as gate sequences or predefined blocks, and reinforcement-learning and LLM-guided discovery of quantum error-correcting codes.[2] Both the paper and Anthropic's post suggest the same evaluator-guided approach could be extended to jointly optimize other layers of a fault-tolerant quantum computer, such as error-correcting codes, magic-state supply and hardware architecture.[1][2]
Anthropic STEM Fellows Program
Gu carried out part of the work under the Anthropic STEM Fellows Program, which is listed as an affiliation on the paper.[2] Anthropic's job posting describes the program as bringing researchers from science and engineering into the company for four months to work on hard problems in their fields with Claude, in small pods of Fellows from related fields. It says the first cohort, of more than 20 Fellows across mathematics, physics, the life sciences and engineering, ran from June to September 2026.[12] Work at Harvard was supported by IARPA and the Army Research Office under the Entangled Logical Qubits program and by the National Science Foundation.[2] Anthropic announced the project on X on 16 October 2026.[3]
See also
References
- ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9 ^10 ^11 ^12 ^13 ^14 ^15 ^16 ^17 ^18 ^19 ^20 ^21Anthropic. "Designing more efficient quantum circuits with Claude." Anthropic, 16 October 2026. anthropic.com/...igning-efficient-quantum-circuits
- ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9 ^10 ^11 ^12 ^13 ^14 ^15 ^16 ^17 ^18 ^19 ^20 ^21 ^22 ^23 ^24 ^25 ^26 ^27 ^28 ^29 ^30 ^31 ^32 ^33 ^34 ^35 ^36 ^37 ^38 ^39 ^40 ^41 ^42 ^43 ^44 ^45 ^46 ^47 ^48 ^49 ^50 ^51 ^52Gu, A., Kemeny, A. H., Yelin, S. F., and Lukin, M. D. "Discovering state-of-the-art quantum circuits with large language models." arXiv:2610.22367, 15 October 2026. arxiv.org/...2610.22367
- ^Anthropic (@AnthropicAI). Post announcing the quantum circuit design work, X, 16 October 2026. x.com/...2111152183240511640
- ^Reiher, M., Wiebe, N., Svore, K. M., Wecker, D., and Troyer, M. "Elucidating reaction mechanisms on quantum computers." *Proceedings of the National Academy of Sciences*, 2017. doi.org/...pnas.1619152114
- ^1 ^2Low, G. H., King, R., Berry, D. W., et al. "Fast quantum simulation of electronic structure by spectrum amplification." arXiv:2502.15882, 2025. arxiv.org/...2502.15882
- ^Jordan, S. P., Shutty, N., Wootters, M., et al. "Optimization by Decoded Quantum Interferometry." arXiv:2408.08292, 2024. arxiv.org/...2408.08292
- ^Khattar, T., Shutty, N., Gidney, C., et al. "Verifiable Quantum Advantage via Optimized DQI Circuits." arXiv:2510.10967, 2025. arxiv.org/...2510.10967
- ^Schrottenloher, A. "Optimized Point Addition Circuits for Elliptic Curve Discrete Logarithms." arXiv:2606.02235, 2026. arxiv.org/...2606.02235
- ^Luo, H., Yang, Z., Luo, J., et al. "Quantum Algorithm for Elliptic Curve Discrete Logarithms with Space-Efficient Point Addition." arXiv:2607.13816, 2026. arxiv.org/...2607.13816
- ^Novikov, A., Vu, N., Eisenberger, M., et al. "AlphaEvolve: A coding agent for scientific and algorithmic discovery." arXiv:2506.13131, 2025. arxiv.org/...2506.13131
- ^OpenEvolve. GitHub repository. github.com/...openevolve
- ^Anthropic. "Anthropic STEM Fellow." Job posting, Anthropic careers (Greenhouse). job-boards.greenhouse.io/...5452403008
Improve this article
Add missing citations, update stale details, or suggest a clearer explanation. Every suggestion is reviewed for sourcing before it goes live.
1 revision · v1 · 3,298 words · full history
Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify
Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here
Reviewer note: Independent verification 2026-10-17 (xg19 V4): every table row checked against arXiv 2610.22367, Low et al. and the Anthropic post; 0 defects.
Cite this page: AI Wiki. "Quantum Circuit Design with Claude." aiwiki.ai, updated 16 Oct 2026, fact-checked 16 Oct 2026. CC BY 4.0. https://aiwiki.ai/wiki/claude_quantum_circuit_design