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

Book description

Understand the nuances of programming traditional quantum computers and solve the challenges of the future while building and executing quantum programs on IBM Quantum hardware and simulators

Key Features

  • Work your way up from writing a simple quantum program to programming complex quantum algorithms
  • Explore the probabilistic nature of qubits by performing quantum coin tosses and using random number generators
  • Delve into quantum algorithms and their practical applications in various domains

Book Description

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.

What you will learn

  • Visualize a qubit in Python and understand the concept of superposition
  • Install a local Qiskit® simulator and connect to actual quantum hardware
  • Compose quantum programs at the level of circuits using Qiskit® Terra
  • Compare and contrast Noisy Intermediate-Scale Quantum computing (NISQ) and Universal Fault-Tolerant quantum computing using simulators and IBM Quantum® hardware
  • Mitigate noise in quantum circuits and systems using Qiskit® Ignis
  • Understand the difference between classical and quantum algorithms by implementing Grover's algorithm in Qiskit®

Who this book is for

This book is for developers, data scientists, machine learning researchers, or quantum computing enthusiasts who want to understand how to use IBM Quantum Experience® and Qiskit® to implement quantum solutions and gain practical quantum computing experience. Python programming experience is a must to grasp the concepts covered in the book more effectively. Basic knowledge of quantum computing will also be beneficial.

