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.
