Automating quantum circuit optimization with AI agents

arXiv:2610.31352 · quant-ph · Submitted 2026-10-22 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Quantum Radio. Generated commentary on the latest quantum physics and condensed matter papers.

Kai: We're looking at the paper: "Automating quantum circuit optimization with AI agents".

Mira: Here's the gist of the paper. The gist The method presents a general method for solving hard optimization problems in quantum circuit compilation using AI agents, with every result certified >ref:14.

Kai: How it works The approach utilizes two main components: a verified autoresearch loop and a challenge-construction system >ref:2.1.

Mira: Figure 1 illustrates this structure, showing how agents search for solutions under the control of a frozen evaluator, and how an agent builds, validates, and freezes that evaluator together with its infrastructure >ref:3.

Kai: The verified autoresearch loop involves agents competing under a frozen, exact verifier and scorer so that every reported result is certified >ref:2.1.

Title and authors: Kai: Let's talk about who wrote this, Marcos Crichigno and Steve Flammia. They're working in quantum hardware experimentalist circles, so they bring that practical side to this.

Mira: And as a condensed matter theorist, I'm more interested in what the titles and authors suggest about how they framed these hard optimization problems for the AI to tackle.

Lev: I just wonder what kind of hardware setup they used when they were testing these agents, because those kinds of optimizations have to actually run on real physical systems to matter.

Kai: Well, it seems like their focus is on applying this general method—this whole "general method for solving such problems with AI agents"—to specific compilation tasks like fermion-to-qubit encoding and Hamiltonian layout.

Mira: And what I find compelling about the authors' approach is how they structure the process to ensure that the infrastructure for building a trustworthy evaluator is repeatable, not something you have to reinvent from scratch every single time.

Lev: That repeatability is important because if it’s just some one-off fix, it doesn't help when we try to scale up these quantum circuits for actual devices.

The paper's summary: Kai: So, the summary of "Automating quantum circuit optimization with AI agents" explains that they use a verified autoresearch loop where agents iteratively improve programs against a fixed evaluator and which have recently improved quantum cryptanalysis circuits.

Mira: And then they add these two elements on top: a frozen, exact verifier that certifies every result, and this verifier along with the challenge around it is built by an agent that talks to the researcher to formulate the problem.

Lev: That whole setup sounds like it’s trying to solve the problem of trust in AI output when dealing with things as complex as quantum circuit compilation where you need exact answers.

Kai: Right, and they detail this challenge construction system which involves an agent formulating a contract, building the verifier, the scorer, and reference solutions from literature before any candidate solution even exists.

Mira: That validation gate is pretty strong because it requires passing checks against an analytically solved case, deliberately broken solutions that must be rejected with a specific diagnosis, and even reproducing published results.

The paper's improvements: Kai: Looking at the improvements section, they point out that the system ensures trust because validation happens before search so any later disagreement is attributable to the submission itself.

Mira: And they also talk about checks being exact because sampled checks are exploited and tests of the evaluator themselves are tested by mutation and property-based testing.

Lev: The stability mechanism, tying every score to a cryptographic hash of the evaluator, means if you change even one tiny thing in that evaluation harness, all those stored scores become invalid and force a complete rescoring.

Kai: And they also address reward hacking by reporting costs as vectors instead of weighted sums, which makes it harder for an agent to just trade one term against another.

Mira: Containment is also mentioned; since the submissions are untrusted code, they run without network access against a read-only copy of the evaluator.

Conclusion: Kai: So, to wrap up on "Automating quantum circuit optimization with AI agents," the paper shows that this approach applies to any optimization problem whose solutions can be verified exactly and efficiently.

Mira: It seems like the main implication is that for problems where you can check things exactly on a classical computer and costs are deterministic, this method opens the way to automated, certified discovery across quantum circuit design.

Lev: For us in error correction, it means we could use this framework to test new error-correcting codes or encoding strategies much faster than if we were just running brute force searches.

Kai: It really shifts the bottleneck in AI-driven research on these problems from the search part to the formulation part, turning that step into a fixed procedure.

Mira: And the fact that freezing the evaluator ties every score to a fixed evaluation harness means results remain comparable across different agents and over time, and you can even reopen a challenge when new models appear.

Lev: I think what stands out is how they handle the verification—it’s not just about finding *a* solution, it's about finding one that has been rigorously vetted against multiple failure modes before it gets accepted.

Kai: So that's the picture of how this AI agent approach works for compilation problems in fermion-to-qubit encoding, Hamiltonian layout, and unitary synthesis.

Marcos Crichigno, Steve Flammia

Phasecraft · Virginia Tech

quant-ph

Submitted: 2026-10-22

Updated: 2026-10-22

Code: https://github.com/karpathy/autoresearch

License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/

The gist: The gist The method presents a general method for solving hard optimization problems in quantum circuit compilation using AI agents, with every result certified >ref:14.

Key concepts

Verified Autoresearch Loop
A competitive system where AI agents search for solutions. Crucially, every result reported by an agent must be checked exactly by a fixed evaluator. This ensures that all final answers are mathematically proven correct against the established rules before any solution is accepted.
Challenge Construction System
This feature automates building the entire testing environment. An agent formulates the problem as a contract, builds the verifier and scorer based on literature, and must pass a validation gate using known solvable cases and broken examples before any search begins.
Frozen Evaluator
The scoring mechanism is fixed once built to ensure stability. Every score is tied to a cryptographic hash of this evaluator. This prevents agents from changing the rules mid-search and ensures that results remain comparable over time, even if new agents are used.

Terminology

Summary

The gist The method presents a general method for solving hard optimization problems in quantum circuit compilation using AI agents, with every result certified >ref:14.

How it works

The approach utilizes two main components: a verified autoresearch loop and a challenge-construction system >ref:2.1. Figure 1 illustrates this structure, showing how agents search for solutions under the control of a frozen evaluator, and how an agent builds, validates, and freezes that evaluator together with its infrastructure >ref:3. The verified autoresearch loop involves agents competing under a frozen, exact verifier and scorer so that every reported result is certified >ref:2.1. The challenge-construction system automates the construction of the evaluator and of the challenge around it by having an agent formulates the problem as a contract, implements the verifier, scorer and reference solutions from the literature, and must pass a validation gate before any candidate solution exists >ref:2.2. This system ensures trustworthiness through several mechanisms: Trust is achieved because validation precedes search so that a later disagreement between a submission and the evaluator is attributable to the submission >ref:2.2. Checks are exact because sampled checks are exploited, and tests of the evaluator are themselves tested by mutation and property-based testing >ref:3. The system also ensures Stability by tying every score to a cryptographic hash of the evaluator, so any change to it invalidates all stored scores and forces a complete rescoring >ref:2.2. Resistance to reward hacking is achieved because costs are reported as vectors rather than weighted sums, which invite a search to trade one term against another >ref:2.2. Containment is maintained because submissions are untrusted code, executed without network access against a read-only copy of the evaluator >ref:3. Continuity is ensured because each challenge maintains documents recording its background, plan, findings and standing rules, and stores every accepted submission with its source code and the notes of the agent that produced it so that later agents can build on it >ref:2.2.

Challenge Construction

The challenge-construction system builds a challenge through a fixed procedure executed by an agent in dialogue with the user >ref:2.1. In stage 1, the agent establishes suitability by ensuring instances form a scalable family, validity is decidable exactly, cost is separate from validity, and scores are deterministic >ref:2.2. It then drafts a contract specifying the instance, artifact and submission which the user approves >ref:2.2. The agent classifies the verifier by its kind of check and implements the verifier, scorer and two or three reference constructions from the literature >ref:3. The validation gate requires passing in order an analytically solved case, a set of deliberately broken artifacts that must each be rejected with a specific diagnosis, and where available, the reproduction of published results >ref:14. Once the user signs off, the evaluator is frozen and fingerprinted before stage 2 begins >ref:2.1.

Verified Autoresearch Loop

In stage 2 of Figure 1b, competing agents run in an agent harness where they modify only their program, the evaluator alone assigns scores, and every evaluation is recorded together with the versions of the program and of the evaluator that produced it >ref:2.1. Each agent operates in an agent harness which gives a model access to a file system and a shell, ensuring that the evaluation harness is independent of it so that every agent competes under the same evaluator >ref:2.1. Submissions are programs rather than artifacts so they can be read, compared and applied to larger instances, and evaluating them on instance sizes for which they were not tuned distinguishes a general construction from a lookup table >ref:2.1.

Results

The method was applied to three compilation problems in quantum simulation: (a) fermion-to-qubit encoding, (b) Hamiltonian layout and (c) unitary synthesis >ref:14. In each case, the agents improved substantially on published or standard constructions, reducing the cost being optimized by up to 73% at the largest sizes tested and outperforming a state-of-the-art optimizer for fermion-to-qubit encodings >ref:14. For example, in fermion-to-qubit encodings on a 225-site lattice, the best submissions reduced the total Pauli weight relative to the Jordan–Wigner encoding by 37% at L = 15 and outperformed a state-of-the-art quadratic-assignment optimizer by between 15% and 23% >ref:3.

Key Findings in Specific Problems

For fermion-to-qubit encodings, the best submissions refine an encoding through Clifford transvections, moves that cannot break its validity >ref:14. For Hamiltonian layout, the agents exploit the fact that a routing read backwards is again a routing of the same cost >ref:3. For unitary synthesis, agents treat a CNOT circuit as a walk through the invertible matrices over F2, routing a single walk through every required parity so that the linear part of the target costs almost nothing >ref:3.

Conclusion and Impact

The results open the way to automated, certified discovery across quantum circuit design and beyond >ref:14. The approach applies only where solutions can be checked exactly and efficiently on a classical computer, and where costs are deterministic >ref:5. Freezing the evaluator has a further consequence because every score is tied to a fixed evaluator, so results remain comparable across agents and over time, and a challenge can be reopened whenever a new model or method appears >ref:3. The bottleneck in AI-driven research on such problems shifts from search to formulation, turning this step into a fixed procedure while keeping the user at the two points of approval of the contract and sign-off of the validated evaluator >ref:4.

Methods Summary

The challenge construction builds a problem by having an agent build and validate components against a set of reference solutions >ref:2.2. The fermion-to-qubit encoding challenge uses exact algebra over F2 for validity, while the Hamiltonian layout challenge uses exact replay of a schedule against hardware constraints >ref:3. The unitary synthesis challenge uses an evaluation on all 2n basis states together with an exact comparison of linear maps for its verifier >ref:3. The agents were built on Claude models and every reported result was certified by the frozen evaluator of its challenge, which was validated before any agent-written solution was submitted >ref:3.

References

[1] Sergey B. Bravyi and Alexei Yu. Kitaev. Fermionic quantum computation >ref:1>

[2] Zhang Jiang, Amir Kalev, Wojciech Mruczkiewicz, and Hartmut Neven. Optimal fermion-to-qubit mapping via ternary trees with applications to reduced quantum states learning >ref:2>

[3] Alwin Zulehner, Alexandru Paler, and Robert Wille. An efficient methodology for mapping quantum circuits to the IBM QX architectures >ref:3>

[4] Gushu Li, Yufei Ding, and Yuan Xie. Tackling the qubit mapping problem for NISQ-era quantum devices >ref:4>

[5] Alexander Cowtan, Silas Dilkes, Ross Duncan, Alexandre Krajenbrink, Will Simmons, and Seyon Sivarajah. On the qubit routing problem >ref:5>

[6] Bochen Tan and Jason Cong. Optimal layout synthesis for quantum computing >ref:6>

[7] Ieva Cepait˙e, Niam Vaishnav, Leo Zhou, and Ash- ˇley Montanaro. Quantum-enhanced optimization by warm starts >ref:7>

[8] Matthew Amy, Dmitri Maslov, and Michele Mosca. Polynomial-time T-depth optimization of Clifford+T circuits via matroid partitioning >ref:8>

[9] Yunseong Nam, Neil J. Ross, Yuan Su, Andrew M. Childs, and Dmitri Maslov. Automated optimization of large quantum circuits with continuous parameters >ref:9>

[10] Ross Duncan, Aleks Kissinger, Simon Perdrix, and John van de Wetering. Graph-theoretic simplification of quantum circuits with the ZXcalculus >ref:10>

[11] Ketan N. Patel, Igor L. Markov, and John P. Hayes. Optimal synthesis of linear reversible circuits >ref:11>

[12] Neil J. Ross and Peter Selinger. Optimal ancillafree Clifford+T approximation of z-rotations >ref:12>

[13] Andrej Karpathy. autoresearch >ref:13>

[14] Jieyi Long et al. ECDSA.Fail: Open autoresearch for optimizing elliptic-curve point addition in Shor’s algorithm >ref:14>

[15] Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M. Pawan Kumar, Emilien Dupont, Francisco J. R. Ruiz, Jordan S. Ellenberg, Pengming Wang, Omar Fawzi, Pushmeet Kohli and Alhussein Fawzi. Mathematical discoveries from program search with large language models >ref:15>

[16] Alexander Novikov et al. AlphaEvolve: A coding agent for scientific and algorithmic discovery >ref:16>

[17] Bogdan Georgiev, Javier G´omez-Serrano, Terence Tao, and Adam Zsolt Wagner. Mathematical exploration and discovery at scale >ref:17>

[18] Joar Skalse, Nikolaus H. R. Howe, Dmitrii Krasheninnikov, and David Krueger.

Improvements for AI systems

  1. Automated circuit optimization with certified results: AI agents can solve hard compilation problems by operating within a verified autoresearch loop where every result is certified by a frozen, exact verifier and scorer that has been validated against analytic cases, broken solutions, and published results before any solution exists.

  2. Automated challenge construction for novel quantum problems: AI can autonomously build evaluators, including the verifier and scorer, through a dialogue with a researcher to ensure the evaluation infrastructure is trustworthy before opening it to competing agents.

  3. Enhanced circuit design capabilities: AI systems can discover substantially improved quantum circuits by searching over elementary moves in groups—such as transvections of the symplectic group for encodings or elementary row operations over F2 for CNOT circuits—rather than repairing invalid ones.

  4. Improved encoding and layout synthesis: Agents can find optimal fermion-to-qubit encodings by refining existing constructions through Clifford transvections, and optimize Hamiltonian layouts by developing placement strategies guided by fitted potentials that minimize the number of SWAPs required for routing.

  5. Certified verification of circuit correctness: The system allows agents to ensure that every reported result is correct because every reported result was checked exactly by the frozen evaluator of its challenge.

Sources

Related papers