Qiskit Code Migration with LLMs

📅 2026-06-18
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenges of code maintenance and limited reusability arising from the rapid iteration of quantum computing frameworks such as Qiskit, compounded by the tendency of general-purpose large language models to hallucinate due to a lack of high-quality, version-specific training data. To overcome these issues, the authors propose a retrieval-augmented generation (RAG) architecture grounded in a transfer scenario classification framework, integrating structured knowledge guidance with a version-aware retrieval strategy to enable automated and scalable cross-version code migration. Experimental results demonstrate that the proposed approach significantly improves both the accuracy and descriptive quality of migration recommendations. Under constrained retrieval settings, Gemini Flash-2.5 achieves superior performance on complex refactoring tasks, effectively mitigating API obsolescence.
📝 Abstract
The rapid evolution of Quantum Development Kits (QDKs) introduces a specific form of technical debt that compromises code maintainability and hinders software reuse. In the specialized domain of Quantum Software Engineering (QSE), this challenge is intensified by the scarcity of high-quality training data and the high volatility of emerging frameworks, which often lead general-purpose Large Language Models (LLMs) to produce unreliable or hallucinated results. This paper proposes a hybrid approach integrating LLMs with Retrieval-Augmented Generation (RAG) to automate the migration of Qiskit code across versions. The proposed methodology enhances the precision and reliability of migration suggestions by leveraging an automatically generated taxonomy of migration scenarios as the structured, version-specific knowledge source to guide the models. The approach is implemented through an automated, extensible workflow evaluating LLMs (Google Gemini Flash-2.5 and OpenAI Gpt-oss-20b) under different retrieval schemes (unconstrained and restrictive). Results demonstrate that the taxonomy-based RAG architecture, particularly under the restrictive scheme, significantly reduces hallucinations and improves descriptive quality, with Google Gemini Flash-2.5 showing superior performance in detecting complex refactoring scenarios. These findings confirm the potential of this data-centric methodology to foster technological independence and provide robust, intelligent assistants that mitigate API obsolescence, ensuring the long-term availability of quantum algorithms within a rapidly shifting ecosystem and flattening the learning curve within Quantum Software Engineering (QSE).
Problem

Research questions and friction points this paper is trying to address.

Quantum Software Engineering
Qiskit Code Migration
Technical Debt
Large Language Models
API Obsolescence
Innovation

Methods, ideas, or system contributions that make the work stand out.

Retrieval-Augmented Generation
Qiskit code migration
taxonomy-based knowledge
Large Language Models
Quantum Software Engineering
🔎 Similar Papers
No similar papers found.
J
Jose Manuel Suarez
Laboratorio de Investigación y Formación en Informática Avanzada (LIFIA); Facultad de Informática - Universidad Nacional de La Plata, Buenos Aires, Argentina
L
Luis Mariano Bibbo
Laboratorio de Investigación y Formación en Informática Avanzada (LIFIA); Facultad de Informática - Universidad Nacional de La Plata, Buenos Aires, Argentina
J
Joaquin Bogado
Laboratorio de Investigación y Formación en Informática Avanzada (LIFIA); Facultad de Informática - Universidad Nacional de La Plata, Buenos Aires, Argentina
A
Alenandro Fernandez
Laboratorio de Investigación y Formación en Informática Avanzada (LIFIA); Facultad de Informática - Universidad Nacional de La Plata, Buenos Aires, Argentina; Comisión de Investigación Científica - CIC Bs.As.