Table of Contents
Fetching ...

ASDF: A Compiler for Qwerty, a Basis-Oriented Quantum Programming Language

Austin J. Adams, Sharjeel Khan, Arjun S. Bhamra, Ryan R. Abusaada, Anthony M. Cabrera, Cameron C. Hoechst, Travis S. Humble, Jeffrey S. Young, Thomas M. Conte

TL;DR

This work addresses compiling a basis-oriented quantum language, Qwerty, by introducing ASDF, an MLIR-based compiler that translates high-level basis expressions and adjoint/predicated forms into gate-level QCircuit IR and then to industry-standard backends such as OpenQASM 3 and QIR. The approach hinges on a dedicated Qwerty IR, efficient span-equivalence span checks, and a basis-translation synthesis pipeline that handles standardization, vector phases, and permutations, along with function specialization analyses. Empirical results show that ASDF produces circuit outputs with quality comparable to hand-written circuits across standard benchmarks, while offering end-to-end compilation to OpenQASM 3 and QIR. This demonstrates the practicality of basis-oriented quantum programming and provides a framework for integrating high-level quantum languages with existing hardware and simulators, potentially broadening adoption of non-gate-centric quantum languages.

Abstract

Qwerty is a high-level quantum programming language built on bases and functions rather than circuits. This new paradigm introduces new challenges in compilation, namely synthesizing circuits from basis translations and automatically specializing adjoint or predicated forms of functions. This paper presents ASDF, an open-source compiler for Qwerty that answers these challenges in compiling basis-oriented languages. Enabled with a novel high-level quantum IR implemented in the MLIR framework, our compiler produces OpenQASM 3 or QIR for either simulation or execution on hardware. Our compiler is evaluated by comparing the fault-tolerant resource requirements of generated circuits with other compilers, finding that ASDF produces circuits with comparable cost to prior circuit-oriented compilers.

ASDF: A Compiler for Qwerty, a Basis-Oriented Quantum Programming Language

TL;DR

This work addresses compiling a basis-oriented quantum language, Qwerty, by introducing ASDF, an MLIR-based compiler that translates high-level basis expressions and adjoint/predicated forms into gate-level QCircuit IR and then to industry-standard backends such as OpenQASM 3 and QIR. The approach hinges on a dedicated Qwerty IR, efficient span-equivalence span checks, and a basis-translation synthesis pipeline that handles standardization, vector phases, and permutations, along with function specialization analyses. Empirical results show that ASDF produces circuit outputs with quality comparable to hand-written circuits across standard benchmarks, while offering end-to-end compilation to OpenQASM 3 and QIR. This demonstrates the practicality of basis-oriented quantum programming and provides a framework for integrating high-level quantum languages with existing hardware and simulators, potentially broadening adoption of non-gate-centric quantum languages.

Abstract

Qwerty is a high-level quantum programming language built on bases and functions rather than circuits. This new paradigm introduces new challenges in compilation, namely synthesizing circuits from basis translations and automatically specializing adjoint or predicated forms of functions. This paper presents ASDF, an open-source compiler for Qwerty that answers these challenges in compiling basis-oriented languages. Enabled with a novel high-level quantum IR implemented in the MLIR framework, our compiler produces OpenQASM 3 or QIR for either simulation or execution on hardware. Our compiler is evaluated by comparing the fault-tolerant resource requirements of generated circuits with other compilers, finding that ASDF produces circuits with comparable cost to prior circuit-oriented compilers.
Paper Structure (44 sections, 6 theorems, 6 equations, 14 figures, 1 table, 7 algorithms)

This paper contains 44 sections, 6 theorems, 6 equations, 14 figures, 1 table, 7 algorithms.

Key Result

lemma 1

$\mathop{\mathrm{span}}\nolimits($ $N$ $) = \mathop{\mathrm{span}}\nolimits($ $N_1$ $) \otimes$$\mathop{\mathrm{span}}\nolimits($ $N_2$ $)$ if $N = N_1 + N_2$ and $N_1,N_2 \in \mathbb{Z}^{+}$.

Figures (14)

  • Figure 1: Bernstein--Vazirani expressed in Qwerty adams_qwerty_2024
  • Figure 2: Compilation flow for our Qwerty compiler. Solid arrows are our work.
  • Figure 3: An example of how Asdf type checks a Qwerty basis translation.
  • Figure 4: An example of adjointing a basic block
  • Figure 5: An example of predicating a basic block. The red gates shown on the right are SWAP gates; the second has three controls.
  • ...and 9 more figures

Theorems & Definitions (6)

  • lemma 1
  • lemma 2
  • lemma 3
  • corollary 1
  • lemma 4
  • theorem 1