用微调大模型生成量子线路,实现自动优化与可执行代码输出
Agent-Q: Fine-Tuning Large Language Models for Quantum Circuit Generation and Optimization
- 通过构建14000条量子线路数据集,微调大模型生成符合OpenQASM 3.0语法的参数化线路
- 在12个优化问题上生成的线路期望值优于随机初始化,接近最优解
- 生成的线路可直接用于量子机器学习模板或编译器基准测试
大型语言模型(LLMs)在数学、编程和科学报告分析等复杂任务中表现卓越,但在量子计算领域仍鲜有探索。核心挑战在于如何大规模自动生成量子线路。现有预训练模型缺乏量子线路知识。本文提出Agent-Q,一个针对量子电路生成与优化的微调系统。Agent-Q构建了涵盖12类优化问题及其对应的QAOA、VQE和自适应VQE电路的14,000条量子线路数据集,并建立端到端微调流程,使预训练模型能生成符合OpenQASM 3.0语法的参数化量子线路。实验表明,生成的线路在期望值和分布上优于随机初始化,且接近最优解。该系统可集成至智能体工作流,生成的带初始参数线路可作为量子机器学习模板或编译器/硬件的基准。
原文摘要 · Abstract (English)
Large language models (LLMs) have achieved remarkable outcomes in complex problems, including math, coding, and analyzing large amounts of scientific reports. Yet, few works have explored the potential of LLMs in quantum computing. The most challenging problem is to leverage LLMs to automatically generate quantum circuits at a large scale. Fundamentally, the existing pre-trained LLMs lack the knowledge of quantum circuits. In this paper, we address this challenge by fine-tuning LLMs and injecting the domain-specific knowledge of quantum computing. We describe Agent-Q, an LLM fine-tuning system to generate and optimize quantum circuits. In particular, Agent-Q implements the mechanisms to generate training data sets and constructs an end-to-end pipeline to fine-tune pre-trained LLMs to generate parameterized quantum circuits for various optimization problems. Agent-Q provides 14,000 quantum circuits covering a large spectrum of the quantum optimization landscape: 12 optimization problem instances and their optimized QAOA, VQE, and adaptive VQE circuits. Based thereon, Agent-Q fine-tunes LLMs and constructs syntactically correct parametrized quantum circuits in OpenQASM 3.0. We have evaluated the quality of the LLM-generated circuits and parameters by comparing them to the optimized expectation values and distributions. Experimental results show superior performance of Agent-Q, compared to several state-of-the-art LLMs and better parameters than random. Agent-Q can be integrated into an agentic workflow, and the generated parametrized circuits with initial parameters can be used as a starting point for further optimization, e.g., as templates in quantum machine learning and as benchmarks for compilers and hardware.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。