Migración de código en Qiskit utilizando LLMs
Palabras clave:
ingeniería de software cuántico, migración de código, grandes modelos de lenguaje, Qiskit, inteligencia artificial generativaResumen
La rápida evolución de los kits de desarrollo cuántico (QDKs) introduce una forma específica de deuda técnica que compromete la mantenibilidad del código y dificulta la reutilización del software. En el dominio específico de la Ingeniería de Software Cuántico (QSE), este desafío se intensifica por la escasez de datos de entrenamiento de alta calidad y la alta volatilidad de los marcos de trabajo emergentes, lo que a menudo lleva a los modelos de lenguaje de gran tamaño (LLMs) de propósito general a producir resultados poco fiables o alucinaciones. Este artículo propone un enfoque híbrido que integra LLMs con la técnica de Generación Aumentada por Recuperación (RAG) para automatizar la migración de código entre versiones Qiskit. La metodología propuesta mejora la precisión y fiabilidad de las sugerencias de migración al aprovechar una taxonomía de escenarios de migración generada automáticamente como una fuente de conocimiento estructurada y específica de la versión para guiar a los modelos. El enfoque se implementa mediante un flujo de trabajo automatizado y extensible que evalúa LLMs (Google Gemini Flash-2.5 y OpenAI Gptoss-20b) bajo diferentes estrategias de recuperación (sin restricciones y restrictivo). Los resultados demuestran que la arquitectura RAG basada en taxonomía, particularmente bajo el esquema restrictivo, reduce significativamente las alucinaciones y mejora la calidad descriptiva, con Google Gemini Flash-2.5 mostrando un rendimiento superior en la detección de escenarios complejos de refactorización. Estos hallazgos confirman el potencial de esta metodología centrada en los datos para fomentar la independencia tecnológica y proporcionar asistentes inteligentes robustos que mitiguen la obsolescencia de las APIs, asegurando la disponibilidad a largo plazo de los algoritmos cuánticos dentro de un ecosistema que cambia rápidamente y reduciendo la curva de aprendizaje en QSE.
Descargas
Referencias
Abufarha, S., Marouf, A. A., Rokne, J. G., & Alhajj, R. (2026). Mitigating Prompt Dependency in Large Language Models: A Retrieval-Augmented Framework for Intelligent Code Assistance. Software, 5(1), 4. https://doi.org/10.3390/software5010004
Adermann, E., Kang, H., Sevior, M., & Usman, M. (2026, enero). Quantum Error Correction and Detection for Quantum Machine Learning [arXiv:2601.07223 [quantph]]. https://doi.org/10.48550/arXiv.2601.07223
Chen, Z., Hu, X., Xia, X., & Yang, X. (2026, febrero). Every Maintenance Has Its Exemplar: The Future of Software Maintenance through Migration [arXiv:2602.14046 [cs]]. https://doi.org/10.48550/arXiv.2602.14046
OpenAI. (2026, abril). Presentamos gpt-oss. Consultado el 6 de abril de 2026, desde https: //openai.com/es-ES/index/introducing-gpt-oss/
Panter, S. K., & Eisty, N. U. (2026, enero). Technical Lag as Latent Technical Debt: A Rapid Review [arXiv:2601.11693 [cs]]. https://doi.org/10.48550/arXiv.2601.11693
Wildon, M. (2026, febrero). Quantum computation and quantum error correction: the theoretical minimum [arXiv:2602.13876 [quant-ph]]. https://doi.org/10.48550/arXiv.2602.13876
Aasen, D., Aghaee, M., Alam, Z., Andrzejczuk, M., Antipov, A., Astafev, M., Avilovas, L., Barzegar, A., Bauer, B., Becker, J., Bello-Rivas, J. M., Bhaskar, U., Bocharov, A., Boddapati, S., Bohn, D., Bommer, J., Bonderson, P., Borovsky, J., Bourdet, L., . . . Zimmerman, A. (2025, julio). Roadmap to fault tolerant quantum computation using topological qubit arrays [arXiv:2502.12252 [quant-ph]]. https://doi.org/10.48550/arXiv.2502.12252
Ahmad, A., Waseem, M., Aljedaani, B., Fahmideh, M., Liang, P., & Awaysheh, F. (2025, octubre). Quantum Computing as a Service – a Software Engineering Perspective [arXiv:2510.04982 [cs]]. https://doi.org/10.48550/arXiv.2510.04982
Aragonés-Soria, Y., & Oriol, M. (2025, marzo). Architecture for a Trustworthy Quantum Chatbot [arXiv:2503.04875 [cs]]. https://doi.org/10.48550/arXiv.2503.04875
Asif, H., Basit, A., Innan, N., Kashif, M., Marchisio, A., & Shafique, M. (2025, marzo). PennyLang: Pioneering LLM-Based Quantum Code Generation with a Novel PennyLane-Centric Dataset [arXiv:2503.02497 [cs]]. https://doi.org/10.48550/arXiv.2503.02497
Bellur, A., Batole, F., Ullah, M. R., Dilhara, M., Zharov, Y., Bryksin, T., Ishikawa, K., Chen, H., Morimoto, M., Hosomi, T., Nguyen, T. N., Rajan, H., Tsantalis, N., & Dig, D. (2025). Together We are Better: LLM, IDE and Semantic Embedding to Assist Move Method Refactoring [Conference Name: 2025 IEEE International Conference on Software Maintenance and Evolution (ICSME) ISBN: 9798331595876]. 2025 IEEE International Conference on Software Maintenance and Evolution (ICSME), 1-13. https://doi.org/10.1109/ICSME64153.2025.00046
Campbell, C., Chen, H. M., Luk, W., & Fan, H. (2025, julio). Enhancing LLM-based Quantum Code Generation with Multi-Agent Optimization and Quantum Error Correction [arXiv:2504.14557 [quant-ph]]. https://doi.org/10.48550/arXiv.2504.14557
Closser, D. C., & Kabala, Z. J. (2025, julio). Pushing the Limits of LLMs in Quantum Operations [arXiv:2507.21327 [quant-ph]]. https://doi.org/10.48550/arXiv.2507.21327
Comanici, G., Bieber, E., Schaekermann, M., Pasupat, I., Sachdeva, N., Dhillon, I., Blistein, M., Ram, O., Zhang, D., Rosen, E., Marris, L., Petulla, S., Gaffney, C., Aharoni, A., Lintz, N., Pais, T. C., Jacobsson, H., Szpektor, I., Jiang, N.-J., . . . Hahn, C. (2025, julio). Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilities [arXiv:2507.06261 [cs] version: 1]. https://doi.org/10.48550/arXiv.2507.06261
Dobariya, O., & Kumar, A. (2025, octubre). Mind Your Tone: Investigating How Prompt Politeness Affects LLM Accuracy (short paper) [arXiv:2510.04950 [cs]]. https://doi.org/10.48550/arXiv.2510.04950
Gill, S. S., Cetinkaya, O., Marrone, S., Claudino, D., Haunschild, D., Schlote, L., Wu, H., Ottaviani, C., Liu, X., Machupalli, S. P., Kaur, K., Arora, P., Liu, J., Farouk, A., Song, H. H., Uhlig, S., & Ramamohanarao, K. (2025). Quantum Computing: Vision and Challenges [arXiv:2403.02240 [cs]]. https://doi.org/10.1016/B978-0-443-29096-1.00008-8
Henderson, E. R., Henderson, J. M., Ange, J., & Thornton, M. A. (2025, junio). Programming Quantum Computers with Large Language Models [arXiv:2506.18125 [quant-ph]]. https://doi.org/10.48550/arXiv.2506.18125
Hostnik, M., & Robnik-Šikonja, M. (2025). Retrieval-augmented code completion for local projects using large language models [arXiv:2408.05026 [cs]]. Expert Systems with Applications, 292, 128596. https://doi.org/10.1016/j.eswa.2025.128596
Khan, A. A., Taibi, D., & Akbar, M. A. (2025, abril). Advancing Quantum Software Engineering: A Vision of Hybrid Full-Stack Iterative Model [arXiv:2403.11670 [cs]]. https://doi.org/10.48550/arXiv.2403.11670
Kheiri, K., Aamir, A., Miranskyy, A., & Ding, C. (2025). QSpark: Towards Reliable Qiskit Code Generation [Version Number: 2]. https://doi.org/10.48550/ARXIV.2507.12642
Lammers, M. G., Holik, F. H., & Fernández, A. (2025, agosto). Quantum Resource Management in the NISQ Era: Implications and Perspectives from Software Engineering [arXiv:2508.05697 [quant-ph]]. https://doi.org/10.48550/arXiv.2508.05697
Li, Y., Fu, X., Verma, G., Buitelaar, P., & Liu, M. (2025, octubre). Mitigating Hallucination in Large Language Models (LLMs): An Application-Oriented Survey on RAG, Reasoning, and Agentic Systems [arXiv:2510.24476 [cs]]. https://doi.org/10.48550/arXiv.2510.24476
Mandal, A. K., Nadim, M., Roy, C. K., Roy, B., & Schneider, K. A. (2025, febrero). Quantum Software Engineering and Potential of Quantum Computing in Software Engineering Research: A Review [arXiv:2502.08925 [cs]]. https://doi.org/10.48550/arXiv.2502.08925
Minaee, S., Mikolov, T., Nikzad, N., Chenaghlu, M., Socher, R., Amatriain, X., & Gao, J. (2025, marzo). Large Language Models: A Survey [arXiv:2402.06196 [cs]]. https://doi.org/10.48550/arXiv.2402.06196
Murillo, J. M., Garcia-Alonso, J., Moguel, E., Barzen, J., Leymann, F., Ali, S., Yue, T., Arcaini, P., Castillo, R. P., Guzmán, I. G. R. d., Piattini, M., Ruiz-Cortés, A., Brogi, A., Zhao, J., Miranskyy, A., & Wimmer, M. (2025). Quantum Software Engineering: Roadmap and Challenges Ahead [arXiv:2404.06825 [cs]]. ACM Transactions on Software Engineering and Methodology, 3712002. https://doi.org/10.1145/3712002
Pathak, P., Tarakeshwar, K., Ali, S. S., Devendrababu, S., & Ganesan, A. (2025, agosto). The Evolution of IBM’s Quantum Information Software Kit (Qiskit): A Review of its Applications [arXiv:2508.12245 [quant-ph]]. https://doi.org/10.48550/arXiv.2508.12245
Pattnayak, P., & Bohra, H. (2025, octubre). Review of Tools for Zero-Code LLM Based Application Development [arXiv:2510.19747 [cs]]. https://doi.org/10.48550/arXiv.2510.19747
Qiskit/qiskit [original-date: 2017-03-03T17:02:42Z]. (2025, marzo). Consultado el 15 de marzo de 2025, desde https://github.com/Qiskit/qiskit
Siavash, N., & Moin, A. (2025). Model-Driven Quantum Code Generation Using Large Language Models and Retrieval-Augmented Generation [arXiv:2508.21097 [cs]]. 2025 ACM/IEEE 28th International Conference on Model Driven Engineering Languages and Systems (MODELS), 260-266. https://doi.org/10.1109/MODELS67397.2025.00031
Suárez, J. M., Bibbó, L. M., Bogado, J., & Fernandez, A. (2025a, junio). Automatic Qiskit Code Refactoring Using Large Language Models [arXiv:2506.14535 [cs]]. https://doi.org/10.48550/arXiv.2506.14535
Suárez, J. M., Bibbó, L. M., Bogado, J., & Fernandez, A. (2025b, junio). Taxonomy of migration scenarios for Qiskit refactoring using LLMs [arXiv:2506.07135 [cs]]. https://doi.org/10.48550/arXiv.2506.07135
Xiao, T., & Zhu, J. (2025, junio). Foundations of Large Language Models [arXiv:2501.09223 [cs]]. https://doi.org/10.48550/arXiv.2501.09223
Zheng, H., Xu, H., Liu, Y., Chen, L., Fung, P., & Yu, K. (2025, octubre). Enhancing LLM Reliability via Explicit Knowledge Boundary Modeling [arXiv:2503.02233 [cs]]. https://doi.org/10.48550/arXiv.2503.02233
Aragonés-Soria, Y., & Oriol, M. (2024). C4Q: A Chatbot for Quantum [arXiv:2402.01738 [cs]]. Proceedings of the 5th ACM/IEEE International Workshop on Quantum Software Engineering, 29-36. https://doi.org/10.1145/3643667.3648222
Dupuis, N., Buratti, L., Vishwakarma, S., Forrat, A. V., Kremer, D., Faro, I., Puri, R., & Cruz-Benito, J. (2024, mayo). Qiskit Code Assistant: Training LLMs for generating Quantum Computing Code [arXiv:2405.19495 [quant-ph]]. https://doi.org/10.48550/arXiv.2405.19495
Gao, Y., Xiong, Y., Gao, X., Jia, K., Pan, J., Bi, Y., Dai, Y., Sun, J., Wang, M., & Wang, H. (2024, marzo). Retrieval-Augmented Generation for Large Language Models: A Survey [arXiv:2312.10997 [cs]]. https://doi.org/10.48550/arXiv.2312.10997
Gupta, S., Ranjan, R., & Singh, S. N. (2024, octubre). A Comprehensive Survey of RetrievalAugmented Generation (RAG): Evolution, Current Landscape and Future Directions [arXiv:2410.12837 [cs]]. https://doi.org/10.48550/arXiv.2410.12837
Liang, P. P., Zadeh, A., & Morency, L.-P. (2024). Foundations & Trends in Multimodal Machine Learning: Principles, Challenges, and Open Questions. ACM Computing Surveys, 56(10), 1-42. https://doi.org/10.1145/3656580
Mombaerts, L., Ding, T., Banerjee, A., Felice, F., Taws, J., & Borogovac, T. (2024, agosto). Meta Knowledge for Retrieval Augmented Large Language Models [arXiv:2408.09017 [cs]]. https://doi.org/10.48550/arXiv.2408.09017
OpenAI, Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F. L., Almeida, D., Altenschmidt, J., Altman, S., Anadkat, S., Avila, R., Babuschkin, I., Balaji, S., Balcom, V., Baltescu, P., Bao, H., Bavarian, M., Belgum, J., . . . Zoph, B. (2024, marzo). GPT-4 Technical Report [arXiv:2303.08774 [cs]]. https://doi.org/10.48550/arXiv.2303.08774
Sengar, S. S., Hasan, A. B., Kumar, S., & Carroll, F. (2024, mayo). Generative Artificial Intelligence: A Systematic Review and Applications [arXiv:2405.11029 [cs]]. https://doi.org/10.48550/arXiv.2405.11029
Team, G., Georgiev, P., Lei, V. I., Burnell, R., Bai, L., Gulati, A., Tanzer, G., Vincent, D., Pan, Z., Wang, S., Mariooryad, S., Ding, Y., Geng, X., Alcober, F., Frostig, R., Omernick, M., Walker, L., Paduraru, C., Sorokin, C., . . . Vinyals, O. (2024, diciembre). Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context [arXiv:2403.05530 [cs]]. https://doi.org/10.48550/arXiv.2403.05530
Wang, C., Huang, K., Zhang, J., Feng, Y., Zhang, L., Liu, Y., & Peng, X. (2024, junio). How and Why LLMs Use Deprecated APIs in Code Completion? An Empirical Study [arXiv:2406.09834 [cs] version: 1]. https://doi.org/10.48550/arXiv.2406.09834
Wang, X., Wang, Z., Gao, X., Zhang, F., Wu, Y., Xu, Z., Shi, T., Wang, Z., Li, S., Qian, Q., Yin, R., Lv, C., Zheng, X., & Huang, X. (2024, julio). Searching for Best Practices in Retrieval-Augmented Generation [arXiv:2407.01219 [cs]]. https://doi.org/10.48550/arXiv.2407.01219
Weisz, J. D., He, J., Muller, M., Hoefer, G., Miles, R., & Geyer, W. (2024). Design Principles for Generative AI Applications [arXiv:2401.14484 [cs]]. Proceedings of the CHI Conference on Human Factors in Computing Systems, 1-22. https://doi.org/10.1145/3613904.3642466
Yuan, Z., Chen, W., Wang, H., Yu, K., Peng, X., & Lou, Y. (2024, octubre). TRANSAGENT: An LLM-Based Multi-Agent System for Code Translation [arXiv:2409.19894 [cs]]. https://doi.org/10.48550/arXiv.2409.19894
Chen, J., & Mueller, J. (2023, octubre). Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthiness [arXiv:2308.16175 [cs]]. https://doi.org/10.48550/arXiv.2308.16175
Heuschkel, S. (2023, junio). The impact of no-code on digital product development [arXiv:2307.16717 [cs]]. https://doi.org/10.48550/arXiv.2307.16717
Lau, J. W. Z., Lim, K. H., Shrotriya, H., & Kwek, L. C. (2022). NISQ computing: where are we and where do we go? AAPPS Bulletin, 32(1), 27. https://doi.org/10.1007/s43673-022-00058-z
Preskill, J. (2018). Quantum Computing in the NISQ era and beyond [arXiv:1801.00862 [quant-ph]]. Quantum, 2, 79. https://doi.org/10.22331/q-2018-08-06-79
Descargas
Publicado
Número
Sección
Licencia
Derechos de autor 2026 José Manuel Suárez, Luís Mariano Bibbó, Joaquín Bogado, Ignacio Schwindt, Alejandro Fernandez

Esta obra está bajo una licencia internacional Creative Commons Atribución-NoComercial-CompartirIgual 4.0.
Acorde a estos términos, el material se puede compartir (copiar y redistribuir en cualquier medio o formato) y adaptar (remezclar, transformar y crear a partir del material otra obra), siempre que a) se cite la autoría y la fuente original de su publicación (revista y URL de la obra), b) no se use para fines comerciales y c) se mantengan los mismos términos de la licencia.














