Skip to main content

2018 | Book

Practical Quantum Computing for Developers

Programming Quantum Rigs in the Cloud using Python, Quantum Assembly Language and IBM QExperience


About this book

Write algorithms and program in the new field of quantum computing. This book covers major topics such as the physical components of a quantum computer: qubits, entanglement, logic gates, circuits, and how they differ from a traditional computer. Also, Practical Quantum Computing for Developers discusses quantum computing in the cloud using IBM Q Experience including: the composer, quantum scores, experiments, circuits, simulators, real quantum devices, and more. You’ll be able to run experiments in the cloud on a real quantum device.
Furthermore, this book shows you how to do quantum programming using the QISKit (Quantum Information Software Kit), Python SDK, and other APIs such as QASM (Quantum Assembly). You’ll learn to write code using these languages and execute it against simulators (local or remote) or a real quantum computer provided by IBM’s Q Experience. Finally, you’ll learn the current quantum algorithms for entanglement, random number generation, linear search, integer factorization, and others. You’ll peak inside the inner workings of the Bell states for entanglement, Grover’s algorithm for linear search, Shor’s algorithm for integer factorization, and other algorithms in the fields of optimization, and more.
Along the way you’ll also cover game theory with the Magic Square, an example of quantum pseudo-telepathy where parties sharing entangled states can be observed to have some kind of communication between them. In this game Alice and Bob play against a referee. Quantum mechanics allows Alice and Bob to always win!
By the end of this book, you will understand how this emerging technology provides massive parallelism and significant computational speedups over classical computers, and will be prepared to program quantum computers which are expected to replace traditional computers in the data center.
What You Will LearnUse the Q Experience Composer, the first-of-its-kind web console to create visual programs/experiments and submit them to a quantum simulator or real device on the cloud
Run programs remotely using the Q Experience REST API
Write algorithms that provide superior performance over their classical counterparts
Build a Node.js REST client for authenticating, listing remote devices, querying information about quantum processors, and listing or running experiments remotely in the cloud
Create a quantum number generator: The quintessential coin flip with a quantum twist
Discover quantum teleportation: This algorithm demonstrates how the exact state of a qubit (quantum information) can be transmitted from one location to another, with the help of classical communication and quantum entanglement between the sender and receiver
Peek into single qubit operations with the classic game of Battleships with a quantum twist
Handle the counterfeit coin problem: a classic puzzle that consists of finding a counterfeit coin in a beam balance among eight coins in only two turns

Who This Book Is For
Developers and programmers interested in this new field of computing.

Table of Contents

Chapter 1. The Bizarre and Awesome World of Quantum Mechanics
The story of quantum mechanics is a fable of wonder and bewilderment. It has elements of science, philosophy, religion, and dare I say magic. It’ll turn your mind upside down, and sometimes it’ll make you question the existence of an all-powerful creator out there. Even though I find its concepts difficult to grasp, I’ve always been fascinated by it. Some of the concepts presented in this chapter are hard to understand; however don’t be troubled. Nobody has been able to fully describe what this all means, not even the titans of physics fully understand quantum mechanics. However that doesn’t mean we can’t be fascinated by it. The great physicist Richard Feynman once said: If somebody tells you he understands quantum mechanics, it means he doesn’t understand quantum mechanics. This chapter is my take on this fascinating fable and how the struggle of two titans of science shaped its past, present, and future.
Vladimir Silva
Chapter 2. Quantum Computing: Bending the Fabric of Reality Itself
Semiconductors have come a long way since the days of the vacuum tube. It is hard to believe that the transistor today is around 14 nanometers in size (i.e., close to a molecule). In this chapter you will learn about the origins of quantum computing starting with the fate of the transistor. It seems that the semiconductor process and the transistor are in a collision course with the laws of physics. Next, an in-depth look at the basic component of a quantum computer: the qubit including the strange effects of superposition, entanglement, and qubit manipulation using logic gates. Furthermore, qubit design is an important topic, and this chapter describes the leading prototypes by major IT companies including pros and cons of each.
Vladimir Silva
Chapter 3. Enter the IBM Q Experience: A One-of-a-Kind Platform for Quantum Computing in the Cloud
In this chapter we take a look at quantum computing in the cloud with IBM Q Experience: the first platform of its kind. The chapter starts with an overview of the Composer, the web console used to visually create circuits, submit experiments, explore hardware devices, and more. Next, you will learn how to create your first experiment and submit it to the simulator or real quantum device. IBM Q Experience features a powerful REST API to control the life cycle of the experiment, and this chapter will show you how with detailed descriptions of the end points and request parameters. Finally, the chapter ends with a practical implementation of the official Python library (dubbed IBMQuantumExperience) for Node JS. This custom Node JS library will put your asynchronous Javascript and REST API skills to the test. Let’s get started.
Vladimir Silva
Chapter 4. QISKit, Awesome SDK for Quantum Programming in Python
In this chapter you will get started with the QISKit, the best SDK out there for quantum programming. You will learn how easy it is to install the SDK in your local system. But before writing your first quantum program, it is always helpful to understand what quantum computation is and how it differs from classical computation. For this purpose, a very basic explanation of qubit states and quantum gates is presented using linear algebra. This section also shows how quantum computation can mirror its classical counterpart and furthermore find shortcuts to get results faster. Next, the chapter walks through the anatomy of a quantum program including system calls, circuit compilation formats, quantum assembly, and more.
Vladimir Silva
Chapter 5. Start Your Engines: From Quantum Random Numbers to Teleportation, Pit Stop at Super Dense Coding
This chapter takes you through a journey about three remarkable information processing capabilities of quantum systems. We start with one of the simplest procedures by exploring the fundamentally random nature of quantum mechanics as a source of true randomness. Next, the chapter looks at perhaps two exuberant but related procedures called super dense coding and quantum teleportation. In super dense coding, you will learn how it is possible to send 2 classical bits of information using a single qubit. In quantum teleportation, you will learn how the quantum state of a qubit can be recreated by a hybrid classical-quantum information transfer procedure. All algorithms include circuit design for the IBM Q Experience Composer as well as Python and QASM code. Results will be gathered for display and analysis, so let’s get started.
Vladimir Silva
Chapter 6. Fun with Quantum Games
In this chapter you will learn how to implement a basic game in a quantum computer. For this purpose we use the quintessential Quantum Battleship distributed with the QISKit Python tutorial. The first part looks at the mechanics of the game including
Vladimir Silva
Chapter 7. Game Theory: With Quantum Mechanics, Odds Are Always in Your Favor
This chapter explores two game puzzles that show the remarkable power of quantum algorithms over their classical counterparts:
Vladimir Silva
Chapter 8. Faster Search plus Threatening the Foundation of Asymmetric Cryptography with Grover and Shor
This chapter brings proceedings to a close with two algorithms that have generated excitement about the possibilities of practical quantum computation:
Vladimir Silva
Practical Quantum Computing for Developers
Vladimir Silva
Copyright Year
Electronic ISBN
Print ISBN

Premium Partner