A quantum differentiation of k-SAT instances

We present a quantum adiabatic algorithm to differentiate between k-SAT instances, those with no solutions and those that have many solutions. The time complexity of the algorithm is a function of the energy gap between the subspace of all 0-eigenvectors (ground states) and the first excited states manifold, and scales polynomially with the number of resources. The idea of gaps between subspaces suggests a new tool to analyze time complexity in adiabatic quantum machines.


Introduction and motivations
In [1], Farhi et al suggested an adiabatic quantum algorithm to solve certain search-type problems. Such kinds of algorithms are based on the well-known adiabatic theorem of quantum mechanics [2,3]. The adiabatic quantum machine implementing the algorithm turns out to be the quantum parallel of the simulated annealing classical computer [4]. In [5,6], it was shown that adiabatic quantum computation is polynomially equivalent to standard quantum computation (i.e. to the qubit circuit model [7]). Nonetheless, there are only a few practical examples of adiabatic quantum algorithms (see also [5]).
In an adiabatic quantum computer, one evolves from a simple and easy to construct initial vector towards a final vector using a time-dependent Hamiltonian. The final Hamiltonian is constructed so that its 0-eigenvector, its ground state, is a solution to the computational problem. If the initial vector is a 0-eigenvector of the initial Hamiltonian and the evolution is done slowly enough, then the final vector is supposed to be the 0-eigenvector of the final Hamiltonian. This is the content of the quantum adiabatic theorem.
Our Hamiltonian resembles the one used by Farhi et al [1]. It is a sum of quasi-local operators in terms of Pauli spin-1/2 matrices. This Hamiltonian is k-local for some small k. In its diagonal form, each of the 2 n assignments, where n is the number of Boolean variables or spins, represents a penalty function for each k-SAT clause that the corresponding assignment does not satisfy and is 0 if this assignment satisfies all clauses. This Hamiltonian turns out to be a natural choice to solve k-SAT-type problems.
Our main result concerns the average number of unsatisfied constraints. Our adiabatic quantum machine can differentiate polynomially between k-SAT instances with no solutions and k-SAT instances having many solutions. We interpret the number of solutions in terms of the average number of unsatisfied constraints, which is a number between 0 and m, where m is the number of clauses or interaction terms in the k-local Hamiltonian. If the average number is low enough (below 1/2), the time complexity will be polynomial in n. We show that such a condition on the average of unsatisfied constraints has some computational benefits.
Classically, one can differentiate between sets of constraints with no solutions and sets of constraints with many solutions using a random process, picking any assignment, and checking each of the constraints. This is also well known as an RP algorithm. The complexity class RP is the set of all decision problems L for which there exists a probabilistic polynomial time Turing machine A satisfying For example, L could represent the property of 'being prime', and such a probabilistic algorithm will give the answer NO (0) if x is not prime, and will give the answer YES (1) with high probability if x is indeed prime. It could give the answer NO even if x is prime, although this error will happen with low probability [8].
Our adiabatic quantum algorithm solves the problem of differentiating, up to any predetermined accuracy, in polynomial time and without the need of a random generator. Moreover, in case it is known in advance that there are many solutions, this algorithm can produce such a solution (up to any predetermined accuracy) in polynomial time. This is the adiabatic parallel of some well-known classical deterministic algorithms for the solution of formulae that have many satisfying assignments (see, for example, [9]).

3
In principle, one could simulate such classical algorithms, as in [9], by using quantum gates [7] and then construct an adiabatic quantum algorithm, as in [6]. The resulting effective Hamiltonian will realize the total history state of the original circuit as its ground state and will be hard to construct in terms of k-local operators. Instead, we use simple Hamiltonian operators, as in [1], which are quite natural for k-SAT problems. These algorithms could, in principle, be physically implemented in the near future.
From the point of view of computational complexity theory, this quantum algorithm is equivalent to a classical RP algorithm, both of which are polynomial. However, there are several motivations for presenting this quantum algorithm. Firstly, as mentioned above, this is an attempt to solve this problem directly by an adiabatic quantum computer by using very natural and simple Hamiltonians. Secondly, classically, to get high accuracy from an RP algorithm, one needs to operate the classical algorithm over and over again. Our adiabatic machine requires only one measurement. This is the outcome of the analytic proof of the polynomial asymptotic behavior of the corresponding gap between eigenvalues. Thirdly, this adiabatic machine realizes an example where the use of the gap between manifolds of eigenvectors can benefit computational theory.
The total time evolution T of an adiabatic computer is typically proportional to the inverse of the square of the minimal gap between the 0-eigenvalue (ground state) and the next closest (excited state) eigenvalue, over the entire evolution time interval [0, T ]. In the following, we extend this concept by analyzing the gap between the 0-eigenmanifold and the next excited eigenmanifold (see also [2], [10]- [12]). We need this extension because, in our k-SAT problems, the lowest energy states may be degenerate at the end of the evolution, i.e. there could be many solutions that satisfy all clauses. We divide the unit time interval s ∈ [0, 1] into two subintervals (s = t/T with t being real time). In the first one, for small time s, we use Rayleigh's minimax principles [13] to establish bounds on the gap. This is one of the reasons for realizing an initial Hamiltonian that is a positive definite operator. For the second subinterval, i.e. for s near 1, we use the Geršgorin disc theorem [14]. We then show that a condition on the average number of solutions can be imposed to ensure that the two subintervals cover the whole unit interval.
It seems reasonable to think that there could be other computational benefits from considerations of the gap between eigenmanifolds (as opposed to the gap between single states) of the final Hamiltonian when this concept is applied to other adiabatic quantum algorithms.

The state space
Let H be a two-dimensional vector space over the complex numbers C, and H n = H ⊗ H ⊗ · · · ⊗ H the tensor-product space of H, whose dimension is 2 n . Define the standard basis in H and the rotated one If σ z is the Pauli (spin-1/2) matrix along the z-direction, the operator acts asσ z |α = α |α on the σ z eigenbasis (α = 0, 1 or FALSE, TRUE). Similarly, if σ x is the Pauli spin matrix along the x-direction, the operator acts asσ x |− = |− andσ x |+ = 3|+ . By extension, Pauli-like operators acting on H n are defined by simple tensor products:

The problem Hamiltonian
In complexity theory the satisfiability problem is a decision problem whose instance is a Boolean expression written in terms of the Boolean primitive functions AND, OR and NOT acting on a set comprising a finite number of variables. The question is to tell whether there exists an assignment of TRUE or FALSE to the variables such that the entire Boolean expression is true, or to prove that there is no such assignment. For example, consider the following formula with three variables and five clauses: In the above example, each clause contains at most three variables and we say that the formula belongs to 3-SAT. It is well known that 3-SAT is enough to describe the whole set of NP. It is also well known that 2-SAT is a problem of polynomial complexity [15] (although classically the 2-SAT problem is easy, we are not aware of any quantum adiabatic algorithm that uses 2-local Hamiltonians that rigorously proves that it is in the class P for arbitrary instances; see also [16]). Consider now a set of m clauses {C j } j=1,...,m in n Boolean variables {x i } i=1,...,n , where m is a polynomial in n and its ratio is defined as β = m/n.
For computational problems inside SAT, it is easy to construct a Hamiltonian. Given a k-SAT clause C in n Boolean variables, we can define an energy function h C on H n such that it is 0 whenever the clause is satisfied and 1 otherwise. For example, for a 3-SAT clause then the energy function is Clearly, h C is 1 only when |0 ⊗3 (UNSATISFIED) and 0 (SATISFIED) otherwise. In general, the following mapping for the Boolean variable and its negation results: Next, for a family of clauses we take the sum of the cost energies (which represents the formula in Boolean logic): 5 thus defining the problem Hamiltonian. Then, H P has eigenvalue 0 whenever |α 1 ⊗ · · · ⊗ |α n satisfies all clauses. Otherwise, each diagonal element of H P (in the standard basis), t r , counts the number of unsatisfied clauses m r whose fraction is 0 γ r = m r /m 1 (γ r = 0 meaning that all clauses are satisfied). In other words, H P is a penalty function for unsatisfied clauses. We say that |α 1 ⊗ · · · ⊗ |α n is a root of the k-SAT instance if it satisfies all clauses. Therefore, for the k-SAT problem, the equivalently mapped physical system corresponds to a k-local, or k-body, problem. Note that H P is a positive semi-definite operator (all eigenvalues are strictly non-negative).

The initial Hamiltonian
Now, consider the simple operator as the initial (s = 0) Hamiltonian. Note thatσ x is a positive definite matrix, i.e. all its eigenvalues are strictly positive; therefore H B is also positive definite.
Finally, the following time-dependent Hamiltonian, represents the quantum algorithm. Observe that H (s) is positive definite for 0 s < 1.
Moreover, H B has a non-degenerate ground state, while H P may have a massively degenerate ground state manifold (many configurations have the lowest eigenvalue), which makes the use of the adiabatic theorem of quantum mechanics a bit subtle, and the relevant question that emerges is: Which gap is the relevant one?

The quantum adiabatic algorithm
Our Hamiltonian H (s) evolves for a period of time that can be calculated in advance and is large enough to make sure its 0-eigenvector (at s = 1) is very close to a solution to the family of SAT clauses if there is such a solution. Then we stop the evolution and measure its outcome. We now check whether the final vector satisfies all clauses. This also takes a very short time.
If indeed this vector is a solution, we then know that the answer is YES; otherwise our vector will not satisfy at least one clause and we can say with almost certainty that the answer is NO. Indeed, we can get an unsatisfying vector while the true answer is YES, but this should have a negligible probability. Our algorithm can reduce this probability to 0 for all practical purposes. The evolution time of an adiabatic quantum machine is bounded from below by a fraction that depends on the minimal gap between the 0-eigenvalue and the next excited eigenvalue, taken over the whole time interval. To make sure this gap is not artificially increased by blowing up the Hamiltonian itself, we also demand that the matrix coefficient of the derivative of the Hamiltonian is bounded. Define (s) = λ 2 (s) − λ 1 (s), where λ 1 (s) and λ 2 (s) are the ground and first excited state eigenvalues, with corresponding |n 1 (s) , |n 2 (s) eigenvectors, and min = min 0 s 1 (s). In general, then, the minimal time we need to evolve the machine satisfies [1] T > δ 6 For the algorithm presented here, min is related to the gap between the 0-eigenmanifold and the first excited eigenmanifold. Moreover, to be completely rigorous we have to maximize δ over all |n 2 (s) (respectively |n 1 (s) ) eigenvectors of the 1 (respectively 0) eigenmanifold (see also [10]).

The complexity of the algorithm: the evolution time
One can, in principle, determine the eigenvalues λ (s){H (s)} ( 2 n ) of the snapshot Hamiltonian H (s), where s ∈ [0, 1]. Generically, the complexity of the adiabatic algorithm is a function of the gap between eigenvalues of H (s) [2]. In the following we want to establish bounds among some of those eigenvalues, in particular, a lower bound on the gap (s) = λ 2 (s) − λ 1 (s), where λ 1 (s) and λ 2 (s) are the ground and first excited eigenvalues, respectively. At s = 0, the ground state |− 1 ⊗ · · · ⊗ |− n = |− ⊗n is non-degenerate. For small values of s, near 0, one can guarantee a gap between the first (ground) and the second (first excited) eigenvalues of H (s), because of our choice of initial Hamiltonian. At large enough values of s, all eigenvalues that converge to 0 (at s = 1) get disconnected from the rest. We compute the values of s that satisfy either of the conditions. We then show that the class RP is exactly the one that makes the two sub-intervals cover the unit interval.
Let us start by presenting the well-known Rayleigh's minimax principles.

Theorem 3.1. (Rayleigh [13]) LetH be a positive definite symmetric matrix. Then, the quotient
is minimized by the eigenvector |φ 1 with the smallest eigenvalue λ 1 , and its minimal value is R 1 [|φ 1 ] = λ 1 . In general, thus defining the usual upper bound on the ground state eigenvalue. Less known is the following inequality: for all |φ , which provides a way of estimating the second eigenvalue ofH (s) without knowing the first one, λ 1 . The condition ψ|φ = 0 represents a constraint on an arbitrary vector |ψ .
Lemma. The following inequalities are consequences of Rayleigh's principle: where M = T /2 n (and T is the trace of H P , see also formula (9) 7 since H P is a positive semidefinite operator. That proves relation (i). As for (ii), first observe that Being a minimum, λ 1 {H (s)} is smaller than the right-hand expression for any choice of |ψ . So, choose the ground state of H B , |φ 1 = |− ⊗n , and which is a positive number. Then, This concludes the proof of the lemma.
Using (i) and (ii) in the lemma, we now compute the gap. To this end, we want to determine the conditions on s under which the following inequality, is satisfied. We also know that Then, the inequality reads So far we have proved that for small s the gap is secured. We want now to look at the upper end of the unit interval, i.e. close to s = 1, where we use the Geršgorin discs theorem. [14]) LetH = [h i j ] be an n × n matrix, and for 1 i n let

Theorem 3.2. (Geršgorin
denote the ith deleted absolute row sum ofH . Then all the eigenvalues ofH are located in the union of n discs: Moreover, if a union of k of these discs forms a connected region that is disjoint from all the remaining n − k discs, then there are precisely k eigenvalues ofH in this region. Let us now apply the above theorem to H (s). In each row of the spin matrix (1 − s)H B there are exactly n non-zero (non-diagonal) entries and all have the value 1 − s. Therefore, the radius of each disc is n (1 − s). The discs are centered 1s units apart (which is the difference between non-equal elements of s H P ). To make sure the discs are apart, we demand that We clearly see the energy gap between these two eigenmanifolds, which is the relevant quantity for the time complexity analysis of the adiabatic quantum algorithm.
As s goes to 1, the discs' radii become smaller and the distances between adjacent discs become bigger. This means that, from s > (2n + )/(1 + 2n), all eigenvalues gather inside separated discs.
So far we have secured both ends of the unit interval. As we go from 0 to 1, as long as is bigger than , and if we move slowly enough we will stay on the 0-eigenvector. Now, from (2 − )/(2 + M) up to 1, might get close to 0. This means that we might jump to the next excited state. For such s's (s > (2 − )/(2 + M)), if we can make the gap between the manifolds big enough, it will not be possible to jump out of the 0-eigenmanifold (still we might jump in between roots of the 0-eigenmanifold). So we have to guarantee that the gap between the manifolds is secured even before any two roots in the 0-eigenmanifold can get too close to each other.
It is easy to see that, for = 1 n 2 , the above inequality holds if (assume that n is big enough 4 ). So, if the average M is small enough, the whole unit interval is secured by a gap of 1/n 2 .  We now interpret the condition on the average in terms of the number of roots. It turns out that we can easily separate between the case where there are no roots and the case where there are many roots. The question is: How many? Corollary 3.2. Given a k-SAT instance satisfying the following condition-either there is no satisfying assignment or there are at least 2 n (1 − (1/2nm)) satisfying assignments-the above adiabatic algorithm could differentiate between the two options in polynomial time.
Proof. Observe that, to satisfy M 1/2n, we need about ((2nm − 1)/2nm) 2 n places where the diagonal matrix elements of H P are 0, i.e. solutions satisfying all clauses, since So, if a large exponential number (((2nm − 1)/2nm) 2 n ) of H (s)'s diagonal elements equal 0, we can use the above adiabatic quantum machine to find one solution in polynomial time.
Otherwise, if all H (s)'s diagonal elements are different from 0, our machine, having evolved the same amount of (polynomial) time, will yield some non-significant vector.
Example. Consider the following simple 5-SAT problem in six variables and two clauses: It is easy to see that there are exactly four configurations that do not satisfy C 1 or C 2 (but satisfy at least one of them). Therefore, M = 4/64 = 1/16, which is smaller than 1/2n = 1/12. Corollary 3.3. Given a k-SAT instance satisfying the following condition-either there is no satisfying assignment or the average number of unsatisfied clauses M is smaller than 1/2-the above adiabatic algorithm could differentiate between the two options in polynomial time.
Proof. Consider the Hamiltonian H ⊗l P . This Hermitian operator will increase the number of variables n by the small factor l and reduce M (exponentially) to M l . Clearly we need to satisfy This will happen for l just larger than 2 log(n). So, for such small l, the Hamiltonian H ⊗l P will meet the above requirements (of corollary 3.1).

Discussion
We would like to start with a very important remark. Using the Geršgorin disc theorem means that, from a certain point onward, all eigenvalues gather around separated discs. It could happen that more than one eigenvalue is in the disc centered at 0. Suppose k 0 is the 0-degeneracy of the problem. Then, by Geršgorin's theorem, there are k 0 eigenvalues in the disc around 0 for all such s's (the discs are centered around elements of H P ). Some of them may even get together exponentially fast as n → ∞. The radius of the disc is decreasing to 0, so if the quantum machine jumps into one of these eigenvalues, it continues its way to 0. The next disc contains all vectors with eigenvalue around 1, and this disc is separated from the 0 disc by a finite gap, and so on.
To sum up, in the lower end of the unit interval we can actually prove that the gap is polynomially small. This simply comes from the choice of our initial Hamiltonian. At the upper end of the interval we prove that the eigenvalues are clustered in non-overlapping discs. The relevant gap is now the gap between the discs. In this way, we showed that the relevant gap to consider is the gap between eigenmanifolds and not simply between the ground state and an excited state [2,11,12]. This is so, since these types of problems have large degeneracies in the ground state of H P , and the standard adiabatic theorem of quantum mechanics is not designed to handle these cases.
Cook [17] showed the k-SAT with k 3 to be NP-complete. However, NP-completeness is a worst-case notion and it is interesting to analyze situations where the satisfiability problem becomes easily solvable. In that regard, we would like to mention the important fact that our work also proves analytically that there is a subclass of k-SAT (k 2) that can be solved with polynomial complexity with an adiabatic quantum machine. The subclass is defined by the average fraction of unsatisfied clausesγ = M m or the average number M of unsatisfied clauses. The number M is somehow related to β = m/n. Reducing the number of clauses m reduces the constraints and increases the number of satisfying assignments. Also, if m is reduced, then for each non-satisfying assignment, the number of non-satisfied clauses is also reduced (the penalty number for such an assignment). Increasing the number of 0s and decreasing the penalty factors causes M to decrease. From a certain point onwards, the average, M, will be small enough so as to satisfy the above condition, equation (27). So, one should expect a phase transition at a certain value of β, from a mostly satisfying to a mostly unsatisfied phase, indicating the hardness of the problem instances. In this regard, our analytic results are consistent with numerical simulations (see, for instance, [18]).