Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
A Practical Guide to Quantum Machine Learning and Quantum Optimization

You're reading from   A Practical Guide to Quantum Machine Learning and Quantum Optimization Hands-on Approach to Modern Quantum Algorithms

Arrow left icon
Product type Paperback
Published in Mar 2023
Publisher Packt
ISBN-13 9781804613832
Length 680 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Elías F. Combarro Fernández-Combarro Álvarez Elías F. Combarro Fernández-Combarro Álvarez
Author Profile Icon Elías F. Combarro Fernández-Combarro Álvarez
Elías F. Combarro Fernández-Combarro Álvarez
Samuel González Castillo Samuel González Castillo
Author Profile Icon Samuel González Castillo
Samuel González Castillo
Arrow right icon
View More author details
Toc

Table of Contents (27) Chapters Close

Preface 1. Part I: I, for One, Welcome our New Quantum Overlords
2. Chapter 1: Foundations of Quantum Computing FREE CHAPTER 3. Chapter 2: The Tools of the Trade in Quantum Computing 4. Part II: When Time is Gold: Tools for Quantum Optimization
5. Chapter 3: Working with Quadratic Unconstrained Binary Optimization Problems 6. Chapter 4: Adiabatic Quantum Computing and Quantum Annealing 7. Chapter 5: QAOA: Quantum Approximate Optimization Algorithm 8. Chapter 6: GAS: Grover Adaptive Search 9. Chapter 7: VQE: Variational Quantum Eigensolver 10. Part III: A Match Made in Heaven: Quantum Machine Learning
11. Chapter 8: What Is Quantum Machine Learning? 12. Chapter 9: Quantum Support Vector Machines 13. Chapter 10: Quantum Neural Networks 14. Chapter 11: The Best of Both Worlds: Hybrid Architectures 15. Chapter 12: Quantum Generative Adversarial Networks 16. Part IV: Afterword and Appendices
17. Chapter 13: Afterword: The Future of Quantum Computing
18. Assessments 19. Bibliography
20. Index
21. Other Books You May Enjoy Appendix A: Complex Numbers
1. Appendix B: Basic Linear Algebra 2. Appendix C: Computational Complexity 3. Appendix D: Installing the Tools 4. Appendix E: Production Notes

1.2 The basics of the quantum circuit model

We have mentioned that quantum computing relies on quantum phenomena such as superposition, entanglement, and interference to perform computations. But what does this really mean? To make this explicit, we need to define a particular computational model that allow us to describe mathematically how to take advantage of all these properties.

There are many such models, including quantum Turing machines, measurement-based quantum computing (also known as one-way quantum computing), or adiabatic quantum computing, and all of them are equivalent in power. However, the most popular one — and the one that we will be using for the most part in the book — is the quantum circuit model.

To learn more

In addition to the quantum circuit model, sometimes we will also use the adiabatic model. All the necessary concepts will be introduced in Chapter 4, Quantum Adiabatic Computing and Quantum Annealing.

Every computation has three elements: data, operations, and output. In the quantum circuit model, these correspond to some concepts that you may have already heard about: qubits, quantum gates, and measurements. Through the remainder of this chapter, we will briefly review all of them, highlighting some special details that will be of particular importance when talking about quantum machine learning and quantum optimization algorithms; at the same time, we will show the notation that will be used throughout the book. But before committing to that, let us have a quick overview of what a quantum circuit is.

Let's have a look at Figure 1.1. It shows a simple quantum circuit. The three horizontal lines that you see are sometimes called wires, and they represent the qubits that we are working with. Thus, in this case, we have three qubits. The circuit is meant to be read from left to right, and it represents all the different operations that are performed on the qubits. It is customary to assume that, at the very beginning, all the qubits are in state . You do not need to worry yet about what means, but please notice how we have indicated that this is indeed the initial state of all the wires by writing to the left of each of them.

Figure 1.1: An example of a simple quantum circuit.

In that circuit, we start by applying an operation called a gate on the top qubit; we will explain in the next section what all of these operations do, but note that we represent them with little boxes with the name of the operation inside. After that initial gate, we apply individual gates , , and on the top, middle, and bottom qubits and, then, a two-qubit gate on the top and middle qubits followed by a three-qubit gate, which acts on all the qubits at the same time. Finally, we measure the top and bottom qubits (we will get to measurements in the next section, don't worry), and we represent this in the circuit using the gauge symbol. Notice that, after these measurements, the wires are represented with double lines, to indicate that we have obtained a result — technically, we say that the state of the qubit has collapsed to a classical value. This means that, from this point on, we do not have quantum data anymore, only classical bits. This collapse may seem a little bit mysterious (it is!), but don't worry. In the next section, we will explain in detail the process by which quantum information (qubits) is transformed into classical data (bits).

As you may have noticed, quantum circuits are somewhat similar to digital ones, in which we have wires representing bits and different logical gates such as AND, OR, and NOT acting on them. However, our qubits, quantum gates, and measurements obey the rules of quantum mechanics and show some properties that are not found in classical circuits. The rest of this chapter is devoted to explaining all of this in detail, starting with the simplest of cases, that of a single qubit, but growing all the way up to fully-fledged quantum circuits that can use as many qubits and gates as desired.

Ready? Let's start, then!

You have been reading a chapter from
A Practical Guide to Quantum Machine Learning and Quantum Optimization
Published in: Mar 2023
Publisher: Packt
ISBN-13: 9781804613832
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime