Qiskit Code Migration with LLMs
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.