OpenQASM

Open Quantum Assembly Language (OpenQASM; pronounced open kazm ) is a programming language designed for describing quantum circuits and algorithms for execution on quantum computers. It is designed to be an intermediate representation that can be used by higher-level compilers to communicate with quantum hardware, and allows for the description of a wide range of quantum operations, as well as classical feed-forward flow control based on measurement outcomes.

The language includes a mechanism for describing explicit timing of instructions, and allows for the attachment of low-level definitions to gates for tasks such as calibration. OpenQASM is not intended for general-purpose classical computation, and hardware implementations of the language may not support the full range of data manipulation described in the specification. Compilers for OpenQASM are expected to support a wide range of classical operations for compile-time constants, but the support for these operations on runtime values may vary between implementations.

The language was first described in a paper published in July 2017, and a reference source code implementation was released as part of IBM's Quantum Information Software Kit (Qiskit) for use with their IBM Quantum Experience cloud quantum computing platform. The language has similar qualities to traditional hardware description languages such as Verilog.

OpenQASM defines its version at the head of a source file as a number, as in the declaration:

The level of OpenQASM's original published implementations is OpenQASM 2.0. Version 3.0 of the specification is the current one and can be viewed at the OpenQASM repository on GitHub.

Examples
The following is an example of OpenQASM source code from the official library. The program adds two four-bit numbers.