6

I have gotten conflicting information about OpenQASM; some sources point to version 3 while others say 3 is not ready. I want to refer to a document that will tell me what instructions actually work with the official library.

Martin Vesely
  • 15,398
  • 4
  • 32
  • 75
Anna Naden
  • 711
  • 3
  • 15

1 Answers1

4

OpenQASM 2 is defined in https://arxiv.org/abs/1707.03429. Its main focus is to describe gate-based quantum circuits. You can find OpenQASM 2 examples here. There are several parsers available for OpenQASM 2 (for example, in Qiskit and NuQasm2).

  • Pro: Stable and well-supported by many tools.
  • Con: Not very expressive. Some use cases cannot be written in version 2.0.

OpenQASM 3 specifications are available at https://openqasm.com/. There are currently two subversions: 3.0 and 3.1. A broad document outlining many of the design decisions is https://arxiv.org/abs/2104.14722. The OpenQASM 3 specification is open to public participation. There are working groups on specific topics and a Technical Steering Committee composed of members from multiple companies and organizations. On the technical side, OpenQASM 3 comes with a reference parser.

  • Pro: A beyond-quantum-circuit language with classical computing support.
  • Con: Less mature support compared to OpenQASM 2. Because it is more complex, many implementations are incomplete and some features may be missing.

TL;DR: Depending on your goals, OpenQASM 2 might be sufficient. If you need classical computing support, inputs, or other features not covered by OpenQASM 2, you'll need OpenQASM 3. In that case, make sure your tooling supports the feature you requiere and keep an eye on its new releases.

luciano
  • 6,164
  • 1
  • 14
  • 34