As quantum computing continues to grow, moving programs between different quantum software platforms is a tricky and time-consuming task. A new research paper explores how artificial intelligence (AI) language models can help translate quantum code from Qiskit, a popular quantum programming framework, into NVIDIA’s CUDA-Q, a platform designed for quantum processors on GPUs. This work matters because automating such translations could speed up quantum software development and make advanced quantum computing more accessible to researchers and developers.
Key Takeaways
- The researchers created a rigorous benchmark of 640 quantum code translation tasks, testing how well AI models convert Qiskit programs into CUDA-Q code that produces the exact same quantum state.
- Small AI models without any fine-tuning could not produce valid CUDA-Q code from Qiskit programs when asked to do so “zero-shot” (without prior examples).
- Fine-tuning some models improved translation accuracy up to around 92%, but performance varied depending on the model and the style of the input code.
- Even the best models struggled with translating real, complex quantum programs, scoring near zero on a set of real-world kernels, showing current AI still has limits in this area.
The research team focused on a very strict way of measuring success: the translated CUDA-Q code must prepare the exact same quantum state as the original Qiskit program, with a fidelity of at least 0.999. This means the results are judged by actual quantum behavior, not just by matching text or relying on AI-generated assessments. This approach ensures the translation truly preserves the program’s function, which is crucial for quantum computing where tiny differences can matter a lot.
To test this, the researchers built a large benchmark containing different types of quantum circuits, including bigger circuits, entirely new families of circuits the models had not seen before, and different coding styles. They also included a set of regression tests called QuantumKatas to evaluate if the models retained knowledge of basic quantum operations. Several baseline methods were compared: a simple text substitution approach, a converter that executes Qiskit code and maps the resulting circuit, and various AI language models both with and without fine-tuning.
“Fine-tuning” means training an AI model further on specific examples to improve its performance on a particular task. The paper tested fine-tuning using LoRA (Low-Rank Adaptation), a method that adapts large language models efficiently without retraining them from scratch. Results showed that fine-tuning sometimes helped models outperform prompting (giving the model a few examples as instructions), but this depended strongly on the base model used. For instance, a 7-billion-parameter model (Qwen2.5-Coder) benefited noticeably from fine-tuning, while a smaller 4-billion-parameter model (Nemotron 3 Nano) showed mixed results.
One interesting finding was that mixing two different formats of replaying quantum circuits during training gave the best balance between translation accuracy and maintaining knowledge of fundamental quantum operations. However, when the task involved parametric functions that require kernels with arguments—more like real-world quantum programs—models’ performance dropped, and for actual quantum kernels from the QED-C benchmark, all models failed to translate correctly.
These results highlight that while AI can begin to automate simple quantum code translation, there is still a long way to go before it can handle complex, practical quantum software reliably. The strict testing method used in this study sets a new standard for evaluating AI’s ability to translate quantum programs by focusing on execution correctness rather than superficial text similarity.
Looking ahead, this research suggests promising directions for improving AI-assisted quantum programming tools, such as developing larger or more specialized models, refining fine-tuning techniques, and expanding benchmarks to cover more realistic quantum applications. Automating quantum code translation could ultimately accelerate cross-platform quantum software development, helping scientists and engineers bring quantum algorithms from theory to practice more efficiently.
Based on research published on arXiv by Ana Paula Appel.
