Designing more efficient quantum circuits with Claude
TL;DR Highlight
With a verifier loop, Claude designed quantum circuits that beat the best published ones
Who Should Read
An LLM app developer wondering how to attach an automated scorer to an agent for iterative improvement
Core Mechanics
- A closed loop with an evaluator is the key
- Claude writes circuits in Python and the evaluator returns correctness and a score.
- It used that feedback to improve each next attempt with no human input between rounds.
- The score is qubits times gates
- It was used as a proxy for how long the circuit would run.
- Each input gives one definite output, so an ordinary computer could verify correctness.
- All eight circuits beat the published best
- Eight primitives from chemistry, optimization, physics simulation and number theory used fewer qubits and fewer gates.
- Some improvements were an order of magnitude or more.
- Point addition took 53 hours
- Humans supplied only a one-paragraph brief and occasional prompts to think more broadly.
- Claude built the first reversible divsteps that stores no branch history by decoding it from the number pair.
- A family of store-versus-decode designs
Community Reactions
- Opinion that this is code golf on an assembly language
- A commenter said this builds on Google's Kickmix, where a verification loop lets an LLM test and discard ideas quickly.
- Another example of Kickmix circuit optimization cited was ecdsa.fail.
- Objection that it is not the same computation
- A commenter pointed out that dropping costly components for rare inputs means the circuit is not computing the same thing.
- Skepticism about the blog's credit framing
- One commenter compared the arXiv acknowledgments to the blog's attribution and questioned it.
- The claim that the whole blog is hallucinated is that commenter's assertion.
- Opinion that this resembles SIMD programming
- A commenter noted that having no branching at the lowest level looks like SIMD, suggesting classical and quantum high-performance programming are converging.
How to Apply
- Write an automated scorer for your task
- Today, pick a task you can check by code, such as code optimization or SQL tuning.
- First write a script that checks correctness and prints a score such as speed or memory.
- Paste the prompt below so Claude improves the design against that score.
- Feed scores back into your agent loop
- After the agent produces a result, put the evaluator's pass/fail and score into the next prompt.
- Set a cap on how many rounds run without human input.
- Keep the brief short and ask for parallel exploration
- Write the problem and scoring in one paragraph.
- Tell the model to explore several approaches in parallel.
- If it stalls, add only a prompt to think more broadly.
Try It
# Paste into Claude Code or Claude (simplified version of the paper's method: closed evaluator loop)
You are an engineer improving {{code/function to optimize}}. The evaluation script below prints correctness and a score. The score is {{score definition, e.g. runtime x memory}}; lower is better.
Evaluation script: {{path or contents of evaluate.py}}
Rules: 1) Propose one design at a time and run it to check the score. 2) If it is incorrect, the score is invalid. 3) Do not ask me questions; iterate for {{N}} rounds. 4) Explore 3 different approaches in parallel. 5) Look for structural properties of the problem rather than simple tuning.
Next step: ask for a table of scores per attempt and an explanation of why the best design works.Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.