QSSA: An SSA-based IR for Quantum Computing

09/06/2021
by   Anurudh Peduri, et al.
0

Quantum computing hardware has progressed rapidly. Simultaneously, there has been a proliferation of programming languages and program optimization tools for quantum computing. Existing quantum compilers use intermediate representations (IRs) where quantum programs are described as circuits. Such IRs fail to leverage existing work on compiler optimizations. In such IRs, it is non-trivial to statically check for physical constraints such as the no-cloning theorem, which states that qubits cannot be copied. We introduce QSSA, a novel quantum IR based on static single assignment (SSA) that enables decades of research in compiler optimizations to be applied to quantum compilation. QSSA models quantum operations as being side-effect-free. The inputs and outputs of the operation are in one-to-one correspondence; qubits cannot be created or destroyed. As a result, our IR supports a static analysis pass that verifies no-cloning at compile-time. The quantum circuit is fully encoded within the def-use chain of the IR, allowing us to leverage existing optimization passes on SSA representations such as redundancy elimination and dead-code elimination. Running our QSSA-based compiler on the QASMBench and IBM Quantum Challenge datasets, we show that our optimizations perform comparably to IBM's Qiskit quantum compiler infrastructure. QSSA allows us to represent, analyze, and transform quantum programs using the robust theory of SSA representations, bringing quantum compilation into the realm of well-understood theory and practice.

READ FULL TEXT

page 15

page 17

research
01/26/2021

Enabling Dataflow Optimization for Quantum Programs

We propose an IR for quantum computing that directly exposes quantum and...
research
12/10/2019

RVSDG: An Intermediate Representation for Optimizing Compilers

Intermediate Representations (IRs) are central to optimizing compilers a...
research
01/27/2021

A MLIR Dialect for Quantum Assembly Languages

We demonstrate the utility of the Multi-Level Intermediate Representatio...
research
12/14/2020

Relaxed Peephole Optimization: A Novel Compiler Optimization for Quantum Circuits

In this paper, we propose a novel quantum compiler optimization, named r...
research
01/29/2019

ReQWIRE: Reasoning about Reversible Quantum Circuits

Common quantum algorithms make heavy use of ancillae: scratch qubits tha...
research
04/07/2020

LLHD: A Multi-level Intermediate Representation for Hardware Description Languages

Modern Hardware Description Languages (HDLs) such as SystemVerilog or VH...
research
07/05/2021

A Formal Semantics of the GraalVM Intermediate Representation

The optimization phase of a compiler is responsible for transforming an ...

Please sign up or login with your details

Forgot password? Click here to reset