Skip to content
Preprint

Decompiling Quantum Assembly into Structured Programs

Oct 2026 · 0 citations · 59 references
Computer Science

TL;DR

This work presents Quelle, a decompiler that recovers structured programs from routed and optimized quantum assembly (OpenQASM) and checks every output for equivalence with its input, and fully decompiles 94% of them.

Abstract

Quantum compilers translate programs into native gates, insert SWAP gates to route interactions onto a device, and optimize the result. The output is quantum assembly, a flat gate list that hides the algorithm's structure (QFT, Grover iteration, QAOA layers). Understanding, auditing, porting, or reusing such assembly requires recovering a program that exposes this structure. We present Quelle, a decompiler that recovers structured programs (library calls, loops, functions, symbolic angles) from routed and optimized quantum assembly (OpenQASM) and checks every output for equivalence with its input. Quelle is built on one invariant: every step is either an exact rewrite, checked where it is applied, or a hypothesis, checked against the input before use. It first lifts the assembly into a circuit by removing compilation artifacts, notably un-routing, which recovers the SWAPs that routing inserted, including those merged into other gates. It then recovers algorithm templates (sketches) whose parameters are solved from quantities preserved by compilation, and, for algorithms without a template, library calls and loops by anti-unification. Failed hypotheses are rejected; the corresponding operations remain in gate-level form. On 816 assembly programs from 22 algorithm families and a random-circuit control, compiled at four routing and optimization levels with native two-qubit gates CX, ECR, or CZ, Quelle's output is equivalent to the input for 100% of the inputs, and it fully decompiles 94% of them; compared on the same inputs, it fully decompiles 1.7x as many as the best LLM-based decompiler, which spends 15K tokens per input. On nine algorithm families for which it has no template, the structure it recovers without templates explains 60% of the gates. It checks inputs of up to 2.3 million gates and emits no inequivalent output on 237 real-world QASMBench assembly files.

View source

Similar papers

Preprint Oct 2026

When Equivalent Quantum Circuits Lose Synthesis Choices

Results show that preserving functional equivalence alone is insufficient when later synthesis choices depend on retained high-level structure, and introduces Verified, which records high-level operations before a representation change and reconstructs them only when a check confirms that the record still matches the d...

Bo-Shuai Ye, Peng Liang, A. Khan · 0 citations
#software testing Preprint Oct 2026

Retromorphic Testing of Quantum Compiler Passes

A testing methodology for automated validation of quantum compiler passes based on retromorphic testing and principles from the Hadamard test is introduced, highlighting the need for compiler-pass-specific testing methodologies to improve the reliability of the evolving quantum software stack.

Mushahid Khan, O. Di Matteo · 0 citations
Preprint Sep 2026

QROB: Quantifying Realization Overhead in Quantum Compilation via Reverse Construction

Quantum compilation reconciles a program's idealized interaction topology with hardware locality constraints, yet evaluations at scale lack calibrated references for realization overhead. We present QROB, a scalable reverse-construction methodology that generates compilation instances backward from directly realizable...

Jin-Tao Li, Kai Li, Rui Wang et al. · 0 citations
Preprint Sep 2026

Why Are We Unrolling? The Importance of Structured Quantum Programs for Compilation

This work presents important patterns and algorithms from fault-tolerant quantum applications which admit a structured representation that it is argued is crucial to preserve, and sets a challenge to the community to compile such representations without unrolling them into straight-line quantum circuits.

Damian Rovara, Daniel Haag, Mark Koch et al. · 0 citations
Preprint Sep 2026

OpenQARP: a modular framework for quantum application research

We introduce OpenQARP, the Open Quantum Application Research Package: an open-source Python framework for quantum application research, built on a compiled C++ core. In OpenQARP, an application is assembled from an algorithm library that orchestrates three interchangeable layers: blocks describe circuits, primitives de...

S. Scali, Vicente P. Soloviev, A. Romero et al. · 1 citation

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.