AI Insight
QAgent is a novel multi-agent framework that uses large language models to autonomously generate OpenQASM quantum circuit code through a coordinated planning-synthesis-calibration workflow. The system employs retrieval-augmented generation to access quantum programming knowledge and maintains execution accuracy through iterative feedback and hardware-aware calibration. Testing across 12 quantum computing kernels and five different LLMs showed QAgent improved code generation accuracy by 47-70% for single tasks and achieved over 88% accuracy for multi-kernel workflows, while maintaining high execution fidelity under realistic hardware conditions.
Why it matters
This advancement could significantly reduce the technical barrier to quantum programming by automating the complex process of writing hardware-optimized quantum circuits. The system's ability to maintain performance under real-world hardware imperfections makes it particularly valuable for practical quantum computing applications on current noisy intermediate-scale quantum devices.
Understand the Science
arXiv:2508.20134v2 Announce Type: replace
Abstract: 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
Source: QAgent: An LLM-based Multi-Agent System for Autonomous OpenQASM programming