In a way, this work can be seen as a prequel to "A practical guide to quantum machine learning and quantum optimisation". It provides an accessible introduction to quantum computing, combining the mathematical foundations of quantum information with a practical approach to implementing and running quantum algorithms. No previous knowledge of quantum computing or quantum physics is assumed.
These are the learning goals of the book:
- Understand what makes quantum computers different from classical computers.
- Learn how to represent, transform and measure the states of quantum systems.
- Understand quantum superposition, entanglement and interference, and how they are used in quantum algorithms.
- Learn how to implement quantum circuits and algorithms using Qiskit.
- Explore fundamental quantum protocols and algorithms, including quantum key distribution, quantum teleportation, Deutsch's and Deutsch–Jozsa's algorithms, and the Bernstein–Vazirani algorithm.
- Understand the quantum Fourier transform, quantum phase estimation, Shor's factorisation algorithm, and Grover's search algorithm.
- Dive into the basics of quantum error correction, fault-tolerant quantum computing and the notion of quantum advantage.
The exposition is self-contained and introduces the content inductively, starting with a single qubit and progressing towards systems of many qubits and to some of the most relevant quantum algorithms. The theoretical explanations are accompanied by code examples that can be executed using simulators and, when possible, actual quantum computers.
This book is not available under open access. Nevertheless, all the code used in the book is freely available in its companion GitHub repository.
Bonus chapter: Errata
We tried our best to write an error-free book. Paraphrasing a legendary Spanish political figure, we did "everything that was possible, and even the impossible — should the impossible be possible". Nonetheless, once again confronted with our human nature, we must acknowledge the existence of some typos and mistakes. These are the ones that we have found (thus far):
- In the second code listing on page 91, the condition
alice_bits[i] == bob_bits[i]should readalice_used_h[i] == bob_used_h[i]. - Towards the end of the second paragraph on page 246, we meant to say that 3 "is a factor of 21" and so is 7
- In the formula at the bottom of page 313, the last ket should be the basis state 01, not 10.
A note on package versions
Quantum computing software evolves rapidly, and APIs can change substantially between releases. The code in the book was written using Qiskit 2.1, and Appendix D contains instructions for installing the tools needed to run the examples, including the corresponding versions of every software package that we used. If you are using newer versions of these packages, some examples may need to be adapted.