^{*}

Edited by: Jacob Biamonte, ISI Foundation, Italy

Reviewed by: Mauro Faccin, ISI Foundation, Italy; Ryan Babbush, Harvard University, USA; Bryan A. O'Gorman, NASA, USA

*Correspondence: Andrew Lucas, Lyman Laboratory of Physics, Department of Physics, Harvard University, 17 Oxford St., Cambridge, MA 02138, USA e-mail:

This article was submitted to Interdisciplinary Physics, a section of the journal Frontiers in Physics.

This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

We provide Ising formulations for many NP-complete and NP-hard problems, including all of Karp's 21 NP-complete problems. This collects and extends mappings to the Ising model from partitioning, covering, and satisfiability. In each case, the required number of spins is at most cubic in the size of the problem. This work may be useful in designing adiabatic quantum optimization algorithms.

Recently, there has been much interest in the possibility of using adiabatic quantum optimization (AQO) to solve NP-complete and NP-hard problems [^{1}_{P} whose ground state encodes the solution to a problem of interest, and another Hamiltonian _{0}, whose ground state is “easy” (both to find and to prepare in an experimental setup). Then, if we prepare a quantum system to be in the ground state of _{0}, and then adiabatically change the Hamiltonian for a time

then if _{0} and _{P} do not commute, the quantum system will remain in the ground state for all times, by the adiabatic theorem of quantum mechanics. At time

There has been debate about whether or not these algorithms would actually be useful: i.e., whether an adiabatic quantum optimizer would run any faster than classical algorithms [

in order for the system to remain in the ground state, for positive coefficients α and β, as ^{2}

There has been substantial experimental progress toward building a device capable of running such algorithms [_{P} may be written as the quantum version of an Ising spin glass. A classical Ising model can be written as a quadratic function of a set of _{i} = ±1:

The quantum version of this Hamiltonian is simply

where σ^{z}_{i} is a Pauli matrix (a 2 × 2 matrix, whose cousin (1 + σ^{z}_{i})/2 has eigenvectors |0, 1〉 with eigenvalues 0, 1) acting on the ^{⊗N}, and _{ij} and _{i} are real numbers. We then choose _{0} to consist of transverse magnetic fields [

so that the ground state of _{0} is an equal superposition of all possible states in the eigenbasis of _{P} [equivalent to the eigenbasis of the set of operators σ^{z}_{i} (^{3}

Ising spin glasses^{4}

Analogies between the statistical physics of Ising spin glasses and NP problems have been frequently studied in the past [

Finally, we note that Ising glasses often go by the name QUBO (quadratic unconstrained binary optimization), in the more mathematical literature [

Mathematically, the fact that a problem is NP-complete means we can find a mapping to the decision form of the Ising model with a polynomial number of steps. This mapping can be re-interpreted as a pseudo-Boolean optimization problem [_{1}_{2}_{3}), we then conclude by using “gadgets” to reduce the problem to an Ising spin glass, by introducing a polynomial number of auxiliary spins which help to enforce the three-body interaction by multiple two-body interactions (_{1}_{2}) [

However, for generic problems, this is a very inefficient procedure, as the power of the polynomial can grow quite rapidly. As such, the typical NP-complete problem (of size ^{5}^{3}. For most of this paper, we will find it no more difficult to solve the NP-hard optimization problem vs. the NP-complete decision problem, and as such we will usually focus on the optimization problems. The techniques employed in this paper, which are rare elsewhere in the quantum computation literature, are primarily of a few flavors, which roughly correspond to the tackling the following issues: minimax optimization problems, problems with inequalities as constraints (for example,

We hope that the reader may be inspired, after reading this paper, to think about solving some of these classical computing problems, or others like them, on experimental devices implementing AQO. Toward this end, the reader should look for three things in the implementations in this paper. The first is the number of spins required to encode the problem. In some instances, the “logical spins/bits” (the spins which are required to encode a solution of the problem) are the only spins required; but in general, we may require auxiliary “ancilla spins/bits”, which are required to enforce constraints in the problem. Sometimes, the number of ancilla bits required can be quite large, and can be the dominant fraction of the spins in the Hamiltonian. Another thing to watch out for is the possibility that large separations of energy scales are required: e.g., the ratio of couplings _{12}/_{23} in some Ising glass is proportional to

It is probably evident why we do not want too many ancilla bits—this simply means we can only encode smaller problems on the same size piece of hardware. It is a bit more subtle to understand why complete graphs, or separations of energy scales, are problematic. It is probable that the successful experimental implementations of AQO with the most qubits are on devices generated by DWave Systems [^{6}_{uw} large compared to other scales in the problem, to ensure that _{u} = _{w} (so these nodes effectively act as one spin). A second problem is that some of the Hamiltonians require separations of energy scales. However, in practice, these devices may only encode couplings constants of 1, …, 16, due to experimental uncertainties [

The first class of problems we will study are partitioning problems, which (as the name suggests) are problems about dividing a set into two subsets. These maps are celebrated in the spin glass community [

Number partitioning asks the following: given a set of _{1}, …, _{N}}, is there a partition of this set of numbers into two disjoint subsets _{1}, …, _{N}, fairly between two people? This problem is known to be NP-complete [_{i} (

be an energy function, where _{i} = ±1 is an Ising spin variable. Here

It is clear that if there is a solution to the Ising model with _{i} for the +1 spins is the same for the sum of the _{i} for the −1 spins. Thus, if the ground state energy is

This Ising glass has ^{*}_{i} denotes a solution to the problem, then −^{*}_{i} is also a solution. Physically, this corresponds to the fact that we do not care which set is labeled as ±. In the spin glass literature, the change _{i} → −_{i}, which does not change the form of _{1} = 1. This also allows us to remove one spin: now only _{2}, …, _{N} are included on the graph, and _{1} serves as an effective magnetic field. So in general, we require

If the ground state has

Graph partitioning is the original [_{v} = ±1 on each vertex

where

is an energy which provides a penalty if the number of elements in the + set is not equal to the number in the − set, and

is a term which provides an energy penalty _{A} in order to minimize energy. To determine a rather simple lower bound on _{B}—the change in the energy contributed by the _{A} ≥ 4^{7}

This Hamiltonian is invariant under the same gauge transformation _{i} → −_{i}. We conclude that we can always remove one spin by fixing a single vertex to be in the + set.

We have written

We will want none of our formulations to do this (i.e., we wish to solve the unconstrained optimization problem), as the experimental hardware that is being built for quantum optimization can only solve unconstrained problems. Instead, we encode constraint equations by making penalty Hamiltonians which raise the energy of a state which violates them.

A clique of size _{W}) (where _{W} is the edge set _{v} = ±1 on each vertex _{α}, we will define the binary bit variable

It will typically be more convenient to phrase the energies in terms of this variable _{α}, as it will be for this problem. Note that any energy functional which was quadratic in _{v} will remain quadratic in _{v}, and vice versa, so we are free to use either variable. We then choose

where _{v}

The most “dangerous” possible value of _{min}(_{v} which

A quantum algorithm for this NP-complete problem can be made slightly more efficient so long as the initial state can be carefully prepared [

The NP-hard version of the clique problem asks us to find (one of) the _{i} (_{A} + _{B} + _{C} where

and

We want cliques to satisfy _{A} = _{B} = 0, and to be the only ground states. The Hamiltonian above satisfies this if _{A} = 0 are always satisfied—we can see this by noting that the first term of _{A} forces us to pick only one value of _{i} = _{B} = 0 ensures that we have a clique. Similarly to the discussion above, we see that the absence of negative energy states requires ^{8}_{n}. This can be obtained by choosing

where _{A} constraint. The penalty for coloring one extra vertex, given _{i} =

So, for example, we could take

There is a trick which can be used to dramatically reduce the number of extra _{i} spins which must be added, in the NP-hard version of the clique problem above [

We know that we want to encode a variable which can take the values 2, …,

Alternatively, _{0}, …, _{M}, instead of _{1}, …, _{N}, to encode a variable which can take

solves the same clique problem, without loss of generality. (This is true in general for all of our NP problems.) If ^{M + 1} − 1, the ground state may be degenerate, as the summation of

Using this trick, we note that solving the NP-hard version of the cliques problem requires

Let _{1}, …, _{N} be

with

The Ising Hamiltonian corresponding to this problem can be constructed as follows. Let _{A} + _{B} where

and _{A} = 0 enforce (if such a ground state exists, of course!) the constraint that

with

To find constraints on the required ratio _{B} is, in principle,

The smallest possible value of Δ_{A} is related to the properties of the matrix

This bound could be made better if we know more specific properties of

If the coefficients _{i} and _{ij} are O(1) integers, we have _{i}), and

In this section, we discuss another simple class of mappings from NP problems to Ising models: “covering” and “packing” problems. These problems can often be thought of as asking: how can I pick elements out of a set (such as vertices out of a graph's vertex set) so that they “cover” the graph in some simple way (e.g., removing them makes the edge set empty). In this class of problems, there are constraints which must be exactly satisfied. Many of the problems described below are often discussed in the literature, but again we review them here for completeness. We conclude the section with the minimal maximal matching problem, which is a slightly more involved problem that has not been discussed in the AQO literature before.

These are, by far, the most popular class of problems discussed in the AQO literature. As we mentioned in the introduction, this is because this is the

The exact cover problem goes as follows: consider a set _{i} ⊆

The question is: is there a subset of the set of sets {_{i}}, called

In the above Hamiltonian α denotes the elements of _{i}. _{A} = 0 precisely when every element is included exactly one time, which implies that the unions are disjoint. The existence of a ground state of energy

It is also straightforward to extend this, and find the _{A} + _{B}, with _{A} given above, and

The ground state of this model will be ^{9}

Let us consider the same setup as the previous problem, but now ask a different question: what is the largest number of subsets _{i} which are all disjoint? This is called the set packing problem; this optimization problem is NP-hard [_{A} + _{B}:

which is minimized only when all subsets are disjoint. Then, we use

which simply counts the number of sets we included. Choosing _{A} (since there will always be a penalty of at least

Note that an isomorphic formulation of this problem, in the context of graph theory is as follows: let us consider the sets to be encoded in an undirected graph _{i} maps to a vertex _{i} ∩ _{j} is non-empty. It is straightforward to see that if we replace

that the question of what is the maximal number of vertices which may be “colored” (_{i} = 1) such that no two colored vertices are connected by an edge, is exactly equivalent to the set packing problem described above. This version is called the maximal independent set (MIS) problem.

Given an undirected graph _{v} be a binary variable on each vertex, which is 1 if it is colored, and 0 if it is not colored. Our Hamiltonian will be _{A} + _{B}. The constraint that every edge has at least colored vertex is encoded in _{A}:

Then, we want to minimize the number of colored vertices with _{B}:

Choose

Satisfiability is one of the most famous NP-complete problems [

can take on the value of true—i.e., every _{i} for 1 ≤ _{i} is:

Here _{i1}, _{i2}, and _{i3} are selected from another set of Boolean variables: _{1}, …, _{N}, _{1}, …, _{N}. This is a very brief description of satisfiability; physicists who are unfamiliar with this problem should read appropriate chapters of Mézard and Montanari [

There is a well-known reduction of 3SAT to MIS [_{i}, we add 3 nodes to the graph, and connect each node to the other 3. After this step, if there is a _{1} and _{2} such that _{1} = _{2}, then we also add an edge between these two nodes. Solving MIS on this graph, and asking whether the solution has exactly _{1} be true and _{1} be true, so we are required to connect all such points with an edge. Since the graph is made up of _{i} which is true.

Note that we can solve an NP-hard version of this problem (if we have to violate some clauses, what is the fewest number?), by solving the optimization version of the MIS problem.

The minimal maximal (minimax) matching problem on a graph is defined as follows: let _{e∈C} ∂_{1}, _{2} ∈ _{1} ∩ ∂_{2} = ∅) and that if

Note that, from this point on in this paper, we have not found any of the Ising formulations of this paper in the literature.

We will use the spins on the graph to model whether or not an edge is colored. Let us use the binary variable _{e} to denote whether or not an edge is colored; thus, the number of spins is |

The first and largest term, _{A}, will impose the constraint that no vertex has two colored edges. This can be done by setting

Here _{A} = 0; if _{A} > 0, it is because there is a vertex where two of its edges are colored.

We also can define, _{A} = 0, the variable

We stress that this definition is only valid for states with _{A} = 0, since in these states each vertex has either 0 or 1 colored edges. We then define the energy _{B}, such that solutions to the minimax coloring problem also have _{B} = 0. Since we have already constrained the number of colored edges per vertex, we choose _{B} to raise the energy of all solutions where there exists a possible edge which can be colored, yet still not violate the coloring condition, out of the ground state. To do this, we can sum over all edges in the graph, and check whether or not the edge connects two vertices, neither of which are colored:

Note that since, 1 − _{v} can be negative, we must choose _{B}) comes when _{u} = 0, _{v} > 1, and (_{u} = 0. Then, the contributions to _{A} and _{B} associated to node

Note that _{u} ≤ _{v} = 2,

then it is never favorable to have any _{v} > 1. This will ensure that a ground state of _{A} + _{B} will have _{A} = _{B} = 0: i.e., states which do not violate the minimax constraints.

Now, given the states where _{A} = _{B} = 0, we now want the ground state of _{A} + _{B} + _{C} to be the state where the fewest number of edges are colored. To do this, we simply let

count the number of colored edges. Here _{A} or _{B} terms: one requires _{C} has the smallest number of edges, and is clearly the solution to the minimax problem. Each ground state of this spin model is equivalent to a solution of the minimax problem.

We now turn to NP problems whose formulations as Ising models are more subtle, due to the fact that constraints involve inequalities as opposed to equalities. These constraints can be re-written as constraints only involving equalities by an expansion of the number of spins.

As with partitioning problems, we will find that these Hamiltonians require embedding highly connected graphs onto a quantum device. This may limit their usability on current hardware.

Consider a set _{i} ⊆

The set covering problem is to find the smallest possible number of _{i}s, such that the union of them is equal to _{i}; finding the smallest number of sets which “cover”

Let us denote _{i} to be a binary variable which is 1 if set _{α,m} to be a binary variable which is 1 if the number of _{i}s which include element α is _{A} + _{B}. Our first energy imposes the constraints that exactly one _{α,m} must be 1, since each element of _{i} we have included, with α as an element:

Finally, we minimize over the number of _{α}s included:

with 0 < _{A} (the worst case is that one set must be included to obtain one element of

Let _{i}s are required, and _{α,m} spins; the total number is therefore

The knapsack problem is the following problem: we have a list of _{α}, and its value given by _{α}, and we have a knapsack which can only carry weight _{α} is a binary variable denoting whether (1) or not (0) object α is contained in the knapsack, the total weight in the knapsack is

and the total cost is

The NP-hard [

Let _{n} for 1 ≤ _{A} + _{B}, with

which enforces that the weight can only take on one value and that the weight of the objects in the knapsack equals the value we claimed it did, and finally

As we require that it is not possible to find a solution where _{A} is weakly violated at the expense of _{B} becoming more negative, we require 0 < _{α}) <

We now turn to coloring problems. Naively, coloring problems are often best phrased as Potts models [

Given an undirected graph ^{10}

Our solution consists of the following: we denote _{v,i} to be a binary variable which is 1 if vertex

The first term enforces the constraint that each vertex has exactly one color, and provides an energy penalty each time this is violated, and the second term gives an energy penalty each time an edge connects two vertices of the same color. If there is a ground state of this model with

The clique cover problem, for an undirected graph _{1}, …, _{n} be the subsets of _{W1}, …, _{Wn} the edge set restricted to edges between vertices in the _{i} sets. The clique cover problem asks whether or not (_{i}, _{Wi}) is a complete graph for each _{i} (i.e., does each set of colored vertices form a clique?). This problem is known to be NP-complete [

Our solution is very similar to the graph coloring problem. Again, we employ the same binary variables as for graph coloring, and use a Hamiltonian very similar to the cliques problem:

The first term enforces the constraint that each vertex has exactly one color by giving an energy penalty each time this constraint is violated. In the second term, since the sum over _{v,i} counts the number of nodes with color

The job sequencing problem is as follows: we are given a list of _{i}. How can each job be assigned to a computer in the cluster such that, if the set of jobs on cluster α is _{α}, then the length of that cluster, defined as

are chosen such that max(_{α}) is minimized? Essentially, this means that if we run all of the jobs simultaneously, all jobs will have finished running in the shortest amount of time. This is NP-hard [_{α}) ≤ _{0}?] which is NP-complete. We assume that _{i} ∈ ℕ.

To do this, we will begin by demanding that without loss of generality, _{1} ≥ _{α} for any α. Introduce the variables _{i,α} which are 1 if job _{n, α} for α ≠ 1 and _{1} − _{α} =

encodes that each job can be given to exactly one computer, and that no computer can have a longer total length than computer 1. The number _{1} ≥ _{α}: in the worst case, it is given by _{i}). To find the minimal maximal length _{1}, we just use

Similarly to finding bounds on _{i}) <

In this section, we describe the solution to the (undirected or directed) Hamiltonian cycles problem, and subsequently the traveling salesman problem, which for the Ising spin glass formulation, is a trivial extension.

Let

Without loss of generality, let us label the vertices 1, …, ^{2} bits _{v,i}, where _{u,j} and _{v,j + 1} are both 1, then there should be an energy penalty if (

To solve the Hamiltonian path problem instead, restrict the last sum over ^{2} spins are required to solve this problem.

It is straightforward to slightly reduce the size of the state space for the Hamiltonian cycles problem as follows: it is clear that node 1 must always be included in a Hamiltonian cycle, and without loss of generality we can set _{1,i} = δ_{1,i}: this just means that the overall ordering of the cycle is chosen so that node 1 comes first. This reduces the number of spins to (^{2}.

The traveling salesman problem for a graph _{uv} associated to it, is to find the Hamiltonian cycle such that the sum of the weights of each edge in the cycle is minimized. Typically, the traveling salesman problem assumes a complete graph, but we have the technology developed to solve it on a more arbitrary graph. The decision problem (does a path of total weight ≤

To solve this problem, we use _{A} + _{B}, with _{A} the Hamiltonian given for the directed (or undirected) Hamiltonian cycles problem. We then simply add

with _{A}; one such constraint is 0 < _{uv}) < _{uv} ≥ 0 for each (^{11}^{2} spins are required, as we may fix node 1 to appear first in the cycle.

The most subtle NP problems to solve with Ising models are problems which require finding connected tree subgraphs of larger graphs.^{12}

The minimal spanning tree problem is the following: given an undirected graph _{uv}, what is the tree

is minimized (if such a tree exists)? Without loss of generality, we take _{uv} > 0 in this subsection (a positive constant can always be added to each _{uv} ensure that the smallest value of _{uv} is strictly positive, without changing the trees

To solve this problem, we place a binary variable _{e} on each edge to determine whether or not that edge is included in

We also place a large number of binary variables _{v,i} on each vertex, and _{uv,i}, _{vu,i} on edge (_{uv} = 1, it means that _{vu} = 1 it means that _{v,i} (_{A} + _{B}, where the terms in _{A} are used to impose the constraints that: there is exactly one root to the tree, each vertex has a depth, each bond has a depth, and its two vertices must be at different heights, the tree is connected (i.e., exactly one edge to a non-root vertex comes from a vertex at lower depth), each node can have at most Δedges, and each edge at depth

The ground states with _{A} = 0 are trees which include every vertex. In the last term in the sum, remember that _{uv,i} and _{vu,i} are both spins that are included for each edge; the notation in the summation is meant to remind us of this. We then add

In order to solve the correct problem, we need to make sure that we never remove any _{uv,i} from _{B} in order to have a more negative total _{A} contributes an energy ≥ _{uv}) <

The number of spins required is |^{2}), so this Ising formulation may require a cubic number of spins in the size of the vertex set.

The NP-hard [_{uv}, we want to find a minimal spanning tree for a subset _{uv}s along all included edges is minimal). We no longer impose degree constraints; the problem turns out to be “hard” already, as we now allow for the possibility of not including nodes which are not in

To solve this by finding the ground state of an Ising model, we use the same Hamiltonian as for the minimal spanning tree, except we add binary variables _{v} for _{A} + _{B}, where _{A} enforces constraints similarly to in the previous case:

We then use _{B} from the previous model to determine the minimum weight tree; the same constraints on

A feedback vertex set for a directed graph

Before solving this problem, it will help to prove two lemmas. The first lemma is quite simple: there exists a node in a directed acyclic graph which is not the end point of any edges. Suppose that for each vertex, there was an edge that ends on that vertex. Then pick an arbitrary vertex, pick any edge ending on that vertex, and follow that edge in reverse to the starting vertex. Repeat this process more than

The second lemma is as follows: a directed graph

is a contradiction. To prove that an acyclic graph has a height function, we construct one recursively. Using our first lemma, we know that there exists a vertex

We can now exploit this lemma to write down an Ising spin formulation of this problem. We place a binary variable _{v} on each vertex, which is 0 if _{v,i} on each vertex, which is 1 if vertex _{A} + _{B} where

The first term ensures that if a vertex is not part of the feedback set, it has a well-defined height; the second term ensures that an edge only connects a node with lower height to a node at higher height. We then find the smallest possible feedback set by adding

In order to solve the correct problem, we cannot add too few nodes to the feedback set. If we set _{v} = 1 for a node which should be part of the feedback set, we find an energy penalty of _{A}, and a gain of _{B}. We conclude that

The extension to undirected graphs requires a bit more care. In this case, we have to be careful because there is no

To solve this problem, we do the following: introduce a binary variable _{v,i}, which is 1 if _{v} = 1 if _{uv,i}, _{vu,i} to be defined as before when _{uv}, _{vu}, which we take to be 1 when the ending node of the “directed” edge is in the feedback vertex set. Now, we can write down a very similar energy to the minimal spanning tree:

The changes are as follows: we no longer constrain only 1 node to be the root, or constrain the degree of a vertex—however, we have to add a new term to ensure that edges are only ignored in the tree constraint if they point to a node in the feedback set. We then add

with _{B} is smallest—i.e., we have to remove the fewest number of nodes. The number of spins required is (|^{13}

The recent paper [

For a directed graph, the feedback edge set problem is to find the smallest set of edges ^{14}_{uv} on each edge, which is 1 if _{uv,i} to be 1 if both _{uv} = 1 and the height of node _{v,i}, as for the feedback vertex set. Our constraint energy must then enforce that: each vertex and included edge has a well-defined height, and that each edge points from a lower height to a higher height:

We then use

to count the number of edges in

Graphs _{1} and _{2}, with

which contains all information about the edge set _{1,2} be the adjacency matrices of graphs _{1,2}. If there is a permutation matrix _{2} = ^{T}_{1}_{1,2} are isomorphic.

The question of whether two graphs _{1} = (_{1}, _{1}) and _{2} = (_{2}, _{2}) are isomorphic is believed to be hard, but its classification into a complexity class is still a mystery [_{1}| = |_{2}| ≡ _{1} with 1, …,

We write this as an Ising model as follows. Let us describe a proposed isomorphism through binary variables _{v,i} which is 1 if vertex _{2} gets mapped to vertex _{1}. The energy

ensures that this map is bijective. We then use an energy

to penalize a bad mapping: i.e., an edge that is not in _{1} is in _{2}, or an edge that is in _{1} is not in _{2}. As usual, assume ^{2} spins are required.

An approximate algorithm that uses quantum annealing to distinguish between non-isomorphic graphs via the spectra of graph-dependent Hamiltonians was presented in Hen and Young [

The focus of research into AQO has essentially been on NP-complete/hard problems, because the Ising model is NP-hard, and because computer scientists have struggled to find efficient ways of solving these problems. In this paper, we have presented strategies for mapping a wide variety of NP problems to Ising spin glasses, exemplified by a demonstration of a glass for each of Karp's 21 NP-complete problems. It is an open question the extent to which AQO will help provide efficient solutions for these problems, whether these solutions are exact or approximate.

However, physicists are interested in building a universal quantum computer which is capable of solving much more than just Ising models. As an example, a universal quantum computer would also reduce the time for searching an unsorted list of

It is certainly the case that an AQO-implementing device can be used to solve easy problems. Consider the simple problem of finding the largest integer in a list _{1}, …, _{N} (this is the searching algorithm that a universal quantum computer can perform efficiently). Introducing binary variables _{i} for

for _{i}) solves this problem. In fact, this problem looks somewhat like an instance of the random field Ising model on a complete graph, and yet this has a very simple O(

The above example demonstrates that sometimes the “hardness” of a problem can be deceptive—one can phrase something that is easy in a way which makes it seem hard. It is worth discussing more closely the hardness of NP problems, because it turns out that sometimes, NP problems can be easier than they first appear. To be NP-complete but not P (if P ≠ NP) one only needs a small family of instances of the problem to be unsolvable in polynomial time by a deterministic algorithm. However, typical instances may not be so hard. Many popular NP problems can almost surely be solved exactly in polynomial time on large random instances [^{15}

The Hamiltonians of this paper may be deceptively “hard”—this can mean that they involve too many spins. Another possibility is that these Hamiltonians have small spectral gaps, and that alternative choices have much larger spectral gaps—this is a question we have not addressed at all in this paper. Studying how to simplify quantum algorithms, and more importantly increase energy gaps (and thus reduce

The author declares that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Andrew Lucas is supported by the Smith Family Graduate Science and Engineering Fellowship at Harvard. He would like to thank Robert Lucas for pointing out that a compendium of ways to map famous NP problems to Ising glasses was lacking, Jacob Biamonte for encouraging publication, and Vicky Choi, Jacob Sanders, Federico Spedalieri, John Tran, and especially the reviewers, for many helpful comments on AQO and computer science.

This paper discusses theoretical results; no materials are needed. The methodology used was discussed throughout the paper.

^{1}In this paper, when a generic statement is true for both NP-complete and NP-hard problems, we will refer to these problems as NP problems. Formally this can be misleading as P is contained in NP, but for ease of notation we will simply write NP.

^{2}If one is only interested in approximate solutions (for example, finding a state whose energy per site is optimal, in the thermodynamic (^{γ}) [

^{3}This is due to the fact that the eigenbases of _{0} and _{P} are very different, and one has to tune (in our case) two parameters of a 2 × 2 Hermitian matrix to find a matrix with degenerate eigenvalues (the identity matrix). We only have one,

^{4}In this paper, we will casually refer to the Ising models we are constructing as “glasses”, as they can be on general graphs and have both positive and negative couplings _{ij}. There are various mathematical definitions for a spin glass, none of which seem to capture properly the physical essence of a glass on all problems. We will be liberal with our use of the word glass, and refer to any NP problem, formulated as an Ising model, as a glass.

^{5}No offense to anyone whose problems have been left out.

^{6}These devices use quantum annealing, which is the finite temperature generalization of AQO. For this paper, this is not an important issue, although it can certainly be relevant to experiments.

^{7}The reason we can use _{A} = 0. Due to the fact that the _{A} constraint is very penalizing if it is violated by having many spins in the same partition, it is easy to see that cases where an energy gain of (

^{8}The ground state has

^{9}The example where

^{10}The graphs are ^{2}, and the edges as line segments between them, such that no two line segments intersect (except at a vertex).

^{11}One can also encode graph structure by assuming a complete graph (this allows one to neglect the third term in _{A}), but choosing the weights of the “non-existent” edges to obey _{uv ∉ E} ≥ _{uv ∈ E}). As _{uv} is not defined if (

^{12} A tree is a graph with no cycles. A cycle is set of vertices _{1}, …, _{n} with (_{1}_{2}), …, (_{n − 1}_{n}), (_{n}_{1}) ∈

^{13}This follows from the fact that the sum over

^{14}It is in P if the graph is undirected however.

^{15}One has to be careful with the phrases “random” and “typical”, as this immediately implies a probability distribution over a space of problem instances. This probability distribution may place vanishingly small probability on a set of relevant instances for any given application. For the simple probability distributions used in these papers, it is highly non-trivial that most instances turn out to be solvable in polynomial time.