Open Quantum Assembly Language
Andrew W. Cross, Lev S. Bishop, John A. Smolin, Jay M. Gambetta
TL;DR
OpenQASM 2.0 defines a hardware-centered quantum assembly language and IR for the Quantum Experience, enabling low-depth, near-term experiments with a universal gate basis built from CNOT and SU(2) operations. It provides a simple, macro-like gate subroutine mechanism, a quantum-classical interface (measurement, reset, and feedback), and a structured workflow (offline compilation, online circuit generation, execution, and post-processing). The paper presents a comprehensive set of representative circuits—teleportation, QFT, inverse QFT with measurement, ripple-carry adders, RB, QPT, and QEC—to demonstrate practical OpenQASM usage and hierarchical gate design. By anchoring hardware primitives in a standard header and supporting opaque gates and parameter expressions, the approach aims to remain adaptable to evolving quantum hardware while preserving portability and human readability. The work facilitates accessible experimentation on IBM’s quantum hardware and serves as a reference for subsequent language and compiler development in quantum computing.
Abstract
This document describes a quantum assembly language (QASM) called OpenQASM that is used to implement experiments with low depth quantum circuits. OpenQASM represents universal physical circuits over the CNOT plus SU(2) basis with straight-line code that includes measurement, reset, fast feedback, and gate subroutines. The simple text language can be written by hand or by higher level tools and may be executed on the IBM Q Experience.
