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.
Create a lesson
Metadata
- Categories
- cs.SE, quant-ph
Related papers
Scientific Coding with Large Language Models: Evidence from Finite Element Analysis
Shared title terminologycs.SEErfan Hamdi, Joel Shor, Emma Lejeune
Beyond Benchmarks: Evaluating Large Language Models and Agentic Patterns for Static Code Analysis Warning Classification
Shared title terminologycs.SELakmal Deshapriya, Sherlock A. Licorish, Brendon J. Woodford et al.
Barriers to GenAI Integration During Large-Scale Agile Transformation: An Exploratory Case Study
Shared title terminologycs.SENils Brede Moe, Marthe Berntzen, Astri Barbala et al.
From Industrial Product Documentation to Automated Digital Product Passport Generation: An Experimental Study of Large Language Models
Shared title terminologycs.SEMarco Buecheler, Grant Richards, Nathan Hartman
Reliability is a user-specific property of large language models
Shared title terminologycs.SEXingyu Zhao
A Survey on RLOps for Large Language Models
Shared title terminologycs.SELingzhe Zhang, Tong Jia, Chiming Duan et al.