Quantum optimization algorithms are
quantum algorithms
In quantum computing, a quantum algorithm is an algorithm that runs on a realistic model of quantum computation, the most commonly used model being the quantum circuit model of computation. A classical (or non-quantum) algorithm is a finite sequ ...
that are used to solve optimization problems.
Mathematical optimization
Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criteria, from some set of available alternatives. It is generally divided into two subfiel ...
deals with finding the best solution to a problem (according to some criteria) from a set of possible solutions. Mostly, the optimization problem is formulated as a minimization problem, where one tries to minimize an error which depends on the solution: the optimal solution has the minimal error. Different optimization techniques are applied in various fields such as
mechanics
Mechanics () is the area of physics concerned with the relationships between force, matter, and motion among Physical object, physical objects. Forces applied to objects may result in Displacement (vector), displacements, which are changes of ...
,
economics
Economics () is a behavioral science that studies the Production (economics), production, distribution (economics), distribution, and Consumption (economics), consumption of goods and services.
Economics focuses on the behaviour and interac ...
and
engineering
Engineering is the practice of using natural science, mathematics, and the engineering design process to Problem solving#Engineering, solve problems within technology, increase efficiency and productivity, and improve Systems engineering, s ...
, and as the complexity and amount of data involved rise, more efficient ways of solving optimization problems are needed.
Quantum computing
A quantum computer is a computer that exploits quantum mechanical phenomena. On small scales, physical matter exhibits properties of wave-particle duality, both particles and waves, and quantum computing takes advantage of this behavior using s ...
may allow problems which are not practically feasible on classical computers to be solved, or suggest a considerable speed up with respect to the best known classical algorithm.
Quantum data fitting
Data fitting is a process of constructing a
mathematical function
In mathematics, a function from a set (mathematics), set to a set assigns to each element of exactly one element of .; the words ''map'', ''mapping'', ''transformation'', ''correspondence'', and ''operator'' are sometimes used synonymously. ...
that best fits a set of data points. The fit's quality is measured by some criteria, usually the distance between the function and the data points.
Quantum least squares fitting
One of the most common types of data fitting is solving the
least squares
The method of least squares is a mathematical optimization technique that aims to determine the best fit function by minimizing the sum of the squares of the differences between the observed values and the predicted values of the model. The me ...
problem, minimizing the sum of the squares of differences between the data points and the fitted function.
The algorithm is given
input data points
and
continuous function
In mathematics, a continuous function is a function such that a small variation of the argument induces a small variation of the value of the function. This implies there are no abrupt changes in value, known as '' discontinuities''. More preci ...
s
. The algorithm finds and gives as output a continuous function
that is a
linear combination
In mathematics, a linear combination or superposition is an Expression (mathematics), expression constructed from a Set (mathematics), set of terms by multiplying each term by a constant and adding the results (e.g. a linear combination of ''x'' a ...
of
:
:
In other words, the algorithm finds the
complex
Complex commonly refers to:
* Complexity, the behaviour of a system whose components interact in multiple ways so possible interactions are difficult to describe
** Complex system, a system composed of many components which may interact with each ...
coefficients
, and thus the vector
.
The algorithm is aimed at minimizing the error, which is given by:
:
where
is defined to be the following matrix:
:
The quantum least-squares fitting algorithm makes use of a version of Harrow, Hassidim, and Lloyd's
quantum algorithm for linear systems of equations
The Harrow–Hassidim–Lloyd (HHL) algorithm is a quantum algorithm for numerically solving a system of linear equations, designed by Aram Harrow, Avinatan Hassidim, and Seth Lloyd. The algorithm estimates the result of a scalar measurement on t ...
(HHL), and outputs the coefficients
and the fit quality estimation
. It consists of three subroutines: an algorithm for performing a pseudo-
inverse operation, one routine for the fit quality estimation, and an algorithm for learning the fit parameters.
Because the quantum algorithm is mainly based on the HHL algorithm, it suggests an exponential improvement in the case where
is
sparse and the
condition number
In numerical analysis, the condition number of a function measures how much the output value of the function can change for a small change in the input argument. This is used to measure how sensitive a function is to changes or errors in the inpu ...
(namely, the ratio between the largest and the smallest
eigenvalues
In linear algebra, an eigenvector ( ) or characteristic vector is a vector that has its direction unchanged (or reversed) by a given linear transformation. More precisely, an eigenvector \mathbf v of a linear transformation T is scaled by a ...
) of both
and
is small.
Quantum semidefinite programming
Semidefinite programming
Semidefinite programming (SDP) is a subfield of mathematical programming concerned with the optimization of a linear objective function (a user-specified function that the user wants to minimize or maximize)
over the intersection of the cone of po ...
(SDP) is an optimization subfield dealing with the optimization of a linear
objective function
In mathematical optimization and decision theory, a loss function or cost function (sometimes also called an error function) is a function that maps an event or values of one or more variables onto a real number intuitively representing some "cost ...
(a user-specified function to be minimized or maximized), over the intersection of the
cone
In geometry, a cone is a three-dimensional figure that tapers smoothly from a flat base (typically a circle) to a point not contained in the base, called the '' apex'' or '' vertex''.
A cone is formed by a set of line segments, half-lines ...
of
positive semidefinite matrices with an
affine space
In mathematics, an affine space is a geometric structure that generalizes some of the properties of Euclidean spaces in such a way that these are independent of the concepts of distance and measure of angles, keeping only the properties relat ...
. The objective function is an
inner product
In mathematics, an inner product space (or, rarely, a Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation called an inner product. The inner product of two vectors in the space is a scalar, ofte ...
of a matrix
(given as an input) with the variable
. Denote by
the space of all
symmetric matrices. The variable
must lie in the (closed convex) cone of positive semidefinite symmetric matrices
. The inner product of two matrices is defined as:
The problem may have additional constraints (given as inputs), also usually formulated as inner products. Each constraint forces the inner product of the matrices
(given as an input) with the optimization variable
to be smaller than a specified value
(given as an input). Finally, the SDP problem can be written as:
:
The best classical algorithm is not known to unconditionally run in
polynomial time
In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations p ...
. The corresponding feasibility problem is known to either lie outside of the union of the complexity classes NP and co-NP, or in the intersection of NP and co-NP.
The quantum algorithm
The algorithm inputs are
and parameters regarding the solution's
trace
Trace may refer to:
Arts and entertainment Music
* ''Trace'' (Son Volt album), 1995
* ''Trace'' (Died Pretty album), 1993
* Trace (band), a Dutch progressive rock band
* ''The Trace'' (album), by Nell
Other uses in arts and entertainment
* ...
, precision and optimal value (the objective function's value at the optimal point).
The quantum algorithm consists of several iterations. In each iteration, it solves a
feasibility problem, namely, finds any solution satisfying the following conditions (giving a threshold
):
:
In each iteration, a different threshold
is chosen, and the algorithm outputs either a solution
such that
(and the other constraints are satisfied, too) or an indication that no such solution exists. The algorithm performs a
binary search
In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the m ...
to find the minimal threshold
for which a solution
still exists: this gives the minimal solution to the SDP problem.
The quantum algorithm provides a quadratic improvement over the best classical algorithm in the general case, and an exponential improvement when the input matrices are of low
rank
A rank is a position in a hierarchy. It can be formally recognized—for example, cardinal, chief executive officer, general, professor—or unofficial.
People Formal ranks
* Academic rank
* Corporate title
* Diplomatic rank
* Hierarchy ...
.
Quantum combinatorial optimization
The
combinatorial optimization
Combinatorial optimization is a subfield of mathematical optimization that consists of finding an optimal object from a finite set of objects, where the set of feasible solutions is discrete or can be reduced to a discrete set. Typical combina ...
problem is aimed at finding an optimal object from a
finite set
In mathematics, particularly set theory, a finite set is a set that has a finite number of elements. Informally, a finite set is a set which one could in principle count and finish counting. For example,
is a finite set with five elements. Th ...
of objects. The problem can be phrased as a maximization of an
objective function
In mathematical optimization and decision theory, a loss function or cost function (sometimes also called an error function) is a function that maps an event or values of one or more variables onto a real number intuitively representing some "cost ...
which is a sum of
Boolean function
In mathematics, a Boolean function is a function whose arguments and result assume values from a two-element set (usually , or ). Alternative names are switching function, used especially in older computer science literature, and truth functi ...
s. Each Boolean function
gets as input the
-bit string
and gives as output one bit (0 or 1). The combinatorial optimization problem of
bits and
clauses is finding an
-bit string
that maximizes the function
:
Approximate optimization is a way of finding an approximate solution to an optimization problem, which is often
NP-hard
In computational complexity theory, a computational problem ''H'' is called NP-hard if, for every problem ''L'' which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from ''L'' to ''H''. That is, assumi ...
. The approximated solution of the combinatorial optimization problem is a string
that is close to maximizing
.
Quantum approximate optimization algorithm
For combinatorial optimization, the quantum approximate optimization algorithm (QAOA) briefly had a better approximation ratio than any known
polynomial time
In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations p ...
classical algorithm (for a certain problem), until a more effective classical algorithm was proposed. The relative speed-up of the quantum algorithm is an open research question.
QAOA consists of the following steps:
# Defining a ''cost Hamiltonian''
such that its ground state encodes the solution to the optimization problem.
# Defining a ''mixer Hamiltonian''
.
# Defining the oracles
and
, with parameters
and α.
# Repeated application of the oracles
and
, in the order:
# Preparing an initial state, that is a superposition of all possible states and apply
to the state.
# Using classical methods to optimize the parameters
and measure the output state of the optimized circuit to obtain the approximate optimal solution to the cost Hamiltonian. An optimal solution will be one that maximizes the expectation value of the cost Hamiltonian
.

The layout of the algorithm, viz, the use of cost and mixer Hamiltonians are inspired from the
Quantum Adiabatic theorem, which states that starting in a ground state of a time-dependent Hamiltonian, if the Hamiltonian evolves slowly enough, the final state will be a ground state of the final Hamiltonian. Moreover, the adiabatic theorem can be generalized to any other eigenstate as long as there is no overlap (degeneracy) between different eigenstates across the evolution. Identifying the initial Hamiltonian with
and the final Hamiltonian with
, whose ground states encode the solution to the optimization problem of interest, one can approximate the optimization problem as the adiabatic evolution of the Hamiltonian from an initial to the final one, whose ground (eigen)state gives the optimal solution. In general, QAOA relies on the use of
unitary operators
In functional analysis, a unitary operator is a surjective bounded operator on a Hilbert space that preserves the inner product.
Non-trivial examples include rotations, reflections, and the Fourier operator.
Unitary operators generalize unita ...
dependent on
angle
In Euclidean geometry, an angle can refer to a number of concepts relating to the intersection of two straight Line (geometry), lines at a Point (geometry), point. Formally, an angle is a figure lying in a Euclidean plane, plane formed by two R ...
s (parameters), where
is an input integer, which can be identified the number of layers of the oracle
. These operators are iteratively applied on a state that is an equal-weighted
quantum superposition
Quantum superposition is a fundamental principle of quantum mechanics that states that linear combinations of solutions to the Schrödinger equation are also solutions of the Schrödinger equation. This follows from the fact that the Schrödi ...
of all the possible states in the computational basis. In each iteration, the state is measured in the computational basis and the Boolean function
is estimated. The angles are then updated classically to increase
. After this procedure is repeated a sufficient number of times, the value of
is almost optimal, and the state being measured is close to being optimal as well. A sample circuit that implements QAOA on a quantum computer is given in figure. This procedure is highlighted using the following example of finding the
minimum vertex cover of a graph.
QAOA for finding the minimum vertex cover of a graph
The goal here is to find a
minimum vertex cover of a graph: a collection of vertices such that each edge in the graph contains at least one of the vertices in the cover. Hence, these vertices “cover” all the edges. We wish to find a vertex cover that has the smallest possible number of vertices. Vertex covers can be represented by a bit string where each bit denotes whether the corresponding vertex is present in the cover. For example, the bit string 0101 represents a cover consisting of the second and fourth vertex in a graph with four vertices.

Consider the graph given in the figure. It has four vertices and there are two minimum vertex cover for this graph: vertices 0 and 2, and the vertices 1 and 2. These can be respectively represented by the bit strings 1010 and 0110. The goal of the algorithm is to sample these bit strings with high probability. In this case, the cost Hamiltonian has two ground states, , 1010⟩ and , 0110⟩, coinciding with the solutions of the problem. The mixer Hamiltonian is the simple, non-commuting sum of
Pauli-X operations on each node of the graph and they are given by:

Implementing QAOA algorithm for this four qubit circuit with two layers of the ansatz in qiskit (see figure) and optimizing leads to a probability distribution for the states given in the figure. This shows that the states , 0110⟩ and , 1010⟩ have the highest probabilities of being measured, just as expected.
Generalization of QAOA to constrained combinatorial optimisation
In principle the optimal value of
can be reached up to arbitrary precision, this is guaranteed by the adiabatic theorem or alternatively by the universality of the QAOA unitaries. However, it is an open question whether this can be done in a feasible way.
For example, it was shown that QAOA exhibits a strong dependence on the ratio of a problem's
constraint to
variables
Variable may refer to:
Computer science
* Variable (computer science), a symbolic name associated with a value and whose associated value may be changed
Mathematics
* Variable (mathematics), a symbol that represents a quantity in a mathemat ...
(problem density) placing a limiting restriction on the algorithm's capacity to minimize a corresponding
objective function
In mathematical optimization and decision theory, a loss function or cost function (sometimes also called an error function) is a function that maps an event or values of one or more variables onto a real number intuitively representing some "cost ...
.
It was soon recognized that a generalization of the QAOA process is essentially an alternating application of a continuous-time quantum walk on an underlying graph followed by a quality-dependent phase shift applied to each solution state. This generalized QAOA was termed as QWOA (Quantum Walk-based Optimisation Algorithm).
In the paper ''How many qubits are needed for quantum computational supremacy'' submitted to arXiv, the authors conclude that a QAOA circuit with 420
qubits
In quantum computing, a qubit () or quantum bit is a basic unit of quantum information—the quantum version of the classic binary bit physically realized with a two-state device. A qubit is a two-state (or two-level) quantum-mechanical system, ...
and 500
constraints would require at least one century to be simulated using a classical simulation algorithm running on
state-of-the-art
The state of the art (SOTA or SotA, sometimes cutting edge, leading edge, or bleeding edge) refers to the highest level of general development, as of a device, technique, or scientific field achieved at a particular time. However, in some contex ...
supercomputers
A supercomputer is a type of computer with a high level of performance as compared to a general-purpose computer. The performance of a supercomputer is commonly measured in floating-point operations per second (FLOPS) instead of million instru ...
so that would be
sufficient for
quantum computational supremacy.
A rigorous comparison of QAOA with classical algorithms can give estimates on depth
and number of qubits required for quantum advantage. A study of QAOA and
MaxCut algorithm shows that
is required for scalable advantage.
Variations of QAOA
Several variations to the basic structure of QAOA have been proposed, which include variations to the ansatz of the basic algorithm. The choice of ansatz typically depends on the problem type, such as combinatorial problems represented as graphs, or problems strongly influenced by hardware design. However, ansatz design must balance specificity and generality to avoid overfitting and maintain applicability to a wide range of problems. For this reason, designing optimal ansatze for QAOA is an extensively researched and widely investigated topic. Some of the proposed variants are:
# Multi-angle QAOA
# Expressive QAOA (XQAOA)
# QAOA+
# Digitised counteradiabatic QAOA
# Quantum alternating operator ansatz,which allows for constrains on the optimization problem etc.
Another variation of QAOA focuses on techniques for parameter optimization, which aims at selecting the optimal set of initial parameters for a given problem and avoiding barren plateaus, which represent parameters leading to eigenstates which correspond to plateaus in the energy landscape of the cost Hamiltonian.
Finally, there has been significant research interest in leveraging specific hardware to enhance the performance of QAOA across various platforms, such as trapped ion, neutral atoms, superconducting qubits, and photonic quantum computers. The goals of these approaches include overcoming hardware connectivity limitations and mitigating noise-related issues to broaden the applicability of QAOA to a wide range of combinatorial optimization problems.
QAOA algorithm Qiskit implementation

The quantum circuit shown here is from a simple example of how the QAOA algorithm can be implemented in Python
using
Qiskit, an open-source quantum computing software development framework by IBM.
See also
*
Adiabatic quantum computation
*
Quantum annealing
Quantum annealing (QA) is an optimization process for finding the global minimum of a given objective function over a given set of candidate solutions (candidate states), by a process using quantum fluctuations. Quantum annealing is used mainly ...
References
External links
Implementation of the QAOA algorithm for the knapsack problem with Classiq
{{Quantum information
Quantum algorithms