Search papers, labs, and topics across Lattice.
This study introduces the quantum-api-drift benchmark to evaluate the ability of large language models (LLMs) to generate quantum code that aligns with specific software development kit (SDK) versions, focusing on Qiskit across multiple versions. The evaluation of 17 models on 50 tasks reveals significant variability in version fidelity, with Pass@1 scores ranging from 0.02 to 0.85, highlighting the challenges posed by API drift in quantum programming. Notably, while stronger models exhibit better performance, they also encounter distinct failure modes, indicating that even with documentation-guided repair, the recovery from API drift is only partially effective.
Version alignment in LLM-generated quantum code is a critical challenge, with only 0.02 to 0.85 success rates across different models and SDK versions.
Large language models can generate plausible quantum code, but it is unclear whether they can reliably target the specific software development kit (SDK) version requested by the user. We study this problem as API drift and introduce quantum-api-drift, a benchmark for measuring version fidelity, defined here as execution success on the requested SDK version, cross-version compatibility, failure modes, and documentation-guided repair in LLM-generated quantum SDK code. We instantiate the benchmark with Qiskit, a representative quantum SDK that underwent substantial interface changes across v0.43, v1.3, and v2.0. We evaluate 17 models on 50 tasks with 3 samples per prompt, yielding 450 generated samples and 1,350 executions per model. Sixteen models are tested in a matched REST API setting with a 1024-token output cap, while GPT-5.4 (Codex CLI) is reported separately as a reference configuration. Across the 16 matched REST models, diagonal Pass@1 ranges from 0.02 to 0.85. Claude Opus 4.7 is strongest on v0.43 and v2.0, while Grok 4.20 is strongest on v1.3 at 0.513. Error profiles differ systematically by model strength: weaker models fail mainly with broken imports, while stronger models more often reach deprecation-level failures. Documentation-guided repair succeeds for 0.19 to 0.59 of repair attempts overall and is consistently much more effective for migration to v2.0 than to v1.3. The benchmark artifacts are publicly available at https://github.com/arasyi/quantum-api-drift. These results show that version alignment is a distinct evaluation axis for quantum code generation and that API drift remains only partly recoverable even with migration guidance.