Book Image

Mastering Quantum Computing with IBM QX

By : Dr. Christine Corbett Moran
Book Image

Mastering Quantum Computing with IBM QX

By: Dr. Christine Corbett Moran

Overview of this book

<p>Quantum computing is set to disrupt the industry. IBM Research has made quantum computing available to the public for the first time, providing cloud access to IBM QX from any desktop or mobile device. Complete with cutting-edge practical examples, this book will help you understand the power of quantum computing in the real world.</p> <p>Mastering Quantum Computing with IBM QX begins with the principles of quantum computing and the areas in which they can be applied. You'll explore the IBM Ecosystem, which enables quantum development with Quantum Composer and Qiskit. As you progress through the chapters, you'll implement algorithms on the quantum processor and learn how quantum computations are actually performed.</p> <p>By the end of the book, you will completely understand how to create quantum programs of your own, the impact of quantum computing on your business, and how to future-proof your programming career.</p>
Table of Contents (22 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Advanced OpenQASM usage


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.

Resetting a qubit

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.

if statements

OpenQASM has a mechanism for if statements, which allow the outcome of one or more quantum measurements, placed in...