Large Language Models for Quantum Code Translation: An Exploratory Study
Abstract
Quantum software development is challenged by quantum-mechanical semantics and fragmented software development kits (SDKs), which complicate cross-SDK code translation and execution. In this paper, we propose an LLM-based approach for translating executable programs between high-level quantum SDKs. We develop a quantum-aware translation workflow whose prompt design and validation reflect quantum semantics and accommodate the version evolution of quantum ecosystems. We conduct a preliminary evaluation of 4 LLM configurations on 43 tasks, translating Qiskit programs to PennyLane and Q#. LLMs achieve a zero-shot Pass@1 of up to 72.33%, while one-shot prompting further improves the translation effectiveness. These results suggest potential for quantum code translation by LLMs.
Related
- Large-Language-Model Discovery of Quantum LDPC Codes through Structured Concept Evolution
- Discovering state-of-the-art quantum circuits with large language models
- QEncodeBench: Can Large Language Models Encode Classical Problems into Verified Quantum Oracles?
- Track fitting as a language translation problem
- The WEST code for large-scale excited-state materials simulations
BibTeX
@misc{li2026large,
title = {{Large Language Models for Quantum Code Translation: An Exploratory Study}},
author = {Xiyuan Li and Yuechen Li and Jianjun Zhao},
howpublished = {arXiv},
year = {2026},
month = oct,
doi = {10.48550/arxiv.2610.34841},
eprint = {2610.34841},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2610.34841},
note = {CC BY 4.0},
}
RIS
TY - UNPB
TI - Large Language Models for Quantum Code Translation: An Exploratory Study
AU - Xiyuan Li
AU - Yuechen Li
AU - Jianjun Zhao
PY - 2026
DA - 2026/10/26
PB - arXiv
DO - 10.48550/arxiv.2610.34841
UR - https://arxiv.org/abs/2610.34841
AB - Quantum software development is challenged by quantum-mechanical semantics and fragmented software development kits (SDKs), which complicate cross-SDK code translation and execution. In this paper, we propose an LLM-based approach for translating executable programs between high-level quantum SDKs. We develop a quantum-aware translation workflow whose prompt design and validation reflect quantum semantics and accommodate the version evolution of quantum ecosystems. We conduct a preliminary evaluation of 4 LLM configurations on 43 tasks, translating Qiskit programs to PennyLane and Q#. LLMs achieve a zero-shot Pass@1 of up to 72.33%, while one-shot prompting further improves the translation effectiveness. These results suggest potential for quantum code translation by LLMs.
ER -