OpenQASM 2 Tutorial

In this OpenQASM 2 tutorial, you will be given an introduction to the OpenQASM 2 Programming language. This tutorial will teach you the OpenQASM 2 programming language from the very basic. In this tutorial you will learn, among other things, the OpenQASM Syntax, its storage types, its statements and how to use OpenQASM and declare Quantum and Classical Registers, how to perform operations and apply various gates on Qubits, measure Qubits onto bits, and reset them.

The latest version of OpenQASM is OpenQASM 3. You can check out the OpenQASM 3 tutorials over here.

Audience

This OpenQASM 2 tutorial is prepared for individuals who are moderately proficient in the field of Quantum Computing. This tutorial has been designed to take you from scratch to a moderately advanced level in the OpenQASM Programming language. By the end of this tutorial you will have a good grasp of the OpenQASM programming language and you will be able to write Quantum Programs in the OpenQASM programming language.

Prerequisites

This OpenQASM tutorial series is designed to get you started with OpenQASM 2 programming language. While this tutorial will teach you OpenQASM from the very basic, it will not cover Quantum Computing. Therefore, it is required from the audience of this tutorial to have a decent understanding of Quantum Computing. Specifically, you should be well versed with Qubits- the quantum counterparts of bits, Quantum Mechanical phenomena such as superposition and entanglement, Quantum Circuits and the various gates of Quantum Computing. Any prior experience with a Quantum Computing library such as Qiskit or Cirq, or a Quantum Computing programming language such as Q# will prove to be highly beneficial.

To learn Quantum Computing from scratch, take a look at Qiskit Tutorials which covers both Quantum Computing and Qiskit from scratch. The tutorial uses Qiskit, which is a Python library(SDK) for implementing Quantum Programs.