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

Using OpenQASM to interface with IBM QX


In the Quantum Composer, there is alwaysSwitch to Qasm Editor button:

Click the button and you will get a warning that working in the editor could affect your quantum score, click OK:

Then you are brought into the OpenQASM editor:

The editor helpfully has a Quantum Composer view of the circuit on the right, but you are no longer able to drag and drop gates. Instead, you can edit the OpenQASM directly, and see the modifications in the Quantum Composer, or import OpenQASM from an external file on your computer. Once you are happy with your circuit, the view gives you the opportunity to download the OpenQASM via the Download button as well.

Let's edit our circuit to change it from representing 10,000 to 11,000 by adding in an X gate onto the qubit labeled q[1]. We do this by adding x q[1]; to the code in between the register declarations and the measurements. As soon as this line is added, the user interface updates to display the modified quantum score...