What this book covers
This book is organized in three parts, an afterword, and some appendices as follows:
Part I, I, for One, Welcome our New Quantum Overlords
Chapter 1, Foundations of Quantum Computing, briefly reviews the key ideas behind the quantum circuit model, fixing the notation that we will use throughout the book. It explores core ideas and notions, discussing quantum states, quantum gates and measurements; all starting completely from scratch. It also makes the book more self-contained and accessible for readers with different backgrounds.
Chapter 2, The Tools of the Trade in Quantum Computing, presents different quantum programming libraries that you can use to implement and run quantum methods, focusing especially on Qiskit and PennyLane. This chapter will guide you through the process of implementing quantum circuits and running them on simulators and actual quantum computers.
Part II, When Time is Gold: Tools for Quantum Optimization
Chapter 3, Working with Quadratic Unconstrained Binary Optimization Problems, introduces a mathematical framework that will help us formulate combinatorial optimization problems in a way that will allow us to solve them with quantum algorithms. It also provides many examples of how to use this formalism in practice.
Chapter 4, Adiabatic Quantum Computing and Quantum Annealing, is devoted to quantum annealing, our first quantum optimization method. It starts by explaining all the mathematical details behind this algorithm and then covers all the practical aspects of using it to solve optimization problems. It also introduces Ocean, the library that we use to run programs on quantum annealers.
Chapter 5, QAOA: Quantum Approximate Optimization Algorithm, shows how to adapt the ideas behind quantum annealing to the quantum circuit model. It introduces QAOA, one of the most popular modern quantum algorithms, and studies its mathematical properties. This chapter also explains in detail how to use this algorithm with both Qiskit and PennyLane.
Chapter 6, GAS: Grover Adaptive Search, introduces Grover's algorithm and explains how to use it solve optimization problems. It focuses on designing oracles for optimization problems and on running the method with Qiskit.
Chapter 7, VQE: Variational Quantum Eigensolver, expands the applicability of the quantum optimization methods studied in the previous chapters to problems that are not combinatorial, including tasks from fields such as physics or quantum chemistry. It also shows how to run VQE with Qiskit and PennyLane, including how to use important techniques such as noise simulation and error mitigation.
Part III, A Match Made in Heaven: Quantum Machine Learning
Chapter 8, What is Quantum Machine Learning?, gives a self-contained introduction to (classical) machine learning. It also explains the ways in which quantum computing can be used to define new machine learning methods.
Chapter 9, Quantum Support Vector Machines, studies our first quantum machine learning model: a quantum version of the famous Support Vector Machines. It explains how they can be derived mathematically and shows how to use them to solve classification problems with Qiskit and PennyLane.
Chapter 10, Quantum Neural Networks, shows how to construct quantum versions of neural networks by using variational circuits with different roles in the model. It also provides detailed examples of how to define and run these models using PennyLane and Qiskit.
Chapter 11, The Best of Both Worlds: Hybrid Architectures, is a very practical and hands-on chapter. It shows how to mix quantum and classical neural networks to create hybrid models. It also guides you through all the steps needed to implement these architectures in both PennyLane and Qiskit.
Chapter 12, Quantum Generative Adversarial Networks, shows how to create quantum generative models that are the quantum version of classical Generative Adversarial Networks (or GANs). In addition to explaining the architecture of the model, it also provides detailed examples, both in PennyLane and Qiskit, of how to use them in practice.
Afterword and Appendices
Chapter 13, Afterword: The Future of Quantum Computing, wraps up everything discussed in the book and hints at some possible developments for quantum computing in the short and medium term.
Appendix A, Complex Numbers, gives a quick recap of the most relevant properties of complex numbers and how to operate with them.
Appendix B, Basic Linear Algebra, is a refresher on the fundamentals of linear algebra, including vectors and matrices, important notions such as bases and eigenvalues, and even some concepts from modular arithmetic.
Appendix C, Computational Complexity, serves as a quick introduction to measuring the resources needed to solve problems with algorithms. It defines important concepts such as big O notation and reductions, and complexity classes such as the famous and
.
Appendix D, Installing the Tools, guides you through the process of installing the libraries needed in order to run the source code included in this book.
Appendix E, Production Notes, gives a glimpse of the process of writing a technical book like this one, including the software used to typeset formulas and create figures.
Assessments contains the solutions to all the exercises proposed in the main text.
Parts II and III are mostly self-contained and independent of each other (although, in the main text, we point out the connections between them whenever they exist). They can be used for self-study of quantum optimization and quantum machine learning, or to teach two short, independent courses on these topics or one full course on modern quantum algorithms. The strongest dependencies between chapters are shown in Figure 1, so you can know which chapters you may skip without losing track of the explanation.