Home Programming Quantum Computing in Practice with Qiskit® and IBM Quantum Experience®

Quantum Computing in Practice with Qiskit® and IBM Quantum Experience®

By Hassi Norlen
books-svg-icon Book
eBook $29.99 $20.98
Print $43.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $29.99 $20.98
Print $43.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Chapter 2: Quantum Computing and Qubits with Python
About this book
IBM Quantum Experience® is a leading platform for programming quantum computers and implementing quantum solutions directly on the cloud. This book will help you get up to speed with programming quantum computers and provide solutions to the most common problems and challenges. You’ll start with a high-level overview of IBM Quantum Experience® and Qiskit®, where you will perform the installation while writing some basic quantum programs. This introduction puts less emphasis on the theoretical framework and more emphasis on recent developments such as Shor’s algorithm and Grover’s algorithm. Next, you’ll delve into Qiskit®, a quantum information science toolkit, and its constituent packages such as Terra, Aer, Ignis, and Aqua. You’ll cover these packages in detail, exploring their benefits and use cases. Later, you’ll discover various quantum gates that Qiskit® offers and even deconstruct a quantum program with their help, before going on to compare Noisy Intermediate-Scale Quantum (NISQ) and Universal Fault-Tolerant quantum computing using simulators and actual hardware. Finally, you’ll explore quantum algorithms and understand how they differ from classical algorithms, along with learning how to use pre-packaged algorithms in Qiskit® Aqua. By the end of this quantum computing book, you’ll be able to build and execute your own quantum programs using IBM Quantum Experience® and Qiskit® with Python.
Publication date:
November 2020
Publisher
Packt
Pages
408
ISBN
9781838828448

 

Chapter 2: Quantum Computing and Qubits with Python

Quantum computing is a fairly new and fairly old field at the same time. The ideas and concepts used to achieve quantum computing (such as quantum mechanical superposition and entanglement) have been around for almost a century and the field of quantum information science was founded almost 40 years ago. Early explorers, such as Peter Shor and Lov Grover, produced quantum computing algorithms (Shor's algorithm and Grover's algorithm) that are now starting to become as well known as foundational physics concepts such as E=mc2. For details, see the references at the end of the chapter.

At the same time, real quantum computers that utilize these effects are a relatively recent invention. The requirements for building one were outlined by DiVincenzo in the 1990, and IBM opened up its IBM Quantum Experience® and Qiskit® in 2016, effectively the first time anyone outside of a research lab could start exploring this...

 

Technical requirements

The recipes that we discuss in this chapter can be found here: https://github.com/PacktPublishing/Quantum-Computing-in-Practice-with-Qiskit-and-IBM-Quantum-Experience/tree/master/Chapter02.

For more information about how to get the recipe sample code, refer to the Downloading the code samples section in Chapter 1, Preparing Your Environment.

 

Comparing a bit and a qubit

So, let's start with the obvious—or perhaps, not so obvious—notion that most people who read this book know what a bit is.

An intuitive feeling that we have says that a bit is something that is either zero (0) or one (1). By putting many bits together, you can create bytes as well as arbitrary large binary numbers, and with those, build the most amazing computer programs, encode digital images, encrypt your love letters and bank transactions, and more.

In a classical computer, a bit is realized by using low or high voltages over the transistors that make up the logic board, typically something such as 0 V and 5 V. In a hard drive, the bit might be a region magnetized in a certain way to represent 0 and the other way for 1, and so on.

In books about quantum computing, the important point to drive home is that a classical bit can only be a 0 or a 1; it can never be anything else. In the computer example, you can imagine a box with...

 

Visualizing a qubit in Python

In this recipe, we will use generic Python with NumPy to create a vector and visual representation of a bit and show how it can be in only two states, 0 and 1. We will also introduce our first, smallish foray into the Qiskit® world by showing how a qubit can not only be in the unique 0 and 1 states but also in a superposition of these states. The way to do this is to take the vector form of the qubit and project it on the so-called Bloch sphere, for which there is a Qiskit® method. Let's get to work!

In the preceding recipe, we defined our qubits with the help of two complex parameters—a and b. This meant that our qubits could take values other than the 0 and 1 of a classical bit. But it is hard to visualize a qubit halfway between 0 and 1, even if you know a and b.

However, with a little mathematical trickery, it turns out that you can also describe a qubit using two angles—theta () and phi ()—and visualize the...

 

A quick introduction to quantum gates

Now that we have sorted out the difference between bits and qubits, and have also understood how to visualize the qubit as a Bloch sphere, we know all that there is to know about qubits, correct? Well, not quite. A qubit, or for that matter, hundreds or thousands of qubits, is not the only thing you need to make a quantum computer! You need to perform logical operations on and with the qubits. For this, just like a classical computer, we need logical gates.

I will not go into any great detail on how logical gates work, but suffice to say that a quantum gate, operates on the input of one or more qubits and outputs a result.

In this recipe, we will work our way through the mathematical interpretation of few quantum gates by using matrix multiplication of single- and multi-qubit gates. Don't worry, we will not dig deep, just a little to scratch the surface. You will find a deeper look quantum gates in Chapter 6, Understanding the Qiskit...

About the Author
  • Hassi Norlen

    Hassi Norlen is a Physicist and science educator who works as an IBM Quantum Ambassador and Content Design lead with IBM Watson IoT Solutions. Before joining the IBM Watson IoT Solutions team, Hassi worked with information design across several IBM divisions, notably IBM BigInsights in the field of Big Data, InfoSphere Optim database management software with products such as IBM InfoSphere Workload Replay (ID lead) and IBM Data Server Manager, and Enterprise Content Management (ECM) with products such as IBM FileNet and IBM Web Content Manager.

    Browse publications by this author
Latest Reviews (4 reviews total)
Libro interessante per chi lavora con quell'ambiente. E' una sorta di coltellino svizzero per trovare subito le informazioni che ti servono.
This survey ***** with the lock in before you can exit.
everything fine, no problems
Quantum Computing in Practice with Qiskit® and IBM Quantum Experience®
Unlock this book and the full library FREE for 7 days
Start now