This chapter describes the Open Quantum Assembly Language (OpenQASM, pronounced open kazm), a custom programming language designed specifically to minimally describe quantum circuits. It goes over the motivation behind introducing this language, where it can be used within IBM QX and other quantum computing work it can be used for. The chapter revisits some of the quantum circuits defined in previous chapters and redefines them within the OpenQASM language. It then provides you with the opportunity to rerun these circuits on the IBM QX, using OpenQASM directly, instead of the Quantum Composer. The chapter focuses on the specifications and implementations of OpenQASM, which is the version of OpenQASM used by the IBM QX at the time of writing.
The following topics will be covered in this chapter:
- Reading and writing OpenQASM programs
- Presenting quantum scores in OpenQASM programs
- Translating OpenQASM programs into quantum scores