There are several features of OpenQASM that are not enabled on the IBM QX, and thus are not covered in detail in this book. These include:
- Resetting a qubit
if
statements- User-defined gates
- Built-in/physical/opaque gates
However, as some OpenQASM programs specified in the literature use these language features, and IBM QX may use them in the future, I will go over their syntax and usage briefly here.
The OpenQASM language supports resetting a qubit or quantum register, which prepares the qubit or all the qubits in the quantum register to the |"0"> state. The syntax for this is as follows:
reset q[0];
This will reset the first qubit in the q
quantum register to |"0">, or use the following:
reset q;
This will reset every qubit in the q
quantum register to |"0">. The IBM QX does not at this time support the reset operation.