[Paper Review] Reversible circuit compilation with space constraints
This paper presents Revs, a compiler that translates classical irreversible programs into space-efficient reversible circuits using in-place operations, data dependency tracking via MDD graphs, and pebble game-inspired strategies. It reduces qubit usage by up to 4× compared to Bennett’s method, enabling scalable compilation of cryptographic hash functions and arithmetic circuits for quantum computing.
We develop a framework for resource efficient compilation of higher-level programs into lower-level reversible circuits. Our main focus is on optimizing the memory footprint of the resulting reversible networks. This is motivated by the limited availability of qubits for the foreseeable future. We apply three main techniques to keep the number of required qubits small when computing classical, irreversible computations by means of reversible networks: first, wherever possible we allow the compiler to make use of in-place functions to modify some of the variables. Second, an intermediate representation is introduced that allows to trace data dependencies within the program, allowing to clean up qubits early. This realizes an analog to "garbage collection" for reversible circuits. Third, we use the concept of so-called pebble games to transform irreversible programs into reversible programs under space constraints, allowing for data to be erased and recomputed if needed. We introduce REVS, a compiler for reversible circuits that can translate a subset of the functional programming language F# into Toffoli networks which can then be further interpreted for instance in LIQui|>, a domain-specific language for quantum computing and which is also embedded into F#. We discuss a number of test cases that illustrate the advantages of our approach including reversible implementations of SHA-2 and other cryptographic hash-functions, reversible integer arithmetic, as well as a test-bench of combinational circuits used in classical circuit synthesis. Compared to Bennett's method, REVS can reduce space complexity by a factor of $4$ or more, while having an only moderate increase in circuit size as well as in the time it takes to compile the reversible networks.
Motivation & Objective
- Address the challenge of high qubit overhead in reversible compilation, especially under limited qubit availability in near-term quantum hardware.
- Overcome the limitations of traditional reversible compilation methods like Bennett’s, which require excessive ancilla qubits and lead to inefficient circuit layouts.
- Enable practical compilation of large-scale classical programs—such as cryptographic hash functions—into reversible circuits with minimal space overhead.
- Develop a framework that supports both in-place computation and early garbage qubit cleanup without sacrificing correctness or performance.
- Introduce a domain-specific compiler stack that translates F#-like functional programs into Toffoli networks executable in quantum languages like LIQUi|>
Proposed method
- Use in-place functions to modify variables directly, reducing the need for additional ancilla qubits during computation.
- Introduce a multi-valued decision diagram (MDD) graph to model data dependencies and mutations, enabling precise tracking of live and dead variables.
- Apply heuristic pebble game strategies to trade time for space by selectively recomputing intermediate values instead of storing them.
- Implement an eager cleanup strategy based on MDD structure, cleaning up qubits as soon as they are no longer needed, provided no inter-path dependencies exist.
- Integrate a fallback to Bennett’s original method when inter-path dependencies prevent safe early cleanup, ensuring correctness for all programs.
- Compile F#-like programs into Toffoli networks that can be further mapped to quantum circuits using domain-specific languages like LIQUi|>
Experimental results
Research questions
- RQ1How can we reduce the qubit footprint of reversible circuits when compiling classical programs for quantum computation?
- RQ2To what extent can in-place operations and early garbage collection reduce ancilla qubit usage in reversible circuits?
- RQ3Can data dependency analysis via MDD graphs enable more efficient and correct cleanup of intermediate qubits than traditional function-boundary cleanup?
- RQ4How do pebble game-inspired strategies compare to Bennett’s method in terms of space and time efficiency for real-world programs?
- RQ5Can the proposed framework scale to complex, large-scale classical programs such as SHA-2 and integer arithmetic circuits?
Key findings
- Revs reduces space complexity by a factor of 4 or more compared to Bennett’s method for practical programs like SHA-2 and MD5.
- The use of in-place functions and MDD-based data dependency tracking allows for early qubit cleanup, significantly reducing ancilla qubit requirements.
- For cryptographic hash functions such as SHA-2, Revs enables efficient compilation into reversible circuits with minimal qubit overhead.
- The framework achieves substantial space savings even in cases where Bennett’s method with function-boundary cleanup is applied, demonstrating the advantage of fine-grained dependency analysis.
- The method maintains moderate increases in circuit size and compilation time, making it practical for real-world applications.
- The approach supports scalable compilation of medium-to-large classical circuits, including combinational logic and arithmetic units, from the classical circuit synthesis community.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.