Quantum Algorithms for Optimization
Quantum optimization uses quantum operations to find a low-cost feasible answer, estimate an optimum, or sample useful candidates. These are different tasks. An algorithm that estimates a mean cost need not frequently produce an optimal bit string; one that estimates an optimal value need not return the corresponding vector.
The available input also matters. A reversible objective circuit, a searchable tree, a programmable Ising Hamiltonian and a convex-set membership oracle support different algorithms. This page explains how to choose among those possibilities through small calculations. Being NP-hard does not itself make a problem suitable for a quantum speedup.
Helpful background. Algorithmic primitives distinguishes quantum queries, state preparation and measured outputs; amplitude amplification explains coherent repetition; QAOA develops alternating cost and mixer operations.
Feasible answers and optimization guarantees
Section titled “Feasible answers and optimization guarantees”For a finite, nonempty feasible set , let
Unless stated otherwise, lower cost is better. For continuous problems, existence of a minimizer needs justification: continuity on a nonempty compact set is one sufficient condition. Otherwise the appropriate quantity may be an infimum that no feasible point attains.
Three questions already lead to different outputs:
| Question | Useful answer | What remains to check |
|---|---|---|
| Is there a feasible point below a threshold? | A candidate with | Its constraints and cost |
| What is the optimum value? | A scalar estimate of | Its error and confidence |
| Which point is optimal? | An optimizing point or bit string | Its feasibility and the guarantee of optimality |
A bounded-error algorithm can return an exact optimizer with probability at least without attaching an efficiently checkable proof that this particular output is optimal. Its theorem gives the probability guarantee. A separately verifiable certificate is stronger output: for minimization, a feasible value together with a valid lower bound certifies
Recomputing a candidate’s objective is usually much easier than excluding every better candidate. The best sample observed so far is not automatically an optimality certificate.
For a nonnegative maximization objective with optimum , an approximation ratio can be useful. Adding a constant preserves the optimizer but changes this ratio: values and have ratio , whereas values and have ratio . Use additive gaps when the zero of the objective is arbitrary. For nonnegative weighted MaxCut, the Goemans–Williamson algorithm provides a classical approximation guarantee worth comparing with quantum methods.
A mean cost is not a hit probability
Section titled “A mean cost is not a hit probability”Suppose the target is . A distribution concentrated at and a distribution split equally between and both have mean . Their target probabilities are respectively and . With independent samples the second succeeds at least once with probability , while the first never succeeds.
There can nevertheless be useful bounds from the mean. For a nonnegative integer cost with optimum and every nonoptimal cost at least ,
The bound is informative only when the mean is below the known gap. Without the range or gap assumption, it does not follow from a mean alone. Feasibility also matters: a very low cost on an infeasible string is not a good answer.
Binary costs, penalties and Ising Hamiltonians
Section titled “Binary costs, penalties and Ising Hamiltonians”A quadratic binary cost has the form
Set , where is the eigenvalue of on the computational state . The resulting diagonal Hamiltonian satisfies . Keep its constant term when comparing energies, even though the constant does not change which strings minimize them.
When a penalty actually enforces a constraint
Section titled “When a penalty actually enforces a constraint”Write , where and precisely on the feasible set. Assume that this set is nonempty. Let be its minimum, and suppose every infeasible string has and . Then
whenever . This sufficient condition concerns exact ground states; it does not say that a finite-temperature sampler, a shallow circuit or a noisy device outputs only feasible strings.
Increasing can also make a hardware implementation harder. If the largest coefficient is rescaled to a fixed physical limit, an order-one difference between feasible costs may shrink like relative to temperature or control errors. An exact algebraic penalty and a useful physical scale are separate considerations.
Worked example: three weighted vertices
Section titled “Worked example: three weighted vertices”On a triangle with vertex weights , an independent set cannot select two adjacent vertices. Minimize
The best feasible string is , with value . The possible competitors for the global minimum are
For , every other string lies above at least one of these. Thus the ground string is for ; tie at ; minimize for ; and tie at . Only makes every ground string feasible.
The three curves give the candidate ground energies of the weighted triangle. The lowest curve determines the answer. At , feasibility is not assured because two infeasible strings remain degenerate with .
At , all eight values in order are . Substituting the binary-to-spin relation gives
For example, maps to and still has energy .
Coefficient precision can change the optimum
Section titled “Coefficient precision can change the optimum”Suppose a programmed cost satisfies for every string. If is a true minimizer and minimizes the programmed cost, then
The two error terms arise when comparing each cost to its programmed value. A unique optimum separated by a gap greater than therefore remains the unique optimum. At equality a tie can occur. This is a uniform cost error bound, not a bound on one coefficient unless the contributions of all coefficients have been included. Ancilla reductions, physical chains and broken-chain repair need their own analysis.
Minimum finding and amplified proposals
Section titled “Minimum finding and amplified proposals”For entries with coherent value and comparison access, the Dürr–Høyer algorithm finds an index of a minimum using value queries, with failure at most . It improves an incumbent by searching for a smaller value. Strict improvement, or a specified tie-breaking order, avoids treating an equal-cost result as progress. This theorem counts queries, not the time to load an arbitrary table or build its reversible evaluation circuit.
For a fixed threshold, mark strings whose objective and feasibility tests both pass. If the initial success probability is , the ideal Grover rotation gives
The derivation and unknown- schedules are in Grover search. More iterations are not always better: an excessive rotation can reduce success. The unstructured lower bounds and optimal search analysis refer to that oracle setting, not every structured optimization problem.
Worked example: a threshold and two attempts
Section titled “Worked example: a threshold and two attempts”Take the values
Values strictly below occur at zero-based indices . Uniform preparation has ; one Grover iterate gives
Two independent, verified attempts succeed at least once with probability
This meets a target, while one attempt does not. The two attempts use two preparations, two phase queries and two diffusion operations. If each phase query computes a value, applies its threshold phase and uncomputes, it uses two value-oracle calls, giving four in total. Measurement and classical verification are additional operations.
Coherent use of a classical heuristic
Section titled “Coherent use of a classical heuristic”If a classical randomized algorithm is given as a bounded-time circuit with explicit random bits, it can be made reversible while retaining those bits and its workspace. Prepare the random bits in superposition and run that circuit coherently. The resulting state need not be a pure state of the candidate register alone:
A success test on and a reflection about the whole prepared state still permit amplitude amplification. Retained garbage is not by itself an obstacle: reverses it. Discarding or measuring that workspace before the reflection changes the procedure and can destroy the interference.
A device that supplies only classical samples does not supply this coherent circuit or its inverse. Variable-time stopping, external memory calls and finite precision also affect the cost of reversible implementation. Once those operations are available, a proposal with target weight changes the ideal repetition scale from to , under the appropriate known- or unknown-success search scheme.
Structured search through graphs and trees
Section titled “Structured search through graphs and trees”Structure can matter more than a flat search improvement. Dynamic programming, symmetry reduction, bounds or good variable ordering may avoid most of the candidate strings.
For example, let a finite reversible ergodic Markov chain have stationary distribution , marked mass at least , and absolute spectral gap . A lazy chain avoids negative eigenvalues near . With coherent setup, update and marked-state checking costs , the MNRS quantum search algorithm finds a marked state, when one exists under the promise, with constant success at cost
A slow-mixing chain can make the update term large. The quantum-walk treatment explains the spectral construction.
For a backtracking tree with nodes on variables, Montanaro (2018) gives a bounded-error solution-finding procedure using tests under its coherent branching and predicate assumptions. The depth factors and reversible cost of each test matter.
Branch-and-bound also assigns a lower cost bound to each partial assignment. The bound must never exceed the cheapest feasible completion. An overestimated bound can prune the true optimum. A rounded lower bound needs a conservative error margin, not merely a small average numerical error.
In the bounded-degree tree model of Montanaro (2020), node bounds are nondecreasing down each branch, integer-valued in a known finite range, or infinite for an impossible branch. Let be the depth, bound the finite cost range, and count nodes remaining when bounds above the optimal cost are removed. A minimum-cost leaf can be found with constant failure probability using
bound and branching queries. Logarithmic factors in depth, cost precision and inverse failure probability are suppressed. If there is no solution, is the whole tree. The comparison uses the same branching and bounding procedures; its classical lower-bound comparison concerns finding all minimal leaves, or the usual distinct-cost case. It does not compare against every classical solver with different preprocessing.
Variational circuits, adiabatic evolution and annealing
Section titled “Variational circuits, adiabatic evolution and annealing”These methods act on a cost Hamiltonian rather than only on a table of values. Their guarantees are different.
| Method | How it uses the cost | What determines the result |
|---|---|---|
| QAOA | Alternates cost phases with a mixer | Initial state, mixer, depth and trained angles |
| Adiabatic computation | Follows an evolving low-energy subspace | Preparation, path, gap, schedule and runtime |
| Quantum annealing | Evolves under a programmed driver and cost | Finite-time dynamics, environment and decoding |
For QAOA, with the first layer acting first, write
Here represents a minimization cost. The MaxCut convention in the linked article instead maximizes a reward : using reverses the cost-phase sign at the same numerical angle. A constant shift adds only a global phase to an uncontrolled cost evolution.
A constraint-preserving mixer keeps a feasible initial state inside the feasible subspace. Connectivity of its transitions is an additional reachability question, not the definition of preservation; even connectivity alone does not prove that a fixed alternating ansatz can prepare every state. See the alternating-operator construction.
The ideal minimum of over all angles, a trained parameter choice, its estimated mean and its measured best bit string are different. Training uses many circuit evaluations; independent samples should assess the selected parameters. Family-specific guarantees and low-depth obstructions are discussed with their assumptions on the QAOA page, rather than implying universal success or failure.
For an adiabatic path , require , and a physical schedule . Endpoint ground states alone give no runtime bound. Relevant gaps, derivative couplings, smoothness and possible degeneracy enter the error estimate. The equivalence with gate computation established by Aharonov et al. does not give an efficient gap for an arbitrary optimization path.
Quantum annealing may be nonadiabatic and open to an environment; its final distribution need not be Gibbs or ground-state concentrated. Embedding, coefficient rescaling, readout, broken-chain repair and rejected samples all affect the rate of useful answers. The transverse-field approach originates in Kadowaki and Nishimori (1998).
Convex optimization and checkable bounds
Section titled “Convex optimization and checkable bounds”For this section use a maximization linear program:
For feasible , multiplying the inequalities by nonnegative coordinates gives . Thus a primal point gives a lower bound and a dual point an upper bound. Equality proves optimality without an enumeration of all points.
For a semidefinite program, replace by a positive semidefinite matrix , the objective by and constraints by . Its dual requires , . Weak duality follows from positivity of the trace of the product of two positive matrices. Zero duality gap or attainment needs additional hypotheses, such as appropriate strict feasibility; it is not automatic for every SDP.
Worked example: one point and one bound
Section titled “Worked example: one point and one bound”Maximize subject to , , , . The feasible point has value . Nonnegative dual multipliers satisfy , and give
The matching lower and upper bounds prove that is optimal.
Numerical residuals cannot be ignored. Multipliers would give the false upper bound , because both dual constraints have deficit . If all primal feasible points satisfy , an approximate nonnegative dual vector gives the rigorous bound
Here takes positive parts coordinatewise. In the example gives , so the corrected bound is . The correction requires a valid radius bound and controlled arithmetic.
Which operations are actually supplied?
Section titled “Which operations are actually supplied?”A membership oracle says whether a point belongs to a convex body, up to a specified boundary tolerance. A separation oracle supplies a hyperplane excluding an exterior point. Coherent membership, entry access to a sparse matrix and a block encoding are distinct inputs.
Under geometric and precision assumptions including inner/outer radius bounds, van Apeldoorn and collaborators implement separation with polylogarithmically many quantum membership queries and optimization in dimension with such queries. The latter improves a quadratic classical upper bound; it is not a matching quadratic separation theorem. Their optimization lower bounds are queries with a known interior point and separation queries without one van Apeldoorn et al. (2020). Returning a hyperplane or optimizer explicitly still requires writing its coordinates; a query bound does not count that output time.
For entry-query LP/SDP solvers, a separate worst-case bound becomes when constraint count and matrix dimension are comparable. The constructed hard family has growing primal and dual solution-size parameters: it is not a lower bound with every norm and accuracy parameter fixed. In that construction the customary bounds grow as at constant additive accuracy van Apeldoorn et al. (2020), Corollary 31. Dependence on , sparsity and the output must accompany any dimension-based comparison.
A quantum state over basis labels needs a -qubit register, but does not reveal signed coordinates in one measurement. An explicit vector using bits per coordinate contains bits, or KiB. These are different answers. The payload count alone is not a universal tomography or query lower bound. Quantum linear algebra and block encodings explain the relevant implicit representations.
Repetitions and the cost of a useful answer
Section titled “Repetitions and the cost of a useful answer”Let be the probability that an attempt returns a verified target. For independent identically distributed attempts and , the smallest number reaching failure at most is
If , repetition cannot help; if , one attempt suffices. If samples share a random device condition, identical one-run probabilities do not establish independence. In the extreme case where one Bernoulli variable determines every run, repeating leaves the success probability at rather than raising it to .
For adaptive attempts let be the probability of success on attempt , conditional on all previous attempts failing. Then the exact failure probability is . Uniform conditional lower bounds give a conservative iid-shaped bound even without independence. Marginal one-run probabilities cannot be substituted for these conditional quantities.
Postselection also changes the count. If feasibility acceptance is and the conditional target probability among accepted strings is , the per-preparation target probability is . At , , a success target requires independent preparations, not the two suggested by using alone. All discarded samples took time.
A pilot estimate of has uncertainty. If is a valid lower confidence bound with failure , choosing the repetitions from and a retry failure target bounds the combined failure by , provided the future attempts obey the assumed success model.
Finally compare complete procedures: input preparation, reversible work, training, repetitions, readout and verification. Use classical methods suited to the same structure—bounds, relaxations, dynamic programming and tuned heuristics, not only uniform guessing. Practical comparisons and definitions of speedup are discussed by Rønnow et al. and in optimization case studies; algorithmic benchmarking explains how to compare the same output quality and confidence.
Exercises
Section titled “Exercises”1. Convert a binary polynomial
Section titled “1. Convert a binary polynomial”For , find the Ising constant, fields and pair coupling. Check every bit string.
Solution
Substituting gives
The constant is ; the fields are and . In order , both formulas give . Omitting the constant preserves the minimizing string but changes every energy.
2. Test a borderline penalty
Section titled “2. Test a borderline penalty”Minimize with , using penalty . For which are all ground strings feasible?
Solution
The feasible strings have values . The infeasible string has value . It must lie strictly above , so . At , feasible and infeasible tie. Requiring only that some ground state be feasible would miss this distinction.
3. Bound the ground-string probability
Section titled “3. Bound the ground-string probability”A nonnegative integer cost takes values and has mean . Find the strongest lower bound on the probability of cost zero that follows from the smallest positive cost. Give a distribution attaining it.
Solution
Since , . The distribution attains equality. Probability at cost would need more weight at zero to keep the same mean. The exact optimum probability is not fixed by the mean.
4. Count independent threshold searches
Section titled “4. Count independent threshold searches”Derive for the sixteen-entry example and find the smallest number of independent attempts for confidence.
Solution
With , . Squaring gives . One attempt falls short; two give . They require two threshold phase queries, or four value queries if each phase operation computes and uncomputes its value.
5. Compare flat and tree search costs
Section titled “5. Compare flat and tree search costs”Compare for with the displayed backtracking expression for , . Let one flat query cost gates and one coherent tree test cost . When is the latter displayed expression smaller?
Solution
The values are and approximately . The displayed tree cost is smaller if . This compares only those leading expressions; asymptotic notation hides constants, and the branching procedure determines . It is not a measured crossover or a comparison with the best classical algorithm.
6. Prove a linear-program optimum
Section titled “6. Prove a linear-program optimum”For the linear program above, derive weak duality directly and use the primal point and dual point to prove optimality.
Solution
For feasible points and nonnegative dual variables,
Both chosen points are feasible, and their objectives equal . No primal point can do better and no dual point can give a smaller bound. This proves optimality without relying on the success of a numerical solver.
7. Repair a nearly feasible dual bound
Section titled “7. Repair a nearly feasible dual bound”In the same program, take . Its raw objective is . Bound the effect of its dual-constraint violation, first using , then the tighter individual constraint .
Solution
The deficits are and . The bound gives . Only the coefficient is deficient, so using improves this to . Both corrected values are upper bounds; is not.
8. Include rejected samples
Section titled “8. Include rejected samples”A sampler accepts a feasible answer with probability ; conditionally, of accepted answers meet the target. Compute the independent preparation count for confidence. Explain why the same marginal probabilities do not suffice when every preparation shares one random outcome.
Solution
One preparation succeeds with probability . Thus ; do not suffice. Using the conditional probability would incorrectly give . If the entire batch is determined by one Bernoulli success variable, the probability of any success is still , however large the batch. The product formula instead needs probabilities conditional on previous failures, or a justified independence model.
References
Section titled “References”- Dorit Aharonov, Wim van Dam, Julia Kempe, Zeph Landau, Seth Lloyd, and Oded Regev, “Adiabatic Quantum Computation Is Equivalent to Standard Quantum Computation,” SIAM Journal on Computing 37(1), 166–194 (2007), doi:10.1137/S0097539705447323.
- Charles H. Bennett, Ethan Bernstein, Gilles Brassard, and Umesh Vazirani, “Strengths and Weaknesses of Quantum Computing,” SIAM Journal on Computing 26(5), 1510–1523 (1997), doi:10.1137/S0097539796300933.
- Gilles Brassard, Peter Høyer, Michele Mosca, and Alain Tapp, “Quantum Amplitude Amplification and Estimation,” Contemporary Mathematics 305, 53–74 (2002), doi:10.1090/conm/305/05215.
- Christoph Dürr and Peter Høyer, “A Quantum Algorithm for Finding the Minimum,” arXiv:quant-ph/9607014 (1996), arXiv:quant-ph/9607014.
- Edward Farhi, Jeffrey Goldstone, and Sam Gutmann, “A Quantum Approximate Optimization Algorithm,” arXiv:1411.4028 (2014), arXiv:1411.4028.
- Michel X. Goemans and David P. Williamson, “Improved Approximation Algorithms for Maximum Cut and Satisfiability Problems Using Semidefinite Programming,” Journal of the ACM 42(6), 1115–1145 (1995), doi:10.1145/227683.227684.
- Lov K. Grover, “A Fast Quantum Mechanical Algorithm for Database Search,” Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, 212–219 (1996), doi:10.1145/237814.237866.
- Stuart Hadfield, Zhihui Wang, Bryan O’Gorman, Eleanor G. Rieffel, Davide Venturelli, and Rupak Biswas, “From the Quantum Approximate Optimization Algorithm to a Quantum Alternating Operator Ansatz,” Algorithms 12(2), 34 (2019), doi:10.3390/a12020034.
- Tadashi Kadowaki and Hidetoshi Nishimori, “Quantum Annealing in the Transverse Ising Model,” Physical Review E 58, 5355–5363 (1998), doi:10.1103/PhysRevE.58.5355.
- Frédéric Magniez, Ashwin Nayak, Jérémie Roland, and Miklos Santha, “Search via Quantum Walk,” SIAM Journal on Computing 40(1), 142–164 (2011), doi:10.1137/090745854.
- Ashley Montanaro, “Quantum-Walk Speedup of Backtracking Algorithms,” Theory of Computing 14(15), 1–24 (2018), doi:10.4086/toc.2018.v014a015.
- Ashley Montanaro, “Quantum Speedup of Branch-and-Bound Algorithms,” Physical Review Research 2, 013056 (2020), doi:10.1103/PhysRevResearch.2.013056.
- Troels F. Rønnow, Zhihui Wang, Joshua Job, Sergio Boixo, Sergei V. Isakov, David Wecker, John M. Martinis, Daniel A. Lidar, and Matthias Troyer, “Defining and Detecting Quantum Speedup,” Science 345(6195), 420–424 (2014), doi:10.1126/science.1252319.
- Joran van Apeldoorn, András Gilyén, Sander Gribling, and Ronald de Wolf, “Convex Optimization Using Quantum Oracles,” Quantum 4, 220 (2020), doi:10.22331/q-2020-01-13-220.
- Joran van Apeldoorn, András Gilyén, Sander Gribling, and Ronald de Wolf, “Quantum SDP-Solvers: Better Upper and Lower Bounds,” Quantum 4, 230 (2020), doi:10.22331/q-2020-02-14-230.
- Christof Zalka, “Grover’s Quantum Searching Algorithm Is Optimal,” Physical Review A 60, 2746–2751 (1999), doi:10.1103/PhysRevA.60.2746.