Table of contents

  1. Quantum Computing in Practice with Qiskit® and IBM Quantum Experience®
  2. Why subscribe?
  3. Contributors
  4. About the author
  5. About the reviewer
  6. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
    4. Download the color images
    5. Conventions used
    6. Sections
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
      5. See also
    7. Get in touch
    8. Reviews
  8. Chapter 1: Preparing Your Environment
    1. Technical requirements
    2. Creating your IBM Quantum Experience® account
      1. Getting ready
      2. How to do it...
      3. See also
    3. Installing Qiskit®
      1. Getting ready
      2. How to do it...
      3. There's more…
      4. See also
    4. Downloading the code samples
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Installing your API key and accessing your provider
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more…
    6. Keeping your Qiskit® environment up to date
      1. Getting ready
      2. How to do it...
      3. How it works...
  9. Chapter 2: Quantum Computing and Qubits with Python
    1. Technical requirements
    2. Comparing a bit and a qubit
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Visualizing a qubit in Python
      1. Getting ready
      2. How to do it...
      3. There's more…
      4. See also
    4. A quick introduction to quantum gates
      1. Getting ready
      2. How to do it...
      3. How it is works…
      4. There's more…
      5. See also
  10. Chapter 3: IBM Quantum Experience® – Quantum Drag and Drop
    1. Technical requirements
    2. Introducing IBM Quantum Experience®
      1. Results
      2. Circuit Composer
      3. Quantum Lab
    3. Building quantum scores with Circuit Composer
      1. How to do it...
      2. There's more
    4. Tossing a quantum coin
      1. How to do it...
      2. There's more
    5. Moving between worlds
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more
      5. See also
  11. Chapter 4: Starting at the Ground Level with Terra
    1. Technical requirements
      1. Listing the required classes, modules, and functions
      2. Working with quantum registers and classical registers
      3. Understanding your quantum circuit
      4. Selecting a backend to run on
      5. Running your circuit as a job
      6. Receiving the results of your job
    2. Quantum coin toss revisited
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Getting some statistics – tossing many coins in a row
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Implementing an upside-down coin toss
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Tossing two coins simultaneously
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Quantum-cheating in a coin toss? Introducing the Bell state
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. More ways to quantum-cheat – tweaking the odds
      1. Getting ready
      2. How to do it...
      3. There's more...
    8. Adding more coins – straight and cheating
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    9. Tossing some real coins
      1. Getting ready
      2. How to do it
      3. How it works...
      4. There's more...
  12. Chapter 5: Touring the IBM Quantum® Hardware with Qiskit®
    1. Technical requirements
    2. What are the IBM Quantum® machines?
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Locating the available backends
      1. Getting ready
      2. How to do it...
      3. There's more…
      4. See also
    4. Comparing backends
      1. Getting ready
      2. How to do it…
      3. There's more
    5. Finding the least busy backend
      1. Getting ready
      2. How to do it...
    6. Visualizing the backends
      1. Getting ready
      2. How to do it...
      3. There's more...
      4. See also
    7. Exploring a selected backend using Qiskit®
      1. Getting ready
      2. How to do it...
      3. There's more...
  13. Chapter 6: Understanding the Qiskit® Gate Library
    1. Technical requirements
    2. Visualizing quantum gates
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Flipping with the Pauli X, Y, and Z gates
      1. How to do it...
      2. There's more...
    4. Creating superpositions with the H gate
      1. How to do it...
      2. There's more...
      3. See also
    5. Fixed z rotations with phase shift gates S, , T, and
      1. How to do it...
      2. There's more...
    6. Free rotation around the axes with Rx, Ry, and Rz
      1. How to do it...
      2. There's more...
    7. Building our circuits with the basis gates – U1, U2, U3, and ID
      1. The U3 gate
      2. The U2 gate
      3. The U1 gate
      4. Getting ready
      5. How to do it...
      6. There's more...
    8. Using gates on 2 qubits
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. Using gates on more than 2 qubits
      1. How to do it...
      2. There's more...
    10. What your quantum circuit really looks like
      1. Getting ready
      2. How to do it…
      3. There's more...
  14. Chapter 7: Simulating Quantum Computers with Aer
    1. Technical requirements
    2. Understanding the usage of quantum simulators
      1. Getting ready
      2. How to do it...
      3. There's more...
      4. See also
    3. Comparing the Qiskit Aer simulator with an IBM quantum computer
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Adding noise profiles of IBM Quantum® backends to local simulators
      1. Getting ready
      2. How to do it...
      3. See also
    5. Understanding your circuits by using the unitary simulator
      1. Getting ready
      2. How to do it…
    6. Running diagnostics with the state vector simulator
      1. How to do it...
      2. There's more...
  15. Chapter 8: Cleaning Up Your Quantum Act with Ignis
    1. Technical requirements
    2. Exploring your qubits to understand T1, T2, errors, and gates
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more
    3. Comparing the qubits on a chip
      1. Getting ready
      2. How to do it...
      3. There's more...
      4. See also
    4. Estimating the number of gates you have time for
      1. Getting ready
      2. How to do it...
      3. There's more
      4. See also
    5. Correcting for the expected with readout correction
      1. Getting ready
      2. How to do it…
    6. Mitigating the unexpected with quantum error correction
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more
      5. See also
  16. Chapter 9: Grover's Search Algorithm
    1. Technical requirements
    2. Exploring quantum phase kickback
      1. Getting ready
      2. How to do it...
    3. A quick interlude on classical search
      1. Getting ready
      2. How to do it…
    4. Building Grover's search algorithm
      1. Getting ready
      2. How to do it...
      3. There's more…
      4. See also
    5. Searching with a three qubit Grover
      1. How to do it...
    6. Adding more qubits to the Grover search
      1. Getting ready
      2. How to do it...
      3. There's more…
    7. Using the Grover circuit in your own code
      1. Getting ready
      2. How to do it…
      3. There's more…
  17. Chapter 10: Getting to Know Algorithms with Aqua
    1. Technical requirements
    2. Running Grover's algorithm as an Aqua function
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more…
    3. Running Shor's algorithm as an Aqua function
      1. Getting ready
      2. How to do it…
      3. There's more…
      4. See also
    4. Exploring more Aqua algorithms
      1. Getting ready
      2. How to do it…
      3. There's more
      4. See also
      5. Thank you!
  18. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Quantum Computing in Practice with Qiskit® and IBM Quantum Experience®
  • Author(s): Hassi Norlen
  • Release date: November 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781838828448