arXiv:2507.12480cs.SEcs.AI2025-07被引 2

用大模型自动转换量子代码,跨平台开发更轻松。

LLM-Powered Quantum Code Transpilation

  • 用大模型做量子代码转换,不依赖人工规则。
  • 可实现不同量子开发工具间的功能等价转换。
  • 适合需要多平台部署的量子软件开发者。

存在多种针对不同量子计算平台的软件开发工具包(QSDKs),如Qiskit、Cirq和PennyLane。这些工具包的多样性带来了互操作性与跨平台开发的重大挑战。传统基于规则的代码转换器设计和维护耗时且需深厚专业知识,依赖于源代码与目标代码间的刚性映射。本研究探索利用大语言模型(LLMs)作为灵活、自动化的解决方案。借助其预训练知识和上下文推理能力,将LLMs定位为编程语言无关的转换器,可在保持功能等价的前提下,将量子程序从一个QSDK转换到另一个。该方法无需手动定义转换规则,为量子软件可移植性提供可扩展方案。此项工作标志着迈向量子计算生态中智能通用代码转换的重要一步。

原文摘要 · Abstract (English)

There exist various Software Development Kits (SDKs) tailored to different quantum computing platforms. These are known as Quantum SDKs (QSDKs). Examples include but are not limited to Qiskit, Cirq, and PennyLane. However, this diversity presents significant challenges for interoperability and cross-platform development of hybrid quantum-classical software systems. Traditional rule-based transpilers for translating code between QSDKs are time-consuming to design and maintain, requiring deep expertise and rigid mappings in the source and destination code. In this study, we explore the use of Large Language Models (LLMs) as a flexible and automated solution. Leveraging their pretrained knowledge and contextual reasoning capabilities, we position LLMs as programming language-agnostic transpilers capable of converting quantum programs from one QSDK to another while preserving functional equivalence. Our approach eliminates the need for manually defined transformation rules and offers a scalable solution to quantum software portability. This work represents a step toward enabling intelligent, general-purpose transpilation in the quantum computing ecosystem.

量子计算大模型代码转换

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。