# QAgent: An LLM-based Multi-Agent System for Autonomous OpenQASM programming

arXiv: https://arxiv.org/abs/2508.20134 · HTML: https://mlsanity.com/paper/2508.20134/

## Key facts

- Cited by 11 papers in the map (data through 14 Oct 2026).
- Placed in Medical and scientific domain agents, one of 16 directions in LLM agents and tool use.
- Builds on 22 of its 49 references that are in the map.
- First posted on arXiv 26 Aug 2025.

## Placed in

- LLM agents and tool use / [Medical and scientific domain agents](https://mlsanity.com/agents/medical-and-scientific-domain-agents/)

## Builds on (most cited first, 22 of 22)

- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://mlsanity.com/paper/2005.11401/) (2020)
- [ReAct: Synergizing Reasoning and Acting in Language Models](https://mlsanity.com/paper/2210.03629/) (2022)
- [Evaluating Large Language Models Trained on Code](https://mlsanity.com/paper/2107.03374/) (2021)
- [gpt-oss-120b & gpt-oss-20b Model Card](https://mlsanity.com/paper/2508.10925/) (2025)
- [Qwen2.5-Coder Technical Report](https://mlsanity.com/paper/2409.12186/) (2024)
- [Executable Code Actions Elicit Better LLM Agents](https://mlsanity.com/paper/2402.01030/) (2024)
- [Quantum advantage in learning from experiments](https://mlsanity.com/paper/2112.00778/) (2021)
- [CodeGen2: Lessons for Training LLMs on Programming and Natural Languages](https://mlsanity.com/paper/2305.02309/) (2023)
- [WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment](https://mlsanity.com/paper/2402.12275/) (2024)
- [BetterV: Controlled Verilog Generation with Discriminative Guidance](https://mlsanity.com/paper/2402.03375/) (2024)
- [VerilogCoder: Autonomous Verilog Coding Agents with Graph-based Planning and Abstract Syntax Tree (AST)-based Waveform Tracing Tool](https://mlsanity.com/paper/2408.08927/) (2024)
- [El Agente: An Autonomous Agent for Quantum Chemistry](https://mlsanity.com/paper/2505.02484/) (2025)
- [Qiskit HumanEval: An Evaluation Benchmark For Quantum Code Generative Models](https://mlsanity.com/paper/2406.14712/) (2024)
- [Qiskit Code Assistant: Training LLMs for generating Quantum Computing Code](https://mlsanity.com/paper/2405.19495/) (2024)
- [Devstral: Fine-tuning Language Models for Coding Agent Applications](https://mlsanity.com/paper/2509.25193/) (2025)
- [Quantum Many-Body Physics Calculations with Large Language Models](https://mlsanity.com/paper/2403.03154/) (2024)
- [Enhancing LLM-based Quantum Code Generation with Multi-Agent Optimization and Quantum Error Correction](https://mlsanity.com/paper/2504.14557/) (2025)
- [Exploring LLM-Driven Explanations for Quantum Algorithms](https://mlsanity.com/paper/2409.19028/) (2024)
- [Testing and Debugging Quantum Programs: The Road to 2030](https://mlsanity.com/paper/2405.09178/) (2024)
- [OpenQL : A Portable Quantum Programming Framework for Quantum Accelerators](https://mlsanity.com/paper/2005.13283/) (2020)
- [Quantum Advantage in Cryptography](https://mlsanity.com/paper/2206.04078/) (2022)
- [Circuit Partitioning Using Large Language Models for Quantum Compilation and Simulations](https://mlsanity.com/paper/2505.07711/) (2025)

## Built on by (most cited first, 11 of 11)

- [QUASAR: Quantum Assembly Code Generation Using Tool-Augmented LLMs via Agentic RL](https://mlsanity.com/paper/2510.00967/) (2025)
- [QuantumQA: Enhancing Scientific Reasoning via Physics-Consistent Dataset and Verification-Aware Reinforcement Learning](https://mlsanity.com/paper/2604.18176/) (2026)
- [Aligning Quantum Operators with Large Language Models](https://mlsanity.com/paper/2606.13811/) (2026)
- [Generative AI for Quantum Circuits and Quantum Code: A Technical Review and Taxonomy](https://mlsanity.com/paper/2603.16216/) (2026)
- [An LLM System for Autonomous Variational Quantum Circuit Design](https://mlsanity.com/paper/2606.13380/) (2026)
- [Fine-Tuning Large Language Models for Quantum Reasoning](https://mlsanity.com/paper/2606.21974/) (2026)
- [When AI meets quantum information: A comprehensive review](https://mlsanity.com/paper/2607.00365/) (2026)
- [Leveraging LLM-Based Agentic Systems to Generate Quantum Applications for Test Optimization](https://mlsanity.com/paper/2607.00939/) (2026)
- [Hybrid LLM-Guided Search for Quantum Reservoir Architecture Design](https://mlsanity.com/paper/2607.19506/) (2026)
- [QuantumMind: Constraint-Grounded Agentic Reasoning for Speedup Analysis in Quantum Computing](https://mlsanity.com/paper/2608.07743/) (2026)
- [QEncodeBench: Can Large Language Models Encode Classical Problems into Verified Quantum Oracles?](https://mlsanity.com/paper/2609.20319/) (2026)

## Abstract (arXiv)

Programming quantum circuits at the OpenQASM level is essential for achieving hardware-aware optimization and reliable execution on noisy intermediate-scale quantum (NISQ) devices, yet it remains challenging due to the need for domain-specific planning, iterative code synthesis, and low-level calibration. In this paper, we present QAgent, the first autonomous multi-agent framework for end-to-end OpenQASM code generation. QAgent integrates schema-aware task planning, example- and tool-driven code synthesis, and hardware-aware calibration within a unified planning-synthesis-calibration workflow. The system leverages retrieval-augmented generation (RAG) to access structured kernel knowledge, examples, and backend constraints, and employs coordinated multi-agent reasoning with iterative execution feedback to ensure correctness. We evaluate QAgent on 12 representative quantum kernels and their compositions across five large language models (LLMs). Results show that QAgent improves Pass@1 accuracy by 47-70% on single-kernel tasks and achieves over 88% accuracy on multi-kernel workflows for large models, substantially outperforming existing baselines. Furthermore, under realistic hardware frequency drift, QAgent maintains near-unit execution fidelity through automated calibration, whereas SDK-based LLM methods suffer significant degradation. These results demonstrate that integrating planning, synthesis, and calibration is critical for reliable quantum program generation. The implementation of QAgent is open-sourced at https://github.com/fuzhenxiao/QAgent
