Circuit Partitioning Using Large Language Models for Quantum Compilation and Simulations

📄 arXiv: 2505.07711v1 📥 PDF

作者: Pranav Sinha, Sumit Kumar Jha, Sunny Raj

分类: cs.ET, cs.AI, quant-ph

发布日期: 2025-05-12

备注: 7 pages, 2 tables and 3 figures


💡 一句话要点

利用大语言模型进行量子电路划分,优化量子编译与模拟

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 量子电路划分 大语言模型 量子编译 量子模拟 QASM 微调 NISQ

📋 核心要点

  1. 现有的量子电路编译算法在处理大型量子电路时面临计算瓶颈,且启发式方法忽略了下游门电路最小化任务。
  2. 论文提出利用大语言模型(LLM)理解和生成QASM代码的能力,学习并改进量子电路的划分策略。
  3. 实验结果表明,通过对开源LLM进行微调,可以显著提高量子电路划分的准确率,达到53.4%。

📝 摘要(中文)

在含噪声的中等规模量子(NISQ)时代,量子计算机受到噪声门电路的限制,其中一些门电路比其他门电路更容易出错,可能导致最终计算结果无法理解。量子电路编译算法试图在将量子算法映射到量子硬件时最小化这些噪声门电路,但面临计算挑战,限制了它们在不超过5-6个量子比特的电路上的应用,因此需要在应用噪声量子门最小化算法之前划分大型电路。现有的这些算法本质上是启发式的,没有考虑下游的门电路最小化任务。大型语言模型(LLM)有潜力改变这一点,并帮助改进量子电路划分。本文研究了使用LLM(如Llama和Mistral)来划分量子电路,利用它们理解和生成代码(包括QASM)的能力。具体来说,我们教LLM使用伯克利量子合成工具包的快速划分方法来划分电路。通过实验评估,我们表明,对开源LLM进行仔细的微调使我们能够获得53.4%的划分准确率,而开箱即用的LLM无法正确划分电路,使用标准的一次性(1-shot)和少样本(few-shot)训练方法。

🔬 方法详解

问题定义:论文旨在解决量子电路编译中,由于量子比特数量增加导致的计算复杂度过高的问题。现有的启发式电路划分方法无法有效降低噪声门电路的影响,且忽略了后续的门电路最小化步骤,导致整体性能受限。

核心思路:利用大语言模型(LLM)强大的代码理解和生成能力,将量子电路划分问题转化为一个代码生成或理解的任务。通过训练LLM,使其能够学习到有效的电路划分策略,从而降低后续量子编译和模拟的复杂度。这种方法旨在让LLM学习到更优的划分方案,从而更好地适应下游的门电路最小化任务。

技术框架:整体流程包括:1)准备量子电路数据集,使用QASM格式;2)选择合适的LLM,如Llama或Mistral;3)使用伯克利量子合成工具包的快速划分方法作为指导,对LLM进行微调,使其学习电路划分;4)使用训练好的LLM对新的量子电路进行划分;5)评估划分结果的准确率。

关键创新:该论文的关键创新在于将大语言模型应用于量子电路划分问题。与传统的启发式算法相比,LLM能够学习到更复杂的电路结构信息,并生成更优的划分方案。此外,通过微调LLM,可以使其更好地适应特定的量子硬件和噪声模型。

关键设计:论文使用开源的LLM模型,并采用微调的方式进行训练。训练数据包括量子电路的QASM代码和对应的划分方案。损失函数的设计需要考虑划分的准确率和后续门电路最小化的效果。具体的参数设置和网络结构取决于所选择的LLM模型。

🖼️ 关键图片

fig_0
fig_1

📊 实验亮点

实验结果表明,经过微调的开源LLM在量子电路划分任务中取得了显著的性能提升,准确率达到53.4%。相比之下,未经训练的LLM(使用1-shot和few-shot方法)无法正确划分电路。这表明,通过合适的训练策略,LLM可以有效地学习量子电路的结构信息,并生成高质量的划分方案。

🎯 应用场景

该研究成果可应用于量子计算的多个领域,包括量子算法设计、量子电路优化和量子计算机架构。通过更有效地划分量子电路,可以降低量子编译的复杂性,提高量子模拟的效率,并最终促进量子计算机的实际应用。此外,该方法还可以推广到其他量子计算任务中,例如量子纠错和量子控制。

📄 摘要(原文)

We are in the midst of the noisy intermediate-scale quantum (NISQ) era, where quantum computers are limited by noisy gates, some of which are more error-prone than others and can render the final computation incomprehensible. Quantum circuit compilation algorithms attempt to minimize these noisy gates when mapping quantum algorithms onto quantum hardware but face computational challenges that restrict their application to circuits with no more than 5-6 qubits, necessitating the need to partition large circuits before the application of noisy quantum gate minimization algorithms. The existing generation of these algorithms is heuristic in nature and does not account for downstream gate minimization tasks. Large language models (LLMs) have the potential to change this and help improve quantum circuit partitions. This paper investigates the use of LLMs, such as Llama and Mistral, for partitioning quantum circuits by capitalizing on their abilities to understand and generate code, including QASM. Specifically, we teach LLMs to partition circuits using the quick partition approach of the Berkeley Quantum Synthesis Toolkit. Through experimental evaluations, we show that careful fine-tuning of open source LLMs enables us to obtain an accuracy of 53.4% for the partition task while over-the-shelf LLMs are unable to correctly partition circuits, using standard 1-shot and few-shot training approaches.