Abstract
Instead of producing quantum languages that are fit for current quantum computers, we build a language from standard classical assembler and augment it with quantum capabilities so that quantum algorithms become a subset of it. This paves the way for the development of hybrid algorithms directly from classical software, which is not feasible on today's hardware but might inspire future quantum programmers.
Introduction
Most current quantum programming languages are designed around the limitations of "Noisy Intermediate-Scale Quantum" (NISQ) devices. Because today's hardware suffers from decoherence, these languages focus on shallow circuits and lack fundamental classical programming constructs like recursion, arbitrary jumps, or complex branching. This "hardware-first" approach creates a steep learning curve and stifles the discovery of new quantum algorithms. There is a gap between how we write classical software (imperative, branching, recursive) and how we write quantum circuits (static gates). This paper seeks to bridge that gap by creating a language for an "imaginary" ideal quantum computer that isn't limited by today's hardware constraints.
Methods
The authors developed a custom assembly language that treats quantum operations as extensions of classical ones. The language includes standard instructions for arithmetic (add, mul, sqrt), logic (and, or, neg), and flow control (jump, ifte). To this classical foundation, they added specific quantum primitives to enable superposition and phase manipulation.
Perhaps the most novel feature is the Quantum Program Counter (PC), which can be in a state of superposition. This allows the machine to execute different instructions in different branches of a superposition simultaneously. The language is designed to run on a simulator that executes classical instructions at classical speeds while simulating quantum effects only where necessary.
Results
The authors evaluated their approach by implementing a comparison between a classical "Sieve of Eratosthenes" approach and a quantum-enhanced version using Grover’s search for integer factoring.
As shown in the performance data, the classical algorithm showed significant "spikes" in runtime when encountering prime numbers, representing the worst-case scenario for a sieve. In contrast, the quantum version maintained a remarkably flat and consistent runtime across the entire range of inputs. These results demonstrate that integrating quantum search into a classical assembly flow does not "blow up" the runtime disproportionately on a simulator, justifying the hybrid approach.
Discussion and Future Work
By allowing the program counter to be in superposition, the authors enable a style of quantum programming that feels like classical imperative coding. The goal is a "soft transition" where programmers can write an algorithm classically first and then "quantum-ify" specific parts (e.g., replacing a linear search loop with a Grover search instruction) while maintaining a runnable program.
However, this language cannot run on today’s quantum hardware as it requires an "imaginary" or error-corrected quantum computer capable of deep circuits and superposed control flow. While the language handles Grover-style searches well, more complex algorithms like Shor’s algorithm are not yet easily "derivable" from their classical counterparts. Future work aims to bring these concepts to high-level languages like Python or C++, where a compiler could automatically identify "quantum-ready" modules.
Summary updated