I let an LLM agent design quantum circuits in a sandbox for 10 cycles

· quantum, qml, agents, llm, sandbox, automation, honest-benchmarks


We handed the search over to an agent: an LLM reads the previous results, proposes a new circuit design, and runs it — but only inside a locked sandbox (no network, no writing outside its scratch folder, killed if it hangs). Ten cycles, no human in the loop, every decision written down. It structurally can’t reach real hardware — so it can never overspend the QPU budget.

The sandbox comes first

Untrusted, model-written code runs behind hard denials — proven before any of it executes. If any denial fails to fire, the whole loop aborts (fails closed):

denial testblocked?
network✅ yes
file-escape✅ yes
timeout✅ yes

All denials held: True.

Ten autonomous cycles

The agent read prior results, proposed the next variant, ran it sandboxed, and scored it against the baseline on identical splits — writing its reasoning each time.

Results

cycleproposed varianttest accvs baseline
0iqp/strongly_entangling L=80.9556-0.0222
1angle/basic_entangler L=120.4844-0.4933
2iqp/strongly_entangling L=60.8356-0.1422
3angle/strongly_entangling L=80.9733-0.0044
4angle/strongly_entangling L=100.9733-0.0044
5angle/strongly_entangling L=120.9822+0.0044 ✅
6angle/strongly_entangling L=160.9822+0.0044 ✅
7angle/strongly_entangling L=140.9822+0.0044 ✅
8angle/strongly_entangling L=180.9822+0.0044 ✅
9angle/strongly_entangling L=200.9689-0.0089

Figures

agentic loop accuracy trajectory vs baseline

The agent’s search path (on-brand, generated): per-cycle accuracy against the fixed classical baseline (green). Green dots edged it; the dip at the end is the agent discovering that more depth started to hurt.

Honest caveats

The best cycle edged the baseline by +0.0044 (0.9822 vs 0.9778) — but the VQC’s own seed-to-seed noise is ~1σ of that, so this is consistent with a small statistical fluctuation on a near-saturated benchmark, not a quantum advantage (D1). The agent’s report says so itself.

Reproduce it

Every cycle traces to cycles.csv + per-cycle cycleNN_score.json; rationales in rationales.md (D7). experiments/20260710-114217_p5-agent.