Reader small image

You're reading from  A Practical Guide to Quantum Machine Learning and Quantum Optimization

Product typeBook
Published inMar 2023
PublisherPackt
ISBN-139781804613832
Edition1st Edition
Right arrow
Authors (2):
Elías F. Combarro
Elías F. Combarro
author image
Elías F. Combarro

Elías F. Combarro holds degrees from the University of Oviedo (Spain) in both Mathematics (1997, award for second highest grades in the country) and Computer Science (2002, award for highest grades in the country). After some research stays at the Novosibirsk State University (Russia), he obtained a Ph.D. in Mathematics (Oviedo, 2001) with a dissertation on the properties of some computable predicates under the supervision of Prof. Andrey Morozov and Prof. Consuelo Martínez. Since 2009, Elías F. Combarro has been an associate professor at the Computer Science Department of the University of Oviedo. He has published more than 50 research papers in international journals on topics such as Computability Theory, Machine Learning, Fuzzy Measures and Computational Algebra. His current research focuses on the application Quantum Computing to algebraic, optimisation and machine learning problems. From July 2020 to January 2021, he was a Cooperation Associate at CERN openlab. Currently, he is the Spain representative in the Advisory Board of CERN Quantum Technology Initiative, a member of the Advisory Board of SheQuantum and one of the founders of the QSpain, a quantum computing think tank based in Spain.
Read more about Elías F. Combarro

Samuel González-Castillo
Samuel González-Castillo
author image
Samuel González-Castillo

Samuel González-Castillo holds degrees from the University of Oviedo (Spain) in both Mathematics and Physics (2021). He is currently a mathematics research student at the National University of Ireland, Maynooth, where he works as a graduate teaching assistant. He completed his physics bachelor thesis under the supervision of Prof. Elías F. Combarro and Prof. Ignacio F. Rúa (University of Oviedo), and Dr. Sofia Vallecorsa (CERN). In it, he worked alongside other researchers from ETH Zürich on the application of Quantum Machine Learning to classification problems in High Energy Physis. In 2021, he was a summer student at CERN developing a benchmarking framework for quantum simulators. He has contributed to several conferences on quantum computing.
Read more about Samuel González-Castillo

View More author details
Right arrow

Chapter 4
Adiabatic Quantum Computing and Quantum Annealing

Love’s a different sort of thing, hot enough to make you flow into something, interflow, cool and anneal and be a weld stronger than what you started with.
— Theodore Sturgeon

In the previous chapter, we studied how to formulate different combinatorial optimization problems as QUBO instances that, in turn, could be rewritten as the optimization problem of finding a state with minimum energy in an Ising model system. In this chapter, we will use this fact to introduce a way of using quantum annealers — a special type of quantum computer — to try to find (approximate) solutions to those combinatorial optimization problems.

But, in order to do that, we first need to talk a little bit more about Hamiltonians and their ground states, as well as the central role they play in adiabatic quantum computing.

The topics that we will cover in this chapter are as follows:

  • Adiabatic quantum computing

  • Quantum annealing...

4.1 Adiabatic quantum computing

In Chapter 1, Foundations of Quantum Computing, we focused mainly on quantum circuits but we briefly mentioned that there were other equivalent quantum computing models. One of them is adiabatic quantum computing, introduced in 2000 by Farhi, Goldstone, Gutmann, and Sipser in a widely influential paper [36].

When using quantum circuits, we apply operations (our beloved quantum gates) through discrete, sequential steps. However, adiabatic quantum computing relies on the use of continuous transformations. Namely, we will use a Hamiltonian that will vary with time and that will be the driving force to change the state of our qubits according to the time-dependent Schrödinger equation:

H(t)\left| {\psi(t)} \right\rangle = i\hslash\frac{\partial}{\partial t}\left| {\psi(t)} \right\rangle.

To learn more

As you may remember, in Chapter 1, Foundations of Quantum Computing, we talked about the time-independent Schrödinger equation. In that case, the Hamiltonian — which you can think of as a mathematical object that can describe the...

4.2 Quantum annealing

Although we have just seen that adiabatic quantum computing is, theoretically, a perfectly viable alternative to the quantum circuit model, in its practical incarnation it is usually implemented in a restricted version called quantum annealing.

Quantum annealing relies on the same core idea as adiabatic quantum computing: it takes an initial Hamiltonian , a final Hamiltonian whose ground state encodes the solution to the problem of interest, and it gradually changes the acting Hamiltonian from the initial to the final one by using some functions and (as described in the previous section) to decrease the action of and to increase the action of . However, quantum annealing deviates from full adiabatic quantum computing in two ways. First of all, in practical implementations of quantum annealing, the final Hamiltonian that can be realized cannot be chosen completely at will, but has to be selected from a certain, restricted class. A typical option is an Ising...

4.3 Using Ocean to formulate and transform optimization problems

As we have just seen, the BinaryQuadraticModel class can be used to define both Ising and QUBO problems. But dimod also offers other models and utilities that will make our lives a little bit easier. Let’s start by studying how we can conveniently define problems with linear restrictions.

4.3.1 Constrained quadratic models in Ocean

You surely remember that a problem like

is an instance of binary linear programming. In Section 3.4.1, we studied this family of problems in detail and we showed that they can be transformed into the QUBO and Ising models by using slack variables and penalty terms.

So, imagine that you want to solve the preceding problem in a quantum annealer. Do you need to perform all those boring transformations in order to obtain the QUBO coefficients and then use them to define a BinaryQuadraticModel object? No! Fortunately, dimod provides the ConstrainedQuadraticModel class, which simplifies...

4.4 Solving optimization problems on quantum annealers with Leap

So far, we have run a couple of different optimization problems on actual quantum annealers. However, we have always used the default parameters and we do not even know the characteristics of the quantum computers that we are using. In this section, we shall remedy that. We will explain the different types of annealers that we can access through D-Wave Leap. We will also explore several hyperparameters that we can tweak when we are using these devices, and we will explain how to adjust the way in which our problems are embedded in the physical qubits — we will finally learn what that mysterious EmbeddingComposite object is used for!

4.4.1 The Leap annealers

You can list the devices to which you have access with your Leap account by using the get_solvers method in this way:

from dwave.cloud import Client 
 
for solver in Client.from_config().get_solvers(): 
 
    print(solver)

The results will depend on your actual...

Summary

In this chapter, you have learned about the adiabatic quantum computing model, which is equivalent to the quantum circuit model that we had already studied. Instead of discrete quantum gates, adiabatic quantum computing uses continuous evolution through a time-dependent Hamiltonian. You have learned how to select this Hamiltonian to encode combinatorial optimization problems and how, if the evolution is slow enough, the adiabatic theorem guarantees that we will measure the ground state at the end of the process.

You have also learned that, in practice, quantum annealing is used instead of adiabatic quantum computing, because adiabatic evolution can take too long for the process to be feasible. What is more, you now know how to use actual quantum annealers through D-Wave Leap to find approximate solutions to combinatorial optimization problems in several different ways.

You also know how to control several parameters of the annealing process, in order to improve the quality of...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
A Practical Guide to Quantum Machine Learning and Quantum Optimization
Published in: Mar 2023Publisher: PacktISBN-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.
undefined
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 €14.99/month. Cancel anytime

Authors (2)

author image
Elías F. Combarro

Elías F. Combarro holds degrees from the University of Oviedo (Spain) in both Mathematics (1997, award for second highest grades in the country) and Computer Science (2002, award for highest grades in the country). After some research stays at the Novosibirsk State University (Russia), he obtained a Ph.D. in Mathematics (Oviedo, 2001) with a dissertation on the properties of some computable predicates under the supervision of Prof. Andrey Morozov and Prof. Consuelo Martínez. Since 2009, Elías F. Combarro has been an associate professor at the Computer Science Department of the University of Oviedo. He has published more than 50 research papers in international journals on topics such as Computability Theory, Machine Learning, Fuzzy Measures and Computational Algebra. His current research focuses on the application Quantum Computing to algebraic, optimisation and machine learning problems. From July 2020 to January 2021, he was a Cooperation Associate at CERN openlab. Currently, he is the Spain representative in the Advisory Board of CERN Quantum Technology Initiative, a member of the Advisory Board of SheQuantum and one of the founders of the QSpain, a quantum computing think tank based in Spain.
Read more about Elías F. Combarro

author image
Samuel González-Castillo

Samuel González-Castillo holds degrees from the University of Oviedo (Spain) in both Mathematics and Physics (2021). He is currently a mathematics research student at the National University of Ireland, Maynooth, where he works as a graduate teaching assistant. He completed his physics bachelor thesis under the supervision of Prof. Elías F. Combarro and Prof. Ignacio F. Rúa (University of Oviedo), and Dr. Sofia Vallecorsa (CERN). In it, he worked alongside other researchers from ETH Zürich on the application of Quantum Machine Learning to classification problems in High Energy Physis. In 2021, he was a summer student at CERN developing a benchmarking framework for quantum simulators. He has contributed to several conferences on quantum computing.
Read more about Samuel González-Castillo