Finding Solutions to NP Problems: Philosophical Differences Between Quantum and Evolutionary Search Algorithms G. W. Greenwood Dept. of Electrical & Computer Engineering Portland State University Portland, OR 97207
[email protected]
Published in Proceedings CEC2001, 815-822, 2001 Abstract- This paper uses instances of SAT, 3SAT and TSP to describe how evolutionary search (running on a classical computer) differs from quantum search (running on a quantum computer) for solving NP problems.
1 Introduction The real challenge of combinatorial optimization is to create algorithms and techniques that can solve realistically sized problems within a reasonable amount of computational time. Most of these algorithms formulate a combinatorial problem as a search problem—i.e., the solutions to combinatorial problems reside in an abstract solution space and two solutions are neighbors if they differ by a single mutation of a problem parameter. Any algorithm that “solves” a combinatorial problem is therefore a search algorithm that explores the solution space landscape. Unfortunately, many real-world combinatorial problems require such huge computational resources that brute force search methods are useless; they simply take too much time to find the optimal answer. This has led researchers to use search heuristics that yield an acceptable compromise: a possibly lower quality answer but with a minimal search effort. Evolutionary Computation (EC) techniques are at the forefront of this work and impressive results have been achieved (e.g, see [1, 2]). Recently an entirely new approach has surfaced with potentially enormous consequences. This new approach is called quantum computing and it relies on the principles of quantum mechanics to evolve solutions. It is interesting to compare how a quantum search, running on a quantum computer, differs from an evolutionary search, running on a classical computer. However, the whole point of this comparison is not to advocate one method over the other—its purpose is to highlight the radically different philosophical approaches. (Besides, because no one has ever built a quantum computer, there is no way any direct comparison can be made at this time. It is up to the reader to decide which approach holds the most promise.) If nothing else, the reader should come away with an appreciation for the total re-orientation in thinking that quantum search will require. The paper is organized as follows. Section 2 provides an overview of evolutionary algorithms and quantum computing. Every attempt has been made to make the quantum computing portion a comprehensive tutorial that should be under-
standable by most computer scientists. Because the focus of this paper is on NP-complete and NP-hard problems, a formal definition of these problem classes is also provided. Section 3 describes how the two algorithm methodologies have been used to solve NP problems, which leads into a formal comparison in Section 4. Finally, Section 5 comments on the future of quantum computing.
2 Background 2.1 Evolutionary Algorithms All evolutionary algorithms (EAs) share the same basic organization: iterations of competitive selection and random variation. Although there are several varieties of EAs, they are all biologically inspired and generally follow the format depicted in Figure 1. initialize population
evaluate fitness
select survivors
randomly vary individuals
Figure 1: The canonical EA. The evaluation function for an individual returns a numeric value representing the quality of the solution described by that individual. This numeric value is often called the fitness of the individual while the evaluation function is called the fitness function. High fitness means the associated individual represents a good solution to the given problem. The selection process targets highly fit individuals for survival. The loop shown in Figure 1 continues until either a fixed number of generations are processed or an acceptable solution has been found.
2.2 Quantum Computing Almost twenty years ago Richard Feynman observed that classical computers could not simulate certain quantum mechanical effects such as entanglement [3]. This observation spawned interest in the field of quantum computing—i.e., computational machines that perform calculations by emulating quantum mechanic effects. Although no practical quantum computer has yet been built (and the likelihood of building one in the near future is bleak), the interest in this field is growing by leaps and bounds [4]. This section reviews some of the basic concepts of quantum mechanics that relate to quantum computing. Classical computer systems represent a single bit of information deterministically: the value is either a logic 0 or a logic 1. Quantum computer systems represent a single bit of information as a qubit, which is a unit vector in a complex Hilbert space . The ideas are commonly expressed using the bra/ket notation introduced by Dirac [5]. The ket symbol and the corresponding bra is denoted by . is denoted by The ket describes a quantum state and the corresponding bra is its complex conjugate. In computer science domains the ket (bra) can be thought of as a column (row) vector. That is, the orthonormal basis T T . Any comcan be expressed as plex linear combination of two kets is also a ket. The inner product of two vectors is denoted by . Note that since and are orthonormal, . denotes the outer product of the vectors. Any practical quantum computer manipulates a register of qubits. If each qubit has an orthonormal basis , then a qubit system has a basis expressed by the tensor . This gives basis vectors of product: the form
"
!
"
# $
&%'(&%*)))(
+-,
% %.)))#% % )))#% % . .. .
% %.)))#%
% / % the tensor product / ))) % / % /0 /denotes , ,2143 , which means a quantum register has the # 5 3 ) ) ) value /67+ 5 /598:+;3/ 8 8:+-,/ , . 3 A qubit need not exist in only one basis state. Indeed, a qubit can exist as a linear superposition of basis states < . More generally, the " qubit register can be prepared3 in a In general,
superposition of all possible classical states:
A B @ 143 B ? < DE (1) C5 B B B where the normalization condition F < G must hold. The complex number < is called the amplitude associated with the state DH .
The linear superposition of states is key to understanding how quantum computers operate. This linearity feature means that any operation on a superposition of states renders the superposition of that operation on each state individually [6]. There is no analogue in classical computer system for this principle and, as will be shown below, it is an important ingredient of the power behind quantum computing. However, superposition also permits the following rather bizarre situation. Consider the state This state cannot be expressed in terms of the individual qubit states. The proof is straightforward. Note that
I 3 J8K J
/ 8>L M % / N8OL J 3 3 '/ 3 / 8>/ 3 L 28PL 3 / 8>L 3 L Q 8R Clearly / L S , but this implies either / / or L L must 3 3 3
equal zero, which is not possible. States that cannot be described by individual qubit states are called entangled. There is considerable debate concerning the actual role entanglement plays in search operations. This issue will be discussed again in Section 3. The state of a qubit register is determined by a measurement. In quantum systems this measurement process projects the system state onto one of the basis states. Referring to with probaEq. (1), the measurement returns a value of bility . Any subsequent measurement returns the state with probability 1, which means the measurement process irreversibly alters the state of the system. Measurement also gives another perspective on entanglement: two qubits are entangled if and only if the measurement of one effects the state of the other. A quantum computer can perform the same function as a classical computer if that function is a one-to-one mapping from the domain to the range. In other words, must be a reversible function. Reversibility is usually mentioned in the context of performing computations without expending heat [7]. Here, however, reversibility must hold or will not be physically realizable on a quantum computer. Hogg [6] illustrates the importance of reversibility with a simple example. Suppose . Then for the superposition linearity forces
B
DE
<
DE
T
T
T
EU WT HU V UX U Y Z T 3 [ 3 V U U =\ 3 &8] J T U J^ Z 3 [ =\ T EU 3 MN8R T HU J . But this equals _ + U X ,
which violates the normalization condition. Quantum systems evolve from state to state according to Schr¨odinger’s equation [8]. Vector states can be expressed as a superposition of basis states each having an amplitude . This means evolution occurs by modification of the state amplitudes. Clearly, we would like to increase the amplitude of that state with the desired answer. Suppose we start in state . This system evolves over time under . Hence, a linear operator , i.e., and the normalization condition is satisfied iff is unitary. To see this, consider the inner product , which must equal one because state vectors are orthonormal.
B
`
/0^aF c` b / b d ` e Wd `
/0ef(Sdg /h F ` be / b
` e Ji ` d e
` e Rd ` yields d ` i d ` ` i d id ` . Hence, d This inner product equals one if d id Substituting
must be unitary. It is convenient to adopt a simplified notation when describing unitary operations that are applied to individual qubits. Some common unitary operators are
6 where is an identity operator, a negation operator, and
a phase shift operator. Suppose we have a 3 qubit register and we want to negate the first qubit and leave the other qubits unaltered. This transformation is denoted by . An extremely important transformation is the WalshHadamard transformation defined as
% %
I 3 N87 J I 3 J
"
When applied to , a superposition state is created. When applied to bits individually, a superposition of all states is created. Specifically,
+ ,
% % ) ))#% ))) Z + J N8' M % )))#% 8R MJ ,
After distributing the tensor product, this becomes
Z + ) )) N8 ))) 87 ) )) 8R ) )) J , A @ 143 Z 2 - , +, C5
It is important to emphasize the role superposition plays in quantum computing. Let be a unitary transformation corresponding to a classical function , i.e., , where represents bitwise exclusive-or. Notice that this transformation preserves the input—which must be done if is not invertible—thereby making unitary [9]. We can think of as the hardware of the quantum computer. When this operates on a superposition of states as in Eq. (1), the result is
PT J T
d
d
T
d
d B
A B @ 41 3 d < DE M C5
A B @ 41 3 C5 A B @ 143 C5 A B @ 143 C5
B
< d DH J B < DE :T DEJ B < DE T DEJ
T
Notice that is simultaneously applied to all basis vectors. Hence, a single application of computes all values of at once [10]. It is this quantum parallelism that is primarily responsible for the enormous interest in quantum computing. But something must be wrong. How can you extract an exponential amount of information out of a linear number of qubits? The answer lies with the amplitudes. If , then a measurement will produce any of the states with equal probability. Furthermore, once that measurement is taken, the system collapses into that measured state and all other information is lost. (You really can’t get something for nothing.) Nevertheless, you can exploit this parallelism using the property of quantum interference. Interference allows the exponential number of computations performed in parallel to either cancel or enhance each other. Feynman [8] beautifily describes how light waves can constructively or destructively interfere to produce this effect. The goal of any quantum algorithm is to have a similar phenomena occur—i.e., interference increases the amplitudes of computational results we desire and decreases the amplitudes of the remaining results. It is a unitary operator that would alter these amplitudes. Examples of this approach are presented in Section 3.
T # # T +$, R
d
+-,
B
<