DOE OSTI · 3012507
Learning-Based Quantum Compilation: Translating QASM to QIR with CodeBERT
Abstract
We propose a learning-based approach to quantum compilation by translating OpenQASM to Quantum Intermediate Representation (QIR) using a fine-tuned CodeBERT model. Trained on 10,000 synthetic QASM-QIR pairs, the model captures code semantics while addressing QIR verbosity and the 512-token limit via a custom token compression scheme. Finetuning was performed on the Frontier supercomputer, with results showing syntactic correctness and stable validation loss reduction. Our method moves toward enabling flexible, language-modeldriven quantum software tools. It also introduces syntax error handling and the possibility of incorporating classical control constructs, addressing limitations in existing rule-based compilers like qBraid-QIR. While the current model has been validated on quantum-only circuits, we propose future evaluations on hybrid quantum-classical examples. This poster will provide architecture insights, compression examples, training loss plots, and QIR outputs. Our work highlights the potential for scalable, adaptable compilation in future quantum toolchains.
Keep this discovery
Explore connections, maps & timelines
Afrose, Sharmin [ORNL], Leyton Ortega, Vicente [ORNL], Humble, Travis [ORNL] (ORCID:0000000294490498). 2025-12-01. Learning-Based Quantum Compilation: Translating QASM to QIR with CodeBERT. https://doi.org/10.1109/qce65121.2025.10453
Cite the original work for its findings. Save a collection to share your selection of sources.