Book cover

A practical guide to quantum machine learning and quantum optimisation

By Elías F. Combarro and Samuel González-Castillo

This book provides a deep coverage of modern quantum algorithms that can be used to solve real-world problems, and it does so while keeping pre-requisites to the very minimum: only some elementary understanding of linear algebra is needed.

These are the learning goals of the book:

  • Understand the basics of quantum computing.
  • Gain a solid understanding of modern quantum algorithms.
  • Understand how to formulate optimization problems in the QUBO formalism.
  • Solve optimization problems with quantum annealing, QAOA, GAS, and VQE.
  • Review the foundations of classical machine learning and understand how to create quantum machine learning models.
  • Explore how quantum support vector machines and quantum neural networks work using Qiskit and PennyLane.
  • Learn how to implement hybrid architectures using Qiskit and PennyLane and its PyTorch interface.
  • Understand how quantum generative adversarial networks work and how they can be implemented.

The exposition is self-contained and combines thorough theoretical explanations of the material with code examples that anyone can execute on any (reasonably modern) computer.

This book is not available under open access. Nevertheless, you might be able to find it in a Library; in particular, the Libraries of the University of Oviedo and Maynooth University have some copies available. In addition to this, all the code used in the book is freely available on a GitHub repository.

Bonus chapter: Errata

We are feelings and we have human beings.

— Mariano Rajoy, former Prime Minister of Spain

In spite of our very best efforts, there are some errata in the book. Whether they can be seen as beautiful witnesses to our finite nature or as unforgivable offences to the reader is up for debate. In any case, we will keep on this page a list of all the errata that we have found (so far).

  1. In Figure 1.2 of the digital version of the book (not of the print version), the ket 0 should be on the positive Z axis (i.e., on the top), and the ket 1 should be on the negative Z azis (i.e., on the bottom). Since we got the figure right in print, would the figure's correctness be in a state of superposition?
  2. References to the "time-independent Schrodinger equation" (pages 14 and 126 of the print version) should be read as references to the "time-dependent Schrodinger equation". What can we say? Perhaps a Z gate made its way to our brains.

If there ever is a second edition of the book, we promise to fix these errata. However, we can't promise that we won't introduce new ones in the process.

A note on package versions

Modern software is always evolving and some APIs change very rapidly. This was an issue for us when we were writing the book, so we chose to fix a version for all the software packages that we used, and we tested all our code on them. We specify these versions in Appendix D. If you downgrade to them, the code will run flawlessly as long as it does not rely on deprecated cloud-based services.