Solving Highly Constrained Search Problems with Quantum Computers
A previously developed quantum search algorithm for solving 1-SAT problems in a single step is generalized to apply to a range of highly constrained k-SAT problems. We identify a bound on the number of clauses in satisfiability problems for which the…
Authors: T. Hogg
Journal of Articial In telligence Researc h 10 (1999) 39-66 Submitted 9/98; published 2/99 Solving Highly Constrained Searc h Problems with Quan tum Computers T ad Hogg hogg@p ar c.xer o x.com Xer ox Palo A lto R ese ar ch Center 3333 Coyote Hil l R o ad Palo A lto, CA 94304 USA Abstract A previously dev elop ed quan tum searc h algorithm for solving 1-SA T problems in a single step is generalized to apply to a range of highly constrained k -SA T problems. W e iden tify a b ound on the n um b er of clauses in satisabilit y problems for whic h the general- ized algorithm can nd a solution in a constan t n um b er of steps as the n um b er of v ariables increases. This p erformance con trasts with the linear gro wth in the n um b er of steps re- quired b y the b est classical algorithms, and the exp onen tial n um b er required b y classical and quan tum metho ds that ignore the problem structure. In some cases, the algorithm can also guaran tee that insoluble problems in fact ha v e no solutions, unlik e previously prop osed quan tum searc h algorithms. 1. In tro duction Quan tum computers (Benio, 1982; Bernstein & V azirani, 1993; Deutsc h, 1985, 1989; Di- Vincenzo, 1995; F eynman, 1986; Llo yd, 1993) oer a new approac h to com binatorial searc h problems (Garey & Johnson, 1979) with quantum p ar al lelism , i.e., the abilit y to op er- ate sim ultaneously on man y classical searc h states, and interfer enc e among dieren t paths through the searc h space. A quan tum algorithm to rapidly factor in tegers (Shor, 1994), a problem though t to b e in tractable for classical mac hines, oers a dramatic example of ho w these features of quan tum mec hanics can b e exploited. While sev eral additional algorithms ha v e b een dev elop ed (Bo y er, Brassard, Ho y er, & T app, 1996; Cern y , 1993; Gro v er, 1997b, 1997a; Hogg, 1996, 1998a; T erhal & Smolin, 1997), the exten t to whic h quan tum searc hes can impro v e on heuristically guided classical searc h metho ds remains an op en question. Quan tum algorithms can b e based directly on classical heuristics, ac hieving a searc h cost that is the square ro ot of the corresp onding classical metho d (Brassard, Ho y er, & T app, 1998; Cerf, Gro v er, & Williams, 1998). Obtaining further impro v emen t requires uniquely quan tum mec hanical metho ds. Heuristics exploit the structure of the searc h problems to greatly reduce the searc h cost in man y cases. The success of these heuristics raises the question of whether the structure of searc h problems can form the basis of ev en b etter quan tum algorithms. A suggestion that this is p ossible has b een observ ed empirically for highly constrained problems (Hogg, 1998a), but the complexit y of the algorithm precluded a denitiv e theoretical analysis of its b eha vior. This pap er presen ts a new quan tum searc h algorithm that is extremely eectiv e for some highly constrained searc h problems. These constrain ts also allo w for eectiv e classical heuristics, i.e., these problems are relativ ely easy . Ho w ev er, the new quan tum algorithm re- quires ev en few er steps than the b est classical metho ds, pro viding another example of searc h problems for whic h quan tum computers can outp erform classical ones. More signican tly , c 1999 AI Access F oundation and Morgan Kaufmann Publishers. All righ ts reserv ed. Hogg this algorithm illustrates ho w kno wledge of the structure inheren t in searc h problems can b e used to dev elop new algorithms. Finally , b ecause of its simplicit y , the algorithm's b e- ha vior can b e readily c haracterized analytically in some cases, conclusiv ely demonstrating its asymptotic p erformance b eha vior in those cases. Sp ecically the follo wing t w o sections briey review the ingredien ts of quan tum programs and the satisabilit y problem. The quan tum algorithm for a particularly simple case is describ ed in Section 4 and generalized in Section 5. The new algorithm is then ev aluated for a v ariet y of highly constrained problems. Finally some op en issues are discussed, including a v ariet y of w a ys this approac h can b e extended. 2. Quan tum Computers The state of a classical computer can b e describ ed b y a string of bits, eac h of whic h is im- plemen ted b y some t w o-state device. Quan tum computers use ph ysical devices whose full quan tum state can b e con trolled. F or example (DiVincenzo, 1995), an atom in its ground state could represen t a bit set to 0, and an excited state for 1. The atom can b e switc hed b et w een these states and also b e placed in a uniquely quan tum mec hanical sup erp osition of these v alues, whic h can b e denoted as a v ector 0 1 , with a comp onen t (called an ampli- tude ) for eac h of the corresp onding classical states for the system. These amplitudes are complex n um b ers. A sup erp osition should not b e confused with a probabilistic represen ta- tion of ignorance ab out whether a classical bit is really 0 or 1. Nor is a sup erp osition simply in b et w een a 0 or 1, as could b e the case with a 3 v olt v alue for classical bits implemen ted as 0 and 5 v olts. Instead, a sup erp osition has no complete classical analog. In con trast to a classical mac hine whic h, at an y giv en step of its program, has a denite v alue for eac h bit, a quan tum mac hine with n quan tum bits exists in a general sup erp osition of the 2 n classical states for n bits, describ ed b y the v ector = 0 B @ 0 . . . 2 n 1 1 C A (1) The amplitudes ha v e a ph ysical in terpretation: when the computer's state is measured, the sup erp osition randomly c hanges to one of the classical states with j s j 2 b eing the probabilit y to obtain the state s . Th us amplitudes satisfy the normalization condition P s j s j 2 = 1. This measuremen t op eration is used to obtain denite results from a quan tum computation. Using this ric h set of states requires op erations that can rapidly manipulate the am- plitudes in a sup erp osition. Because quan tum mec hanics is linear and the normalization condition m ust alw a ys b e satised, these op erations are limited to unitary linear op era- tors (Hogg, 1996). That is, a state v ector can only c hange to a new v ector 0 related to the original one b y a unitary transformation, i.e., 0 = U where U is a unitary matrix 1 of dimension 2 n 2 n . In particular, this requires that the op erations b e rev ersible: eac h output is the result of a single input. In spite of the exp onen tial size of the matrix, in man y 1. A complex matrix U is unitary when U y U = I , where U y is the transp ose of U with all elemen ts c hanged to their complex conjugates. Examples include p erm utations, rotations and m ultiplica tion b y phases (complex n um b ers whose magnitude is one). 40 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers cases the op eration can b e p erformed in a time that gro ws only as a p olynomial in n b y quan tum computers (Bo y er et al., 1996; Ho y er, 1997). Imp ortan tly , the quan tum computer do es not explicitly form, or store, the matrix U . Rather it p erforms a series of elemen tary op erations whose net eect is to pro duce the new state v ector 0 . On the other hand, the comp onen ts of the new v ector are not directly accessible: rather they determine the probabilities of obtaining v arious results when the state is measured. Imp ortan t examples of suc h op erations are rev ersible classical programs (Bennett & Landauer, 1985; F eynman, 1996). Let P b e suc h a program. Then for eac h classical state s , i.e., a string of bit v alues, it pro duces an output s 0 = P [ s ], and eac h output is pro duced b y only a single input. A simple example is a program op erating with t w o bits that replaces the rst v alue with the exclusiv e-or of b oth bits and lea v es the second v alue unc hanged, i.e., P [00] = 00, P [01] = 11, P [10] = 10 and P [11] = 01. When used with a quan tum sup erp osition, suc h classical programs op erate indep enden tly and sim ultaneously on eac h comp onen t to giv e a new sup erp osition. That is, a program op erating with n bits giv es P 2 6 4 0 B @ 0 . . . 2 n 1 1 C A 3 7 5 ! 0 B @ 0 0 . . . 0 2 n 1 1 C A (2) where 0 s 0 = s with s 0 = P [ s ]. This quantum p ar al lelism allo ws a mac hine with n bits to op erate sim ultaneously with 2 n dieren t classical states. Unitary op erations can also mix the amplitudes in a state v ector. An example for n = 1 is 1 p 2 1 1 1 1 (3) This con v erts 1 0 , whic h could corresp ond to an atom prepared in its ground state, to 1 p 2 1 1 , i.e., an equal sup erp osition of the t w o states. Since amplitudes are complex n um b ers, suc h mixing can com bine amplitudes to lea v e no amplitude in some of the states. This capabilit y for in terference (Bernstein & V azirani, 1993; F eynman, 1985) distinguishes quan tum computers from probabilistic classical mac hines. 3. The Satisabilit y Problem NP searc h problems ha v e exp onen tially man y p ossible states and a pro cedure that quic kly c hec ks whether a giv en state is a solution (Garey & Johnson, 1979). Constrain t satisfac- tion problems (CSPs) (Mac kw orth, 1992) are an example. A CSP consists of n v ariables, V 1 ; : : : ; V n , and the requiremen t to assign a v alue to eac h v ariable to satisfy giv en constrain ts. An assignment sp ecies a v alue for eac h v ariable. One imp ortan t CSP is the satisabilit y problem (SA T), whic h consists of a logical prop o- sitional form ula in n v ariables and the requiremen t to nd a v alue (true or false) for eac h v ariable that mak es the form ula true. This problem has N = 2 n assignmen ts. F or k -SA T, the form ula consists of a conjunction of clauses and eac h clause is a disjunction of k v ariables, an y of whic h ma y b e negated. F or k 3 these problems are NP-complete. An example of suc h a clause for k = 3, with the third v ariable negated, is V 1 OR V 2 OR (NOT V 3 ), whic h 41 Hogg is false for exactly one assignmen t for these v ariables: f V 1 = false ; V 2 = false ; V 3 = true g . A clause with k v ariables is false for exactly one assignmen t to those v ariables, and true for the other 2 k 1 c hoices. Since the form ula is a conjunction of clauses, a solution m ust satisfy ev ery clause. W e sa y an assignmen t conicts with a particular clause when the v alues the assignmen t giv es to the v ariables in the clause mak e the clause false. F or example, in a four v ariable problem, the assignmen t f V 1 = false ; V 2 = false ; V 3 = true ; V 4 = true g conicts with the k = 3 clause giv en ab o v e, while f V 1 = false ; V 2 = false ; V 3 = false ; V 4 = true g do es not. Th us eac h clause is a constrain t that adds one conict to all assignmen ts that conict with it. The n um b er of distinct clauses m is then the n um b er of constrain ts in the problem. The assignmen ts for SA T can also b e view ed as bit strings with the corresp ondence that the i th bit is 0 or 1 according to whether V i is assigned the v alue false or true, resp ec- tiv ely . In turn, these bit strings are the binary represen tation of in tegers, ranging from 0 to 2 n 1. F or deniteness, w e arbitrarily order the bits so that the v alues of V 1 and V n corresp ond, resp ectiv ely , to the least and most signican t bits of the in teger. F or example, the assignmen t f V 1 = false ; V 2 = false ; V 3 = true ; V 4 = false g corresp onds to the in teger whose binary represen tation is 0100, i.e., the n um b er 4. F or bit strings r and s , let j s j b e the n um b er of 1-bits in s and r ^ s the bit wise AND op eration on r and s . Th us j r ^ s j coun ts the n um b er of 1-bits b oth assignmen ts ha v e in common. W e also use d ( r ; s ) as the Hamming distance b et w een r and s , i.e., the n um b er of p ositions at whic h they ha v e dieren t v alues. These quan tities are related b y d ( r ; s ) = j r j + j s j 2 j r ^ s j (4) An example 1-SA T problem with n = 2 is the prop ositional form ula (NOT V 1 ) AND (NOT V 2 ). This problem has a unique solution: f V 1 = false ; V 2 = false g , an assignmen t with the bit represen tation 00. The remaining assignmen ts for this problem ha v e bit repre- sen tations 01, 10, and 11. 3.1 Highly Constrained SA T Problems In general, SA T problems are dicult to solv e. Ho w ev er, in a few simple cases the v ery regular structure of the searc h space allo ws m uc h more eectiv e algorithms. One example is giv en b y 1-SA T problems. In this case, eac h clause eliminates one v alue for a single v ariable allo wing classical algorithms to examine the v ariables indep enden tly , giving an o v erall searc h cost of O ( n ) in spite of the exp onen tially large n um b er of assignmen ts. A 1-SA T problem has a solution if and only if eac h of the m clauses in v olv es a distinct v ariable. Otherwise, b oth v alues for some v ariable will b e in conict, i.e., making a clause false, resulting in no solutions. 42 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers This simple structure allo ws for rapid searc h. SA T problems with larger clauses ha v e a more complicated structure. Nev ertheless, when the k -SA T problems are highly constrained, their structure is close to that of 1-SA T. T o see this, consider a soluble k -SA T problem. With resp ect to a particular solution of that problem, dene the go o d v alue for eac h v ariable as the v alue (true or false) it is assigned in that solution, while the opp osite v alue is the b ad one for that v ariable. F or k -SA T problems with man y constrain ts, the numb er of bad v alues in an assignmen t can usually b e determined rapidly from its n um b er of conicts, ev en though determining exactly which v ariables ha v e incorrect assigned v alues requires rst nding the solution. In suc h cases, using the n um b er of bad v alues results in a tractable algorithm as long as a priori kno wledge of the solution is not assumed. F or example, consider soluble problems with the largest p ossible n um b er of constrain ts. F or k -SA T, these maximally constrained soluble problems ha v e m = m max where m max = n k ! (2 k 1) (5) i.e., the single solution precludes an y clause that conicts with it. An assignmen t with j bad v alues con tains n j k sets of k v ariables all of whic h ha v e the same v alues as the solution. Eac h of the remaining sets conicts with at least one clause in the problem. Th us eac h assignmen t with j bad v alues has c max ( j ) = n k ! n j k ! (6) conicts. This quan tit y gro ws strictly monotonically with j for j n k , so in these cases j is directly determined b y the n um b er of conicts. Assignmen ts with n k + 1 j n are not distinguishable. Assignmen ts with j = n k + 1 can also b e corrrectly determined b y including neigh- b orho o d information. T o see this, consider an assignmen t s with j bad v alues, and its n neigh b ors, i.e., assignmen ts at Hamming distance one from s . Of these neigh b ors, j ha v e j 1 bad v alues, and the remaining n j ha v e j + 1 bad v alues. F or j n k , s has j neigh b ors with few er conicts and n j with more. Th us for these assignmen ts, exam- ining the n um b er of conicts in the neigh b ors readily determines the v alue of j . When j = n k + 1, the assignmen t con tin ues to ha v e j neigh b ors with few er conicts, but no w the remaining k 1 neigh b ors ha v e the same n um b er of conicts since the additional bad v alue do es not increase the n um b er of conicts. Finally , the neigh b ors of assignmen ts with n k + 1 < j n all ha v e the same n um b er of conicts. Th us examining the n um b er of conicts in an assignmen t's neigh b ors determines the v alue of j , with the exception that assignmen ts with n k + 1 < j n are not distinguishable. The v alue of j is the n um b er of conicts that s w ould ha v e in the maximally constrained 1-SA T problem with the same solution as the giv en maximally constrained k -SA T problem. Th us for a maximally constrained k -SA T problem let c e ( s ) = ( j if j n k + 1 n k + 2 otherwise (7) 43 Hogg The v alue of c e ( s ) can b e determined rapidly , in m uc h the same w a y that a classical lo cal searc h metho d c hec ks the n um b er of conicts among neigh b ors of its curren t state to deter- mine whic h assignmen t to mo v e to next (Min ton, Johnston, Philips, & Laird, 1992; Selman, Lev esque, & Mitc hell, 1992). Th us c e is a computationally tractable appro ximation to the n um b er of conicts eac h assignmen t w ould ha v e in the corresp onding 1-SA T problem. Except for a few assignmen ts with man y conicts, c e giv es the correct v alue. Sp ecically , only assignmen ts with at least n k + 3 bad v alues are giv en an incorrect v alue of j b y this appro ximation. In particular, the appro ximation is completely correct for k = 2. While classical searc hes use the n um b er of conicts in an assignmen t and its neigh b ors, another p ossibilit y for maximally constrained problems is to use the n um b er of conicts in the assignmen t and its complemen t (i.e., the assignmen t with opp osite v alues for all the v ariables). If the assignmen t has j bad v alues, its complemen t will ha v e n j . As describ ed ab o v e, the n um b er of conicts in an assignmen t uniquely determines the corresp onding v alue of j pro vided j n k . On the other hand, the n um b er of conicts in the complemen t assignmen t uniquely determines j when n j n k , or j k . Th us, as long as n > 2 k , at least one of these conditions will b e true for all 0 j n and the correct v alue of j can b e determined. 3.2 Random SA T Problems Theoretically , searc h algorithms are often ev aluated for the w orst p ossible case. Ho w ev er, in practice, searc h problems are often found to b e considerably easier than suggested b y these w orst case analyses (Hogg, Hub erman, & Williams, 1996). This observ ation leads to examining the t ypical b eha vior of searc h algorithms with resp ect to a sp ecied ensemble of problems, i.e., a class of problems and a probabilit y for eac h to o ccur. F or instance, the ensem ble of random k -SA T is sp ecied b y the n um b er of v ariables n , the size of the clauses k and the n um b er of distinct 2 clauses m . The quan tum algorithm presen ted in this pap er is eectiv e for highly constrained soluble k -SA T problems. When there are man y constrain ts, soluble problems are v ery rare among randomly generated instances. Th us to study the algorithm's b eha vior w e generate random problems with a presp ecied solution. That is, a random assignmen t is selected to b e a solution and used to restrict the selection of clauses for the problem. In the remainder of this section w e describ e t w o metho ds for generating suc h problems, and ho w they can b e related to corresp onding 1-SA T problems. 3.2.1 Prespecified Solution The most common use of a presp ecied solution is to simply a v oid selecting an y clauses that conict with it. Th us, w e generate problems b y randomly selecting a set of m distinct clauses from among the m max , giv en b y Eq. (5), a v ailable clauses (Nijenh uis & Wilf, 1978). Consider a giv en soluble k -SA T problem with m clauses, and let the assignmen t r b e one of its solutions. With resp ect to the solution r , w e can dene the bad v alue for eac h 2. This ensem ble diers sligh tly from other studies where the clauses are not required to b e distinct. 44 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers v ariable. F or an assignmen t with j bad v alues, the probabilit y it has c conicts is P conf ( c j j ) = c max ( j ) c m max c max ( j ) m c m max m (8) where c max ( j ), giv en b y Eq. (6), is the largest p ossible n um b er of conicts for an assignmen t with j bad v alues. The probabilit y that an assignmen t has j bad v alues is P bad ( j ) = 2 n n j ! F rom these expressions and the denition of conditional probabilit y , the probabilit y that an assignmen t with c conicts has j bad v alues is P bad ( j j c ) / P conf ( c j j ) P bad ( j ) (9) Hence, for a giv en assignmen t s with c conicts, w e can estimate the n um b er of bad v alues it has b y pic king j that maximizes P bad ( j j c ). W e use this maxim um lik eliho o d v alue for j as c e ( s ) instead of Eq. (7) for random soluble k -SA T problems. This estimate is readily computed from the n um b er of conicts. 3.2.2 Balanced Cla uses Generating problems with a presp ecied solution as describ ed ab o v e is commonly used to study searc h problems. Ho w ev er, for eac h v ariable there are more allo w able clauses where the v ariable is assigned its bad v alue than its go o d v alue. This mak es highly constrained instances particularly easy since the go o d v alue for eac h v ariable can often b e determined from its assigned v alue that app ears most often in the clauses (Gen t, 1998). This bias in clause selection can b e remo v ed b y a sligh t c hange in the generation metho d (V an Gelder & Tsuji, 1993). Sp ecically , instead of only a v oiding those clauses that conict with the presp ecied solution, i.e., sp ecify zero bad v alues, w e also a v oid an y clauses that ha v e an ev en n um b er of bad v alues with resp ect to the presp ecied solution. This selection metho d means b oth v alues for eac h v ariable app ear equally often among the clauses. These balanced problems can ha v e at most m bal max = n k ! 2 k 1 (10) clauses. F urthermore, an assignmen t with j bad v alues can ha v e at most c bal max ( j ) = X i 0 j i ! n j k i ! (11) conicts, where the sum is o v er o dd v alues of i . Using these v alues in Eq. (8) instead of m max and c max ( j ) giv es the maxim um lik eliho o d estimate for j in this \balanced clause" ensem ble conditioned on the n um b er of conicts in the assignmen t. 45 Hogg 4. Solving 1-SA T A quan tum computer, op erating on sup erp ositions of all assignmen ts for any 1-SA T prob- lem, can nd a solution in a single searc h step (Hogg, 1998b). As a basis for solving highly constrained problems with larger clause sizes, w e fo cus on maximally constrained 1-SA T whic h, from Eq. (5), has m = n clauses and allo ws a simple sp ecication. Sp ecically , w e rst motiv ate and dene the algorithm for this case and illustrate it with small examples. Then w e sho w that it is guaran teed to nd a solution if one exists, and nally describ e ho w the algorithm can b e ecien tly implemen ted on a quan tum computer. The remainder of the pap er then sho ws ho w this algorithm can form the basis for eectiv ely solving highly constrained k -SA T for k > 1. 4.1 Motiv ation Solving a searc h problem with a quan tum computer requires nding a unitary op erator L that transforms an easily constructed initial state v ector to a new state with large am- plitude in those comp onen ts of the state v ector corresp onding to solutions. F urthermore, determining this op erator and ev aluating it with the quan tum computer m ust b e tractable op erations. This restriction means that an y information used for a particular assignmen t m ust itself b e easily computed, and the algorithm only uses readily computable unitary op erations. T o design a single-step quan tum algorithm, w e consider sup erp ositions of all assignmen ts for the problem. Since w e ha v e no a priori kno wledge of the solution, an un biased initial state v ector is one with equal amplitude in eac h assignmen t: s = 2 n= 2 . W e m ust then incorp orate information ab out the particular problem to b e solv ed in to this state v ector. As in previous algorithms (Gro v er, 1997b; Hogg, 1996, 1998a), w e do this b y adjusting the phases in parallel, based on a readily computed prop ert y of eac h assignmen t: its n um b er of conicts with the constrain ts of the problem. This amoun ts to m ultiplication b y a diagonal matrix R , with the en tries on the diagonal ha ving unit magnitude so that R is unitary . The resulting amplitude for assignmen t s is then of the form ( s )2 n= 2 where j ( s ) j = 1 and ( s ) dep ends only on the n um b er of conicts in s . While this op eration adds problem sp ecic information to the state v ector, in itself it do es not solv e the problem: at this p oin t a measuremen t w ould return assignmen t s with probabilit y j ( s ) j 2 2 n = 2 n , the same as random selection. This op eration also illustrates ho w the unitarit y requiremen t, j ( s ) j = 1, prev en ts us from using a computationally more desirable selection, i.e., ( s ) = 0 if s is not a solution, and nonzero otherwise. Suc h a c hoice, if p ossible, w ould immediately giv e a state v ector with all amplitude in the solution. While determining whether a giv en assignmen t is a solution can b e done rapidly for an y NP problem, that information can not b e directly used to set amplitudes of the nonsolutions to zero. Th us, while quan tum parallelism allo ws rapid testing of all assignmen ts, the restriction to unitary op erators sev erely limits the use that can b e made of this information. F or a single-step searc h algorithm, the remaining op erations m ust not require an y addi- tional ev aluation of the problem constrain ts, i.e., these op erations will b e the same for all problems of a giv en size. One the other hand, this restriction has the adv an tage of allo wing more general unitary matrices than just phase adjustmen ts. Sp ecically , this allo ws op er- 46 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers ations that mix the v arious comp onen ts of the state v ector. W e need to iden tify a mixing op erator U that mak es all con tributions to the solution add together in phase, but with U indep enden t of the particular problem. The nal result of the algorithm is r = P s U r s ( s )2 n= 2 . Supp ose t is the solution. The maxim um p ossible con tribution to t will b e when all v alues in the sum com bine in- phase. This will b e the case if U ts = ( s )2 n= 2 where is the complex conjugate of . In this case, t = P s j ( s ) j 2 2 n whic h is just equal to 1. Ho w ev er, the mixing matrix itself is to b e indep enden t of an y particular problem. Th us the issue is whether it is p ossible to create a U whose v alues will ha v e the required phases no matter where the solution is. One approac h is to note that the mixing should ha v e no bias as to the amoun t of amplitude that will need to b e mo v ed from one assignmen t to another in the state v ector. This means that the magnitude of eac h elemen t in U will b e the same, i.e., j U r s j = 2 n= 2 . F or the phase of eac h elemen t, w e can consider using the feature of assignmen ts used in classical lo cal searc hes, namely the neigh b ors of eac h assignmen t. This suggests ha ving U r s dep end only on the Hamming distance b et w een r and s , i.e., U r s = 2 n= 2 d ( r ;s ) where j d j = 1. With the elemen ts of U dep ending only on the Hamming distance, the matrix is inde- p enden t of an y particular problem's constrain ts. The question is then whether some feasible c hoices of ( s ) and d allo w 2 n P s d ( t;s ) ( s ) = 1 for the solution t . This will b e the case pro vided d ( t;s ) = ( s ), where ( s ) = c dep ends only on the n um b er of conicts c in assignmen t s . This relation do es not hold for all searc h problems. Ho w ev er, for the maxi- mally constrained 1-SA T considered here, the Hamming distance of assignmen t s from the solution, d ( t; s ), whic h is the n um b er of bad v alues in s , is precisely equal to the n um b er of conicts in s . Th us, to ensure all amplitude is com bined in to the solution, w e merely need to ha v e d = d . The nal question is what c hoices for the d v alues are consisten t with U b eing a unitary matrix. This requiremen t restricts the a v ailable c hoices, e.g., ha ving all d = 1 results in the non unitary matrix with all elemen ts equal to 2 n= 2 . T o examine the p ossible c hoices, consider the smallest p ossible case, n = 1. One max- imally constrained, but still solv able, problem has the single clause NOT V 1 and solution V 1 = false. The t w o assignmen ts, 0 and 1, ha v e, resp ectiv ely , 0 and 1 conicts. Since o v erall phase factors are irrelev an t, w e can select 0 = 1 lea ving a single remaining c hoice for 1 . F or the matrix U , w e ha v e pairs of assignmen ts with Hamming distance 0 and 1. Requiring d = d then giv es U = 1 p 2 1 1 1 1 The unitarit y condition, U y U = I , then requires that 1 b e purely imaginary , i.e., 1 = i . W e arbitrarily pic k 1 = i . Starting from the initial state with equal amplitude in b oth assignmen ts w e then ha v e the results of applying R follo w ed b y U : 1 p 2 1 1 ! 1 p 2 1 i ! 1 0 giving all the amplitude in the solution. The o v erall op eration L = U R is L = 1 2 1 1 i i 47 Hogg It is imp ortan t to note that the same op erations also w ork if, instead, the other assign- men t is the solution, i.e., the problem has the clause V 1 and solution V 1 = true. In this case, the assignmen ts 0 and 1 no w ha v e, resp ectiv ely , 1 and 0 conicts so the 1 = i phase adjustmen t is no w applied to assignmen t 0. The op eration then giv es 1 p 2 1 1 ! 1 p 2 i 1 ! 0 1 Again, all amplitude is in the single solution, and the o v erall op eration is L = 1 2 i i 1 1 While the o v erall op eration L dep ends on the lo cation of the solution, for these problems it can b e implemen ted b y comp osing op erators U and R that do not require kno wledge of the solution. Instead, as describ ed more generally in Section 4.5, R is implemen ted b y using the classical function for ev aluating the n um b er of conicts in a giv en assignmen t, but applied to a sup erp osition of all assignmen ts. With these motiv ating argumen ts for the form of the op erations, examining a few larger v alues of n establishes the simple pattern of phases used in the algorithm describ ed in the remainder of this section. 4.2 The Algorithm for Maximally Constrained 1-SA T Briey , the algorithm starts with an equal sup erp osition of all the assignmen ts, adjusts the phases of the amplitudes based on the n um b er of conicts in the assignmen ts, and then mixes the amplitudes from dieren t assignmen ts. This algorithm requires only a single testing of the assignmen ts, corresp onding to a single classical searc h step. Sp ecically , the initial state is s = 2 n= 2 for eac h of the 2 n assignmen ts s , and the nal state v ector is = U R (12) where the matrices R and U are dened as follo ws. The matrix R is diagonal with R ss ( s ) dep ending on the n um b er of conicts c in the assignmen t s , ranging from 0 to n : ( s ) = c = i c (13) The mixing matrix elemen ts U r s = u d ( r ;s ) dep end only on the Hamming distance b et w een the assignmen ts r and s , with u d = 2 n= 2 ( i ) d (14) and d ranging from 0 to n . 4.3 Examples T o illustrate the algorithm, consider the example problem in Section 3. It has n = m = 2. With the assignmen ts ordered according to the corresp onding in terger v alue, i.e., 00, 01, 10, and 11, U = A (2) = 2 where A (2) = 0 B B @ 1 i i 1 i 1 1 i i 1 1 i 1 i i 1 1 C C A (15) 48 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers The resulting b eha vior is: assignmen t s 00 01 10 11 n um b er of conicts 0 1 1 2 ( s ) 1 i i 1 1 = 2 1 = 2 1 = 2 1 = 2 R 1 = 2 i= 2 i= 2 1 = 2 = U R 1 0 0 0 giving an amplitude of 1 in the solution assignmen t 00. Another example, with n = m = 3 is the prop ositional form ula (NOT V 1 ) AND (NOT V 2 ) AND V 3 , with assignmen ts 000 ; 001 ; 010 ; : : : ; 110 ; 111, represen ted as bit v ectors, and solution f V 1 = false ; V 2 = false ; V 3 = true g , i.e., the bit v ector 100. In this case U can b e expressed in terms of A (2) from Eq. (15) in blo c k form: U = 1 p 8 A (2) iA (2) iA (2) A (2) (16) F or this case, the algorithm's b eha vior is: assignmen t s 000 001 010 011 100 101 110 111 n um b er of conicts 1 2 2 3 0 1 1 2 ( s ) i 1 1 i 1 i i 1 p 8 1 1 1 1 1 1 1 1 p 8 R i 1 1 i 1 i i 1 = U R 0 0 0 0 1 0 0 0 Again, all the amplitude is in the solution. 4.4 P erformance of the Algorithm Consider a maximally constrained soluble 1-SA T problem with n v ariables. As describ ed in Section 3, in suc h a problem eac h clause in v olv es a separate v ariable and there is exactly one solution. T o sho w that the algorithm w orks for all n , w e ev aluate Eq. (12). F or eac h assignmen t s , ( R ) s = ( s )2 n= 2 from Eq. (13). Then for eac h assignmen t r , ( U R ) r = 2 n= 2 P s U r s ( s ). Eac h s in this sum can b e c haracterized b y x : the n um b er of conicts s shares with r y : the n um b er of conicts of s that are not conicts of r Let h b e the n um b er of conicts in the assignmen t r , i.e., the n um b er of the n v ariables to whic h r assigns an incorrect v alue. In terms of these quan tities, s has x + y conicts and is at Hamming distance d ( r ; s ) = ( h x ) + y from r . The n um b er of suc h assignmen ts is h x n h y , so the sum can b e written as ( U R ) r = 2 n= 2 X x h x ! X y n h y ! u h x + y x + y (17) 49 Hogg Substituting the v alues from Eq. (13) and (14), giv es ( U R ) r = 2 n X x h x ! X y n h y ! ( i ) h x + y i x + y (18) = 2 n ( i ) h 2 n h X x h x ! ( 1) x This giv es ( U R ) r = h 0 where xy = 1 if x = y and 0 otherwise b y use of the iden tit y h X x =0 ( 1) x h x ! = h 0 (19) Th us, = U R has all its amplitude in the state with no conicts, i.e., the unique solution. A measuremen t made on this nal state is guaran teed to pro duce a solution. 4.5 Implemen tation Conceptually , the op eration of Eq. (12) can b e p erformed classically b y matrix m ultipli- cation. Ho w ev er, since the matrices ha v e 2 n ro ws and columns, this is not b e a practical algorithm. As describ ed in Section 2, quan tum computers can rapidly p erform man y matrix op erations of this size. Here w e sho w ho w this is p ossible for the op erations used b y this algorithm. F or describing the implemen tation, it is useful to denote the individual comp onen ts in a sup erp osition explicitly . T raditionally , this is done using the k et notation in tro duced b y Dirac (1958). F or instance, the sup erp osition describ ed b y the state v ector of Eq. (1) is equiv alen tly written as P s s j s i where j s i just represen ts a unit basis v ector corresp onding to the assignmen t s . An example of these alternate, and equiv alen t, notations is: 0 1 = 0 1 0 + 1 0 1 = 0 j 0 i + 1 j 1 i 4.5.1 F orming the Initial Superposition The initialization of can b e p erformed rapidly b y applying the matrix of Eq. (3) separately to eac h of the n bits. F or instance, when n = 2, starting from b oth bits set to 0, the state v ector is c hanged as: j 00 i ! 1 p 2 ( j 00 i + j 01 i ) ! 1 2 (( j 00 i + j 10 i ) + ( j 01 i + j 11 i )) Equiv alen tly , in terms of state v ectors, this is 0 B B @ 1 0 0 0 1 C C A ! 1 p 2 0 B B @ 1 1 0 0 1 C C A ! 1 2 0 B B @ 1 1 1 1 1 C C A 50 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers 4.5.2 Adjusting Phases F or the op eration R , note that eac h v alue in Eq. (13) has unit magnitude so R is a unitary diagonal matrix. F urthermore eac h c only requires using the ecien t classical pro cedure f ( s ) that coun ts the n um b er of conicts in an assignmen t s . W e require a rev ersible v ersion of this pro cedure, whic h can b e made with an additional program register. When the phases to b e in tro duced are just 1, this additional register needs to tak e on only t w o v alues, 0 or 1, corresp onding to whether the phase should b e 1 or 1, resp ectiv ely . Th us it can b e represen ted with a single additional quan tum bit, b ey ond those required to represen t the assignmen t. Suc h phases ha v e b een used in previous algorithms (Hogg, 1996; Gro v er, 1997b) and can b e implemen ted through a single ev aluation of f ( s ) b y setting the extra v ariable to b e a sup erp osition of its t w o v alues (Bo y er et al., 1996). In the algorithm presen ted here, Eq. (13) requires phases that are p o w ers of i , whic h can tak e on four dieren t v alues: 1, i , 1 and i . The tec hnique used with 1 phases can b e generalized to w ork with these four v alues, again with a single ev aluation of f ( s ). The additional register m ust consist of t w o quan tum bits, so it can tak e on the v alues 0, 1, 2 or 3. F or an assignmen t s and register x , w e use the rev ersible op eration F : j s; x i ! j s; x + c mo d 4 i where c = f ( s ) is the n um b er of conicts in assignmen t s . It then remains to sho w ho w this op eration can b e used to p erform the required phase adjustmen ts. Just as w e op erate with a sup erp osition of all p ossible assignmen ts, to implemen t the phase adjustmen t, w e set register x to b e a particular sup erp osition of its four v alues: = 1 2 ( j 0 i i j 1 i j 2 i + i j 3 i ). One w a y to construct this sup erp osition is to start with b oth bits of x set to 1, op erate on the most signican t bit with Eq. (3) and then op erate on the other bit with 1 p 2 i 1 1 i to get j 11 i ! 1 p 2 ( j 01 i j 11 i ) ! 1 2 ( ( j 00 i i j 01 i ) ( j 10 i i j 11 i )) This is just the sup erp osition when w e mak e the corresp ondence b et w een the 2-bit v ectors 00 ; : : : ; 11 and the in tegers 0 ; : : : ; 3, resp ectiv ely . W e start with the equal sup erp osition of amplitudes for the assignmen ts and this sup er- p osition for x : 2 n= 2 X s j s i = 2 n= 2 1 X s 3 X x =0 ( i ) x j s; x i As illustrated with Eq. (2), the op eration F acts on eac h term in this sup erp osition sepa- rately , to pro duce 2 n= 2 1 X sx ( i ) x j s; x + c mo d 4 i 51 Hogg where c is the n um b er of conicts in assignmen t s . Let y = x + c mo d 4. Then, for a giv en assignmen t s , as x ranges from 0 to 3, y also tak es on these v alues, but not necessarily in the same order. Th us this resulting sup erp osition can also b e written as 2 n= 2 1 X s 3 X y =0 ( i ) y c j s; y i b ecause ( i ) 4 = 1. In this form, the sums separate to giv e nally 2 n= 2 X s i c j s i 3 X y =0 ( i ) y j y i = 2 n= 2 X s i c j s i The net result of applying F using the sup erp osition for the additional register is to c hange the phase of eac h assignmen t s b y i c , as required b y Eq. (13). Imp ortan tly , the nal result repro duces the original factored form in whic h the sup erp osition of assignmen ts is not correlated with the sup erp osition of the register. This factored form means the register pla ys no role in the subsequen t mixing op eration applied b y the matrix U to the sup erp osition of assignmen ts. Th us this pro cedure pro duces the required phase c hanges using only one ev aluation of f ( s ), sho wing ho w the phases of a sup erp osition of assignmen ts can b e adjusted without requiring an y prior explicit kno wledge of the solution. 4.5.3 The Mixing Ma trix T o implemen t U sp ecied b y Eq. (14) w e use t w o simpler matrices, W and dened as follo ws. F or assignmen ts r and s , W r s = 2 n= 2 ( 1) j r ^ s j (20) is the W alsh transform and is a diagonal matrix whose elemen ts r r ( r ) dep end only on the n um b er of 1-bits in eac h assignmen t, namely , ( r ) = h i h e i n= 4 (21) where h = j r j , ranging from 0 to n . The o v erall phase, e i n= 4 , is not essen tial for the algorithm. It merely serv es to mak e the nal amplitude in the solution b e one rather than e i n= 4 . Whether or not this o v erall phase is used, the probabilit y to nd a solution is one. The matrix W is unitary and can b e implemen ted ecien tly (Bo y er et al., 1996; Gro v er, 1997b). F or n = 1, W is just the matrix of Eq. (3). The phases in the matrix are p o w ers of i and so can b e computed rapidly using similar pro cedures to those describ ed ab o v e for the matrix R . In this case w e use a pro cedure that coun ts the n um b er of 1-bits in eac h assignmen t rather than the n um b er of conicts. Finally w e sho w that U can b e implemen ted b y the pro duct W W . T o see this, let ^ U W W . Then ^ U r s = 2 n n X h =0 h S h ( r ; s ) (22) where S h ( r ; s ) = X t; j t j = h ( 1) j r ^ t j + j s ^ t j (23) 52 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers with the sum o v er all assignmen ts t with h 1-bits. Eac h 1-bit of t con tributes 0, 1 or 2 to j r ^ t j + j s ^ t j when the corresp onding p ositions of r and s are b oth 0, ha v e exactly a single 1-bit, or are b oth 1, resp ectiv ely . Th us ( 1) j r ^ t j + j s ^ t j equals ( 1) z where z is the n um b er of 1-bits in t that are in exactly one of r and s . There are ( j r j j r ^ s j ) + ( j s j j r ^ s j ) p ositions from whic h suc h bits of t can b e selected, and b y Eq. (4) this is just d ( r ; s ). Th us the n um b er of assignmen ts t with h 1-bits and z of these bits in exactly one of r and s is giv en b y d z n d h z where d = d ( r ; s ). Th us S h ( r ; s ) = S ( n ) hd where S ( n ) hd = X z ( 1) z d z ! n d h z ! (24) so that ^ U r s = ^ u d ( r ;s ) with ^ u d = 2 n P h h S ( n ) hd . Substituting the v alue of h from Eq. (21) then giv es ^ u d = 2 n e i n= 4 X hz i h ( 1) z d z ! n d h z ! = 2 n e i n= 4 (1 i ) d (1 + i ) n d whic h equals u d as dened in Eq. (14). Th us U = W W , allo wing U to b e ecien tly implemen ted. As a nal note, except for a dieren t c hoice of the h phases, this is the same implemen tation as used for the mixing matrix dened in an unstructured quan tum searc h algorithm (Gro v er, 1997b). 4.5.4 Required Sear ch Time While searc h algorithm p erformances are often compared based on the n um b er of searc h steps required, i.e., the n um b er of sequen tially examined assignmen ts, it is also imp ortan t to compare the n um b er of more elemen tary computational op erations required. A t the most fundamen tal lev el, these op erations are logic op erators on one or t w o bits at a time (e.g., the logical not or exclusiv e-or op erations). As describ ed ab o v e, the matrix op erations and forming the initial state can b e done with a series of O ( n ) bit op erations (Bo y er et al., 1996). The time required to coun t the n um b er of conicts in an assignmen t dep ends on data structures used to represen t the problem. A single ev aluation will b e comparable for b oth the quan tum and classical algorithms. F or a SA T problem with m clauses, examining eac h clause to see if it conicts with a giv en assignmen t uses O ( m ) tests. Eac h of these tests will, in turn, require comparing at least part of the clause to the assignmen t. Because the clauses in k -SA T are of xed size, this giv es an o v erall cost of O ( m ) to ev aluate the n um b er of conicts. F or lo cal classical searc h, the n um b er of conicts in neigh b oring assignmen ts will also b e ev aluated to determine whic h assignmen t should b e examined at the next step of the searc h. Since neigh b ors dier b y the v alue of only one v ariable, in fact it is only necessary to examine clauses that in v olv e that v ariable to determine the dierence in the n um b er of conicts b et w een an assignmen t and one of its neigh b ors. This ev aluation will th us require only O ( m=n ) tests. Examining eac h, or a least a go o d p ortion, of the n neigh b ors results in 53 Hogg a total of O ( m ) tests to nd the next assignmen t. Selecting an initial assignmen t requires a v alue for eac h v ariable, a cost of O ( n ). Th us w e can exp ect b oth algorithms to in v olv e costs of O ( n + m ) to ev aluate a single searc h step. That is, the cost for a single searc h step is ab out the same for the quan tum algorithm and classical searc hes when neigh b ors are examined. Ho w ev er, the quan tum algorithm is able to examine the c haracteristics of all assignmen ts in sup erp osition while a classical searc h examines just one state, allo wing the quan tum algorithm to complete in just one step while the b est classical metho ds for k -SA T require O ( n ) steps. F or the highly constrained k -SA T problems with k > 1, discussed b elo w, m n so the dominan t cost will b e in the ev aluation of the n um b er of conicts. This discussion indicates ho w a comparison of searc h steps giv es a reasonable compari- son in terms of elemen tary op erations as w ell. Ho w ev er, a full comparison will also dep end on details of actual implemen tations, suc h as an y additional op erations required for con- trolling errors that cannot themselv es b e p erformed in parallel with the higher lev el steps of the algorithm. These remain signican t issues in the dev elopmen t of quan tum compu- tation (Landauer, 1994; Unruh, 1995; Haro c he & Raimond, 1996; Monro e & Wineland, 1996), but at this p oin t seem unlik ely to b e fundamen tal diculties (Berthiaume, Deutsc h, & Jozsa, 1994; Shor, 1995; Knill, Laamme, & Zurek, 1998). In particular, b ecause the algorithm requires only a single step, decoherence is lik ely to b e less of a dicult y for it than searc h algorithms that require m ultiple rep eated steps to mo v e signican t amplitude to solutions (Gro v er, 1997b; Hogg, 1998a). Finally , searc h algorithms can b e compared based on elapsed execution time. Curren t hardw are implemen tations (Barenco, Deutsc h, & Ek ert, 1995; Bou wmeester et al., 1997; Ch uang, V andersyp en, Zhou, Leung, & Llo yd, 1998; Cirac & Zoller, 1995; Cory , F ahm y , & Ha v el, 1996; Gershenfeld, Ch uang, & Llo yd, 1996; Sleator & W einfurter, 1995) are quite limited in size, so suc h a comparison will need to a w ait the construction of quan tum mac hines with a sucien t n um b er of bits to p erform in teresting searc hes. 5. Applying the Algorithm to k -SA T The algorithm presen ted ab o v e is eectiv e for 1-SA T b y exploiting the simple structure of suc h problems. As describ ed in Section 3, man y highly constrained k -SA T problems ha v e a similar structure. This observ ation allo ws the 1-SA T algorithm to b e applied to more general problems, although with a reduction in p erformance. Sp ecicall y , applying Eq. (13) requires kno wing the n um b er of conicts the assignmen ts w ould ha v e in the corresp onding maximally constrained 1-SA T problem whose solution is equal to one of the solutions of the original k -SA T problem. As describ ed in Section 3.1, for the most part this can b e computed ecien tly using the neigh b orho o d relations for the problem. This suggests simply c hanging the 1-SA T algorithm to use ( s ) = c e ( s ) . T o see ho w this appro ximation c hanges the p erformance, consider an assignmen t s with y bad v alues with resp ect to a sp ecic solution r and let ( s ) = c e ( s ) y (25) The v ector v ( k ) = R used with the k -SA T problem is related to the v ector from the corresp onding 1-SA T problem v (1) b y v ( k ) s = v (1) s + s . Except for this c hange, the remaining 54 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers transformations of the algorithm are the same as in the 1-SA T case. Th us U R = (1) + U where (1) is the result of the corresp onding 1-SA T problem, i.e., all amplitude in the solution, and is a diagonal matrix, with elemen ts giv en b y ( s ). It is con v enien t to dene the a v erage v alue of ( s ) o v er all assignmen ts with y bad v alues: y = 1 n y X s 0 ( s ) (26) where the sum is restricted to just the n y assignmen ts with y bad v alues. The c hange in the amplitude in the solution state is determined b y ( U ) r when r is the solution. This c hange can b e expressed using Eq. (17) b y recalling that h = 0 for the solution and replacing the phases y b y the error in the phases, y : = 2 n= 2 n X y =0 n y ! u y y (27) Since all the y ha v e unit magnitude, j y j 2. If the problem has only one solution, the probabilit y the algorithm will nd it is P soln = j 1 + j 2 . If there are m ultiple solutions, this is a lo w er b ound on the probabilit y . The follo wing sections use these observ ations to extend the range of problems to whic h the 1-SA T algorithm can b e eectiv ely applied. 6. Solving Maximally Constrained k -SA T The regular structure of maximally constrained soluble k -SA T problems allo ws them to b e solv ed in O (1) steps. That is, the probabilit y to nd a solution remains O (1) as n increases. Th us a solution is v ery lik ely to b e found b y rep eating the algorithm O (1) times, and, as describ ed ab o v e, eac h trial of the algorithm in v olv es only one ev aluation of the conicts. T o see this, w e use c e ( s ) from Eq. (7). F or k > 2, this appro ximation results in incorrect phase c hoices for only a few, high-conict assignmen ts. Because the prop ortion of incorrect phases is small, w e can exp ect this appro ximation will in tro duce only small amplitudes in nonsolution states. Ho w ev er, it will also mak e the algorithm incomplete: it can nd a solution if one exists but not pro v e no solutions exist. Sp ecically , ( s ) can b e nonzero only for y n k + 3, where y is the n um b er of bad v alues in assignmen t s . Th us using Eq. (27), j y j 2 and Eq. (14), j j 2 n 2 n X y = n k +3 n y ! When n k + 3 n= 2, the sum o v er binomial co ecien ts can b e b ounded (P almer, 1985) to giv e j j 2 ( n 1) n k 3 ! n + 1 ( k 3) n + 1 2( k 3) 2 ( n 1) n k 3 ( k 3)! (28) 55 Hogg Th us the probabilit y to obtain a solution is P soln = j 1 + j 2 (1 j j ) 2 1 2 ( n 2) n k 3 ( k 3)! ! 1 (29) whic h rapidly approac hes 1. Hence, this algorithm is able to nd the solution in O (1) searc h steps as n increases. This b eha vior is illustrated in Figure 1. 5 10 15 20 25 30 n -7 10 -5 10 -3 10 -1 10 1-P Figure 1: Beha vior of 1 P soln vs. n for maximally constrained soluble k -SA T for k = 3 (blac k) and 4 (gra y). F or comparison, the b ounds (1 j j ) 2 from Eq. (28) are sho wn as the dashed lines. Similarly , soluble balanced k -SA T problems with the maxim um p ossible n um b er of clauses, giv en b y Eq. (10), giv e go o d p erformance as sho wn in Figure 2. The b eha vior in this case is rather irregular and con tin ues for larger v alues of n , but still giv es a high probabilit y to nd a solution. F or o dd k , the probabilit y for a solution is exactly one for man y v alues of n . In fact, b y including neigh b orho o d information, the errors in the remain- ing cases can also b e eliminated, giving a p erfect algorithm for these problems. F or ev en k , the balanced clauses force the problem to ha v e t w o solutions with opp osite v alues. Ev en though this problem structure diers signican tly from that of a 1-SA T problem with a single solution, the algorithm is able to nd solutions for k = 4 with probabilit y of ab out 1/2, ev en as n increases. 7. Solving Highly Constrained Random k -SA T The discussion of Section 3.2 sho ws ho w a maxim um lik eliho o d estimate for c e can b e computed for eac h assignmen t. This v alue can then b e used to extend the algorithm to arbitrary k -SA T problems. T o the exten t that the errors in tro duced b y this appro ximation are small, the quan tum algorithm will ha v e a substan tial probabilit y to nd a solution in a single step. 56 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers 20 30 40 50 n 0.2 0.4 0.6 0.8 1 P Figure 2: Beha vior of P soln vs. n for maximally constrained balanced soluble k -SA T for k = 3 (blac k) and 4 (gra y). F or comparison, the b ounds (1 j j ) 2 based on Eq. (27) are sho wn as the dashed lines, and is quite small for the k = 4 case. When a v eraged o v er the problem ensem ble, the error giv en b y Eq. (27) b ecomes j j B 2 n 2 n X y =0 n y ! p y where p y is the probabilit y an assignmen t with y bad v alues is (incorrectly) determined to ha v e a dieren t n um b er of bad v alues. In terms of the conditional probabilities of Section 3.2, p y = 1 X c P conf ( c j y ) cy where cy = 1 when the maxim um lik eliho o d estimate for a state with c conicts is y (i.e., c e = y ), and 0 otherwise. F or simplicit y , these maxim um lik eliho o d estimates are determined solely from the n um- b er of conicts in eac h state. The c e v alues could b e made a bit more accurate b y including neigh b orho o d information, as w as used for maximally constrained random problems in Sec- tion 6. Because highly constrained random SA T problems are relativ ely easy , they ha v e not b een w ell-studied with classical algorithms. Hence, to pro vide comparison with the quan tum searc h results presen ted b elo w, these problems w ere also solv ed with the classical GSA T pro cedure (Selman et al., 1992), limiting eac h trial to use no more than 2 n steps b efore a new random initial state w as selected. F or b oth random and balanced ensem bles, the median n um b er of searc h steps required to nd a solution gro ws linearly o v er the range of sizes considered here when m = O ( n 2 ). In particular, while the balanced ensem ble has larger searc h costs, it still gro ws linearly when there is suc h a large n um b er of clauses. 57 Hogg 7.1 Random k -SA T F or random k -SA T with presp ecied solution, Stirling's asymptotic expansion in Eq. (8) sho ws that p y = O (1) for y = O ( n ) when m gro ws as O ( n 2 ), whic h is m uc h less that the maxim um m max = O ( n k ). In this case, the asymptotic b eha vior of the b ound B is determined b y the v alues near the maxim um of the binomial co ecien t, i.e., near y = n= 2. Th us if m = n 2 , w e ha v e B 2 p n= 2 . F rom Eq. (29), P soln = O (1) at least when B < 1. This is the case for > crit where crit = ( 27 2 = (2 + 18 2 ) if k = 2 2(2 k 1) 3 2 =k 2 if k > 2 (30) where erf 1 ( 1 2 ) 0 : 477. F or instance, crit is 1.01 and 17.3 for k = 2 and 3, resp ectiv ely . Th us, the algorithm presen ted here is simple enough to allo w an analytic b ound on its b eha vior for highly constrained problems, th us demonstrating its asymptotic eectiv eness in these cases. Other, more complex, structured quan tum algorithms ha v e only b een ev aluated empirically (Hogg, 1996, 1998a), whic h is limited to small problems. The algorithm's b eha vior with few er constrain ts, i.e., < crit , is not easily ev aluted analytically since the b ound pro vided b y B is no longer useful. Instead, the b eha vior can b e examined empirically using a classical sim ulation (Hogg & Y anik, 1998), whic h is ho w ev er limited to problems with a relativ ely small n um b er of v ariables. These empirical studies ma y ev en tually b e extendable to larger problems using appro ximate ev aluation tec hniques (Cerf & Ko onin, 1997). An example is giv en in Figure 3. This sho ws go o d p erformance for highly constrained problems, as exp ected from the b eha vior of the lo w er b ound. P erformance is also go o d with few constrain ts; not b ecause the algorithm is capturing the problem structure particularly w ell but rather b ecause there are man y solutions to w eakly constrained problems. As with other classical and quan tum searc h metho ds that use problem structure, the hardest cases are for problems with an in termediate n um b er of constrain ts (Hogg et al., 1996). F rom Figure 4 w e see that the nonzero asymptotic limit for the probabilit y of a solution app ears to con tin ue for somewhat few er constrain ts than exp ected from the v alue of crit . Belo w this v alue, the probabilit y for nding a solution app ears to decrease as a p o w er of n , indicated b y linear scaling on the log-log plot of Figure 4 for m = n 2 . Similar empirical ev aluations of the scaling with an in termediate n um b er of constrain ts where the hard problems are concen trated, e.g., m = 4 n for 3-SA T, sho ws linear scaling on a log- plot, indicating exp onen tial decrease in the probabilit y to nd a solution. Moreo v er, the resulting searc h costs in these cases are larger than those of other structured quan tum searc h algorithms (Hogg, 1996, 1998a). Th us the structure of these harder cases diers enough from the simple 1-SA T problems that this algorithm is not eectiv e for them. In summary , the algorithm solv es highly constrained problems with m = n 2 in O (1) steps for > crit , and p ossibly for somewhat smaller v alues of as w ell. As the n um b er of clauses is further reduced, the required n um b er of steps app ears to gro w p olynomially when > 0 and exp onen tially when m = O ( n ). 58 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers 1 5 10 50 100 m/n -4 10 -3 10 -2 10 -1 10 1 P Figure 3: Probabilit y to nd a solution for random 3-SA T for n = 10 (solid) and 20 (dashed) vs. m=n , on a log-log scale. Eac h p oin t is an a v erage o v er at least 100 problem instances, and includes error bars for the standard deviation in this estimate of the a v erge. The error bars are smaller than the size of the plotted p oin ts. The gra y lines sho w the corresp onding lo w er b ounds (1 B ) 2 . 5 10 15 20 n -3 10 -2 10 -1 10 1 p Figure 4: Probabilit y to nd a solution for random soluble 3-SA T vs. n with, from top to b ottom, m = 18 n 2 , 8 n 2 and n 2 , resp ectiv ely , on a log-log plot. F or eac h v alue of n , at least 100 problem instances w ere used. Error bars sho wing the exp ected error in the estimate are included but are smaller than the size of the plotted p oin ts. 7.2 Balanced Clauses In a similar w a y , the b eha vior of problems with balanced clauses can b e ev aluated, as sho wn in Figure 5. In this case the lo w er b ound is m uc h lo oser than for random soluble problems. 59 Hogg This is b ecause, unlik e the previous case, signican t errors are made in assigning c e for the large n um b er of assignmen ts with ab out n= 2 bad v alues. The b ound assumes that an y suc h mistak e giv es the maxim um p ossible con tribution to Eq. (27), but in fact b ecause of the limited phase c hoices in Eq. (13), some suc h mistak es will nev ertheless giv e the correct v alue of the phase. Again, the in termediate problems are the most dicult for this algorithm. 1 2 5 10 20 50 100 200 m/n -5 10 -4 10 -3 10 -2 10 -1 10 1 P Figure 5: Probabilit y to nd a solution for random balanced 3-SA T for n = 10 (solid) and 20 (dashed) vs. m=n , on a log-log scale. Eac h p oin t represen ts 100 problem instances and includes error bars whic h, in most cases, are smaller than the size of the plotted p oin ts. The gra y lines sho w the corresp onding lo w er b ounds (1 B ) 2 Because the b ound is so p o or, its asymptotic b eha vior do es not oer a useful guide to the b eha vior of the algorithm for highly constrained problems. Instead, the scaling for m = O ( n 2 ) is illustrated in Figure 6. The b eha vior is consisten t with a p olynomial decrease in the probabilit y to nd a solution, but denitiv e statemen ts cannot b e made from suc h small problem sizes. 8. Discussion The algorithm presen ted in this pap er pro vides an analytic demonstration that quan tum ma- c hines can signican tly exploit the structure of highly constrained k -SA T problems, thereb y extending the range of searc h problems that denitely ha v e eectiv e quan tum algorithms. This con trasts with previous w ork on structured quan tum algorithms that could only b e ev aluated empirically . In addition, for maximally constrained 2-SA T problems and man y maximally con- strained balanced k -SA T problems, the algorithm nds a solution with probabilit y one. Th us in these cases, failure to nd a solution denitely indicates the problem is not soluble, i.e., the searc h metho d is c omplete . As describ ed in Section 3.1, with the sligh t additional cost of ev aluating the n um b er of conicts in the complemen t of an assignmen t as w ell as the assignmen t itself for maximally constrained k -SA T, the correct corresp onding 1-SA T problem can b e determined. This additional information th us giv es a complete searc h algo- 60 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers 10 15 20 n -5 10 -4 10 -3 10 -2 10 -1 10 p Figure 6: Probabilit y to nd a solution for random balanced 3-SA T vs. n with, from top to b ottom, m = 8 n 2 and n 2 , resp ectiv ely , on a log-log plot. F or eac h v alue of n , 100 problem instances w ere used. Error bars sho wing the exp ected error in the estimate are included but are smaller than the size of the plotted p oin ts. rithm for maximally constrained k -SA T. This con trasts with previously prop osed quan tum algorithms that nd solutions with probabilit y less than one and hence cannot guaran tee no solutions exist. One direction for future w ork is generalizing this algorithm to other t yp es of com binato- rial searc h. F or instance, the algorithm is restricted to CSPs with t w o v alues p er v ariable, suc h as SA T. While other CSPs can b e recast as satisabilit y problems, this mapping ma y obscure structure inheren t in the original form ulation. Th us it w ould b e useful to nd algo- rithms that apply directly to more general CSP form ulations. One p ossible approac h w ould b e based on searc h metho ds that construct solutions incremen tally from smaller parts, i.e., expanding the set of states to include assignmen ts that giv e v alues to only some of the v ari- ables in the problem. Suc h a represen tation can apply readily to CSPs with an y n um b er of v alues for the v ariables (Hogg, 1996, 1998a). Another approac h w ould examine replac- ing W alsh transforms with the appro ximate F ourier transform (Kitaev, 1995) as has b een prop osed to extend an unstructured searc h metho d to cases where the size of the searc h space is not a p o w er of t w o (Bo y er et al., 1996). Bey ond CSPs, it w ould b e in teresting to in v estigate optimization problems. Searc h problems with an in termediate n um b er of constrain ts are the most dicult for classical heuristics as w ell as structure-based quan tum searc hes (Hogg, 1996, 1998a) based on analogies with these classical metho ds. F or k -SA T, these hard cases o ccur when the n um b er of clauses gro ws linearly with the n um b er of v ariables, whic h is m uc h smaller than the O ( n 2 ) used in Section 7. The in termediate n um b er of clauses creates considerable v ariance in the detailed structure of the searc h space from one problem instance to another. Th us one cannot rely on precise a priori kno wledge of the structure in designing the algorithm. Nev ertheless, the a v erage or t ypical structure of these harder searc h problems has b een 61 Hogg c haracterized (Cheeseman, Kanefsky , & T a ylor, 1991; Hogg et al., 1996; Hogg & Williams, 1994; Kirkpatric k & Selman, 1994; Monasson & Zecc hina, 1996; Williams & Hogg, 1994) and ma y b e suitable as a basis for dev eloping appropriate searc h metho ds. Instead of aiming for a single-step algorithm, the large v ariation in structure is lik ely to require a series of smaller c hanges to the amplitudes, along with rep eated tests of the consistency of all assignmen ts, as with previous prop osals (Gro v er, 1997b; Hogg, 1998a). Ho w ev er, since a quan tum algorithm can explore all searc h paths sim ultaneously , it can a v oid some of the v ariabilit y encoun tered in classical metho ds: namely , that due to random selection of initial states or random tie-breaking when ev aluating heuristics. Th us a quan tum algorithm can fo cus on v ariation due only to dierences in problem instances rather than also to the particular c hoices made in exploring a single searc h path. Ultimately , this observ ation ma y allo w quan tum algorithms to more usefully exploit impro v ed understanding of t ypical problem structure than is feasible for classical metho ds. This discussion raises the general issue of optimally using the information that can b e readily extracted from CSP searc h states, as commonly used in classical heuristics. Suc h information includes the n um b er of conicts a state has and ho w it compares with its neigh b ors. Additional information is a v ailable on partial assignmen ts, as used with incremen tal searc hes, but at the cost of in v olving a greatly expanded searc h space. The approac h describ ed in Section 5 suggests a useful tec hnique is matc hing quan tum algorithms to the a v erage structure of searc h problem ensem bles. The most signican t op en question is the exten t to whic h quan tum algorithms can solv e problems in p olynomial time that require exp onen tial time classically . F actoring pro- vides one example (Shor, 1994), if, as commonly b eliev ed, it cannot b e done in p olynomial time classically . By con trast, highly constrained searc hes can b e solv ed in p olynomial time b y b oth classical heuristics and, as sho wn in this pap er, quan tum mac hines. A t the other extreme, searc hes that ignore problem structure are exp onen tial, requiring O (2 n ) steps clas- sically , and O (2 n= 2 ) steps on quan tum computers (Bo y er et al., 1996). These observ ations can b e summarized as: cost scaling t yp e of problem classical quan tum unstructured exp onen tial exp onen tial factoring exp onen tial p olynomial highly constrained p olynomial p olynomial This comparison suggests some problems, including factoring, ha v e enough structure to al- lo w quan tum mac hines to op erate in p olynomial time but not enough for classical mac hines to do so. Iden tifying the class of suc h problems is an imp ortan t researc h direction for quan- tum computation. F or example, an in teresting op en question is whether there is a scaling regime for the n um b er of clauses, m , as a function of n where the probabilit y of nding a so- lution with a quan tum mac hine decreases only p olynomially with n while classical searc hes require an exp onen tial n um b er of steps, ev en with the b est kno wn heuristics. This question is dicult to treat empirically , p oin ting to the need for further analytic in v estigation of quan tum algorithms and the structure of searc h problems. 62 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers Ac kno wledgmen ts I ha v e b eneted from discussions with Ian Gen t, Carlos Mo c hon, W olf P olak and Eleanor Rieel. References Barenco, A., Deutsc h, D., & Ek ert, A. (1995). Conditional quan tum dynamics and logic gates. Physic al R eview L etters , 74 , 4083{4086. Benio, P . (1982). Quan tum mec hanical hamiltonian mo dels of T uring mac hines. J. Stat. Phys. , 29 , 515{546. Bennett, C. H., & Landauer, R. (1985). The fundamen tal ph ysical limits of computation. Scientic A meric an , July , 48{56. Bernstein, E., & V azirani, U. (1993). Quan tum complexit y theory . In Pr o c. 25th A CM Symp. on The ory of Computation , pp. 11{20. Berthiaume, A., Deutsc h, D., & Jozsa, R. (1994). The stabilization of quan tum compu- tations. In Pr o c. of the Workshop on Physics and Computation (PhysComp94) , pp. 60{62 Los Alamitos, CA. IEEE Press. Bou wmeester, D., et al. (1997). Exp erimen tal quan tum telep ortation. Natur e , 390 , 575{579. Bo y er, M., Brassard, G., Ho y er, P ., & T app, A. (1996). Tigh t b ounds on quan tum searc h- ing. In T ooli, T., et al. (Eds.), Pr o c. of the Workshop on Physics and Computation (PhysComp96) , pp. 36{43 Cam bridge, MA. New England Complex Systems Institute. Brassard, G., Ho y er, P ., & T app, A. (1998). Quan tum coun ting. Los Alamos preprin t quan t-ph/9805082. Cerf, N. J., & Ko onin, S. E. (1997). Mon te Carlo sim ulation of quan tum computation. In Pr o c. of IMA CS Conf. on Monte Carlo Metho ds . Los Alamos preprin t quan t- ph/9703050. Cerf, N. J., Gro v er, L. K., & Williams, C. P . (1998). Nested quan tum searc h and NP- complete problems. Los Alamos preprin t quan t-ph/9806078. Cern y , V. (1993). Quan tum computers and in tractable (NP-complete) computing problems. Physic al R eview A , 48 , 116{119. Cheeseman, P ., Kanefsky , B., & T a ylor, W. M. (1991). Where the really hard problems are. In Mylop oulos, J., & Reiter, R. (Eds.), Pr o c e e dings of IJCAI91 , pp. 331{337 San Mateo, CA. Morgan Kaufmann. Ch uang, I. L., V andersyp en, L. M. K., Zhou, X., Leung, D. W., & Llo yd, S. (1998). Ex- p erimen tal realization of a quan tum algorithm. Natur e , 393 , 143{146. Los Alamos preprin t quan t-ph/9801037. 63 Hogg Cirac, J. I., & Zoller, P . (1995). Quan tum computations with cold trapp ed ions. Physic al R eview L etters , 74 , 4091{4094. Cory , D. G., F ahm y , A. F., & Ha v el, T. F. (1996). Nuclear magnetic resonance sp ectroscop y: An exp erimen tally accessible paradigm for quan tum computing. In T ooli, T., et al. (Eds.), Pr o c. of the Workshop on Physics and Computation (PhysComp96) , pp. 87{91 Cam bridge, MA. New England Complex Systems Institute. Deutsc h, D. (1985). Quan tum theory , the Ch urc h-T uring principle and the univ ersal quan- tum computer. Pr o c. R. So c. L ondon A , 400 , 97{117. Deutsc h, D. (1989). Quan tum computational net w orks. Pr o c. R. So c. L ond. , A425 , 73{90. Dirac, P . A. M. (1958). The Principles of Quantum Me chanics (4th edition). Oxford. DiVincenzo, D. P . (1995). Quan tum computation. Scienc e , 270 , 255{261. F eynman, R. P . (1986). Quan tum mec hanical computers. F oundations of Physics , 16 , 507{531. F eynman, R. P . (1985). QED: The Str ange The ory of Light and Matter . Princeton Univ. Press, NJ. F eynman, R. P . (1996). F eynman L e ctur es on Computation . Addison-W esley , Reading, MA. Garey , M. R., & Johnson, D. S. (1979). Computers and Intr actability: A Guide to the The ory of NP-Completeness . W. H. F reeman, San F rancisco. Gen t, I. (1998). On the stupid algorithm for satisabilit y . T ec h. rep. APES-03-1998, Strath- clyde Univ ersit y . Av ailable at www.cs.strath.ac.uk/ ap es/ap erep orts.h tml. Gershenfeld, N., Ch uang, I., & Llo yd, S. (1996). Bulk quan tum computation. In T ooli, T., et al. (Eds.), Pr o c. of the Workshop on Physics and Computation (PhysComp96) , p. 134 Cam bridge, MA. New England Complex Systems Institute. Gro v er, L. K. (1997a). Quan tum computers can searc h arbitrarily large databases b y a single query . Los Alamos preprin t quan t-ph/9706005, Bell Labs. Gro v er, L. K. (1997b). Quan tum mec hanics helps in searc hing for a needle in a ha ystac k. Physic al R eview L etters , 78 , 325{328. Haro c he, S., & Raimond, J.-M. (1996). Quan tum computing: Dream or nigh tmare?. Physics T o day , 49 , 51{52. Hogg, T. (1996). Quan tum computing and phase transitions in com binatorial searc h. J. of A rticial Intel ligenc e R ese ar ch , 4 , 91{128. Av ailable at h ttp://www.jair.org/ab- stracts/hogg96a.h t ml. Hogg, T. (1998a). A framew ork for structured quan tum searc h. Physic a D , 120 , 102{116. Los Alamos preprin t quan t-ph/9701013. 64 Sol ving Highl y Constrained Sear ch Pr oblems with Quantum Computers Hogg, T. (1998b). Highly structured searc hes with quan tum computers. Phys- ic al R eview L etters , 80 , 2473{2476. Preprin t at publish.aps.org/eprin t/gate- w a y/eplist/aps1997o ct30 002. Hogg, T., Hub erman, B. A., & Williams, C. (1996). Phase transitions and the searc h problem. A rticial Intel ligenc e , 81 , 1{15. Hogg, T., & Williams, C. P . (1994). The hardest constrain t problems: A double phase transition. A rticial Intel ligenc e , 69 , 359{377. Hogg, T., & Y anik, M. (1998). Lo cal searc h metho ds for quan tum computers. Los Alamos preprin t quan t-ph/9802043, Xero x. Ho y er, P . (1997). Ecien t quan tum transforms. Los Alamos preprin t quan t-ph/9702028. Kirkpatric k, S., & Selman, B. (1994). Critical b eha vior in the satisabilit y of random b o olean expressions. Scienc e , 264 , 1297{1301. Kitaev, A. Y. (1995). Quan tum measuremen ts and the Ab elian stabilizer problem. Los Alamos preprin t quan t-ph/9511026. Knill, E., Laamme, R., & Zurek, W. H. (1998). Resilien t quan tum computation. Scienc e , 279 , 342{345. Landauer, R. (1994). Is quan tum mec hanically coheren t computation useful?. In F eng, D. H., & Hu, B.-L. (Eds.), Pr o c. of the Dr exel-4 Symp osium on Quantum Noninte gr a- bility Boston. In ternational Press. Llo yd, S. (1993). A p oten tially realizable quan tum computer. Scienc e , 261 , 1569{1571. Mac kw orth, A. (1992). Constrain t satisfaction. In Shapiro, S. (Ed.), Encyclop e dia of A rti- cial Intel ligenc e , pp. 285{293. Wiley , NY. Min ton, S., Johnston, M. D., Philips, A. B., & Laird, P . (1992). Minimizing conicts: A heuristic repair metho d for constrain t satisfaction and sc heduling problems. A rticial Intel ligenc e , 58 , 161{205. Monasson, R., & Zecc hina, R. (1996). The en trop y of the k-satisabilit y problem. Phys. R ev. L ett. , 76 , 3881{3885. Monro e, C., & Wineland, D. (1996). F uture of quan tum computing pro v es to b e debatable. Physics T o day , 49 , 107{108. Nijenh uis, A., & Wilf, H. S. (1978). Combinatorial A lgorithms for Computers and Calcula- tors (2nd edition). Academic Press, New Y ork. P almer, E. M. (1985). Gr aphic al Evolution: A n Intr o duction to the The ory of R andom Gr aphs . Wiley In terscience, NY. Selman, B., Lev esque, H., & Mitc hell, D. (1992). A new metho d for solving hard satisabilit y problems. In Pr o c. of the 10th Natl. Conf. on A rticial Intel ligenc e (AAAI92) , pp. 440{446 Menlo P ark, CA. AAAI Press. 65 Hogg Shor, P . (1995). Sc heme for reducing decoherence in quan tum computer memory . Physic al R eview A , 52 , 2493{2496. Shor, P . W. (1994). Algorithms for quan tum computation: Discrete logarithms and fac- toring. In Goldw asser, S. (Ed.), Pr o c. of the 35th Symp osium on F oundations of Computer Scienc e , pp. 124{134 Los Alamitos, CA. IEEE Press. Sleator, T., & W einfurter, H. (1995). Realizable univ ersal quan tum logic gates. Physic al R eview L etters , 74 , 4087{4090. T erhal, B. M., & Smolin, J. A. (1997). Single quan tum querying of a database. Los Alamos preprin t quan t-ph/9705041 v4, IBM. Unruh, W. G. (1995). Main taining coherence in quan tum computers. Physic al R eview A , 51 , 992{997. V an Gelder, A., & Tsuji, Y. K. (1993). Incomplete though ts ab out incomplete satisabilit y problems. In Pr o c. of 2nd DIMA CS Chal lenge . Williams, C. P ., & Hogg, T. (1994). Exploiting the deep structure of constrain t problems. A rticial Intel ligenc e , 70 , 73{117. 66
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment