TRANSMISSION // 2611.29793v1
When AI Translates Quantum Code, Correctness Is More Than Syntax
Source published
A study tests whether fine-tuning helps language models translate Qiskit into CUDA-Q. Results depend on the model, and translation gains can come with weaker Qiskit performance.

A quantum program can look plausible, compile and still prepare the wrong state. This study compares language-model translations by running the original Qiskit code and generated CUDA-Q kernel, then checking their quantum states. Its findings show why evaluation matters as much as the choice between prompting and fine-tuning.
Moving quantum code between frameworks is a practical adoption cost, the paper argues. It asks whether small, open language models can translate Qiskit code into NVIDIA’s CUDA-Q, and whether fine-tuning works better than giving a model examples in its prompt.
The challenge is not just producing code that looks right. The researchers ran each Qiskit program and its proposed CUDA-Q kernel, then compared the resulting quantum states. A translation counted as equivalent if fidelity was at least 0.999. This comparison ignores global phase, which does not change the physical state, but can detect differences in relative phase. The verifier checked more than whether code compiled and did not rely on an AI judge.
That distinction matters because circuits can produce the same measurement probabilities while differing in relative phase. In tests of deliberately altered circuits, measurement counts missed all 150 phase-only errors. The state-comparison verifier rejected nearly all tested changes that altered the state, though three passed at fidelity as high as 0.9997. The authors also tested fake outputs and translation baselines before training, recognizing that the evaluation method can shape the apparent result.
What the benchmark tested
The main benchmark contained 640 tasks, with separate tests for larger circuits, an unseen circuit family and unfamiliar Qiskit coding styles. The researchers also used QuantumKatas, a collection of Qiskit exercises, to check whether specializing a model for CUDA-Q harmed its ability to write Qiskit.
Some tests could be solved without understanding the source code: simple text-replacement rules achieved perfect scores on the larger-circuit and unseen-family tests. A separate converter that first executed the Qiskit program and then mapped the resulting circuit to CUDA-Q solved all 640 tasks. It converts the circuit produced by running the source, rather than preserving the source program’s structure. Its success shows that for static circuits executable at conversion time, a language model may not be needed; it does not show that the converter can translate program structure.
Fine-tuning did not win in every case
On NVIDIA’s Nemotron 3 Nano 4B model, fine-tuning with LoRA—a method that adapts a model by training a limited set of parameters—achieved 83.9% state-equivalent translations across the 640 tasks. A four-example prompt achieved 83.1%, a result the paper describes as a tie overall. On unfamiliar code style, the prompt scored 65.5%, compared with 48.5% for fine-tuning.
On Qwen2.5-Coder models at 1.5 billion and 7 billion parameters, fine-tuning did better than prompting overall. For the 7B model, the scores were 92.0% versus 82.8%; on the unseen-style test, they were 78.5% versus 65.0%. Whether fine-tuning beats prompting therefore depended on the model tested.
Fine-tuning also came with a cost: scores on the Qiskit exercise probe fell for all three fine-tuned models. For Nemotron 4B, the score dropped from 23.8% for the unchanged model to 8.9% after fine-tuning. In the main Nemotron LoRA results, researchers identified syntax interference: the model retained Qiskit code structures but inserted CUDA-Q-style operations. Other model variants showed different failure patterns, so this explanation should not be generalized to every error.
Mixing two kinds of Qiskit replay examples gave the best tested compromise for Nemotron: 84.4% on translation and 21.5% on QuantumKatas, compared with 23.8% for the unchanged model. That is a partial recovery, not proof that the trade-off has disappeared.
What remains uncertain
The main benchmark covers generated circuits, state preparation, a fixed gate set and circuits of up to seven qubits, using noiseless simulation. In a separate test of 48 short, generated parametric functions—programs that take inputs—the best reported model result was 83%. But on 27 tasks drawn from real QED-C benchmark kernels, none of the tested models produced an equivalent translation. A converter handled those examples by executing the source and mapping the resulting static circuit; it did not preserve the programs’ structure.
The authors distinguish translating short, controlled examples from porting real programs with functions, branches and sub-circuits. The study does not establish that these models can reliably migrate practical quantum applications or produce idiomatic code that uses each framework’s features well. The QED-C evaluation covers 27 tasks, the pass-at-five comparison covers 120 held-out-idiom tasks, and unseen-style results varied across training seeds.
The verifier was calibrated for CUDA-Q 0.16.0 with the qpp-cpu simulator and Qiskit 2.6.1. Its 0.999 threshold let three altered-state test cases pass, although the authors report that changing the threshold did not substantially alter model results. These findings may not transfer to other software versions or evaluation settings.
This article is based on an arXiv preprint dated November 2026; the supplied material does not establish whether it has undergone peer review. The paper reports that its code, generated benchmark and evaluation scripts are publicly available. We have not independently reproduced the results. The central lesson is narrower than “fine-tuning works” or “prompting is better”: test whether translated code preserves quantum-state behavior, and check what specialization costs in the model’s original framework.
- quantum computing
- Qiskit
- CUDA-Q
- language models
- code translation
- fine-tuning
- benchmarking
Reviewed cross-references
These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.
Targeted AI repairs improve scientific code translation—but simple tests miss errors
Shared method: Both studies use execution to assess translated code rather than relying only on textual similarity: Appel compares quantum state vectors, while Shen et al. check scientific-kernel outputs. The verification targets differ—state fidelity in a noiseless quantum simulator versus numerical output and execution behavior across HPC frameworks—so this is a shared broad method, not a directly comparable correctness metric.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2611.29793v1 — Original paper
Excerpt reference:
static/papers/2611.29793v1.md:13-50
Basis: Paper text
Source SHA-256:dac0afc8690cee46b40cd12cd7cb13040fee8785c753c26dddaa527926b007502611.08947v1 — Original paper
Excerpt reference:
static/papers/2611.08947v1.md:132-203
Basis: Paper text
Source SHA-256:de224fcf2c0a62b65d7dbfea1b6fe755c2583bb2bfc1afd7d402fdb2ab2c5d23
What counts as success in AI software migration?
Supporting evidence: Both sources illustrate why migration success depends on what is verified: Appel reports that syntax-oriented approaches and measurement counts can miss semantic errors, while Zhang et al.’s survey finds that migration studies use distinct forms of acceptance evidence that cannot be collapsed into one success rate. The survey covers diverse migration tasks and reports review-level findings, not a direct evaluation of quantum translation.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2611.29793v1 — Original paper
Excerpt reference:
static/papers/2611.29793v1.md:13-50
Basis: Paper text
Source SHA-256:dac0afc8690cee46b40cd12cd7cb13040fee8785c753c26dddaa527926b007502611.29942v1 — Original paper
Excerpt reference:
static/papers/2611.29942v1.md:16-67
Basis: Paper text
Source SHA-256:b792d40667c352278f326b7304160e183fb68e5a4530ebf15bde0dcd96ff7ede
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
Quantum cloud test shows why qubit counts are not enough
Source published
Shared keywords: quantum computing
When Do Eighth-Order Quantum Simulation Formulas Help?
Source published
Shared keywords: quantum computing
Targeted AI repairs improve scientific code translation—but simple tests miss errors
Source published
Shared keywords: code translation
Choosing a quantum data encoding, with help from an agent
Source published
Shared keywords: quantum computing
A Proposed Quantum Route to Ligand-Pose Retrieval
Source published
Shared keywords: quantum computing