Chapter 6 Quantum Computation
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 6 Quantum Computation 6.1 Classical Circuits The concept of a quantum computer was introduced in Chapter 1. Here we will specify our model of quantum computation more precisely, and we will point out some basic properties of the model. But before we explain what a quantum computer does, perhaps we should say what a classical computer does. 6.1.1 Universal gates A classical (deterministic) computer evaluates a function: given n-bits of input it produces m-bits of output that are uniquely determined by the input; that is, it finds the value of f : 0, 1 n 0, 1 m, (6.1) { } →{ } for a particular specified n-bit argument. A function with an m-bit value is equivalent to m functions, each with a one-bit value, so we may just as well say that the basic task performed by a computer is the evaluation of f : 0, 1 n 0, 1 . (6.2) { } →{ } We can easily count the number of such functions. There are 2n possible inputs, and for each input there are two possible outputs. So there are n altogether 22 functions taking n bits to one bit. 1 2 CHAPTER 6. QUANTUM COMPUTATION The evaluation of any such function can be reduced to a sequence of elementary logical operations. Let us divide the possible values of the input x = x1x2x3 ...xn, (6.3) into one set of values for which f(x) = 1, and a complementary set for which f(x) = 0. For each x(a) such that f(x(a)) = 1, consider the function f (a) such that 1 x = x(a) f (a)(x)= (6.4) ( 0 otherwise Then f(x)= f (1)(x) f (2)(x) f (3)(x) ... (6.5) ∨ ∨ ∨ f is the logical OR ( ) of all the f (a)’s. In binary arithmetic the operation of two bits may be represented∨ ∨ x y = x + y x y; (6.6) ∨ − · it has the value 0 if x and y are both zero, and the value 1 otherwise. Now consider the evaluation of f (a). In the case where x(a) = 111 ... 1, we may write f (a)(x)= x x x ... x ; (6.7) 1 ∧ 2 ∧ 3 ∧ n it is the logical AND ( ) of all n bits. In binary arithmetic, the AND is the product ∧ x y = x y. (6.8) ∧ · For any other x(a), f (a) is again obtained as the AND of n bits, but where the NOT ( ) operation is first applied to each x such that x(a) = 0; for example ¬ i i f (a)(x)=( x ) x x ( x ) ... (6.9) ¬ 1 ∧ 2 ∧ 3 ∧ ¬ 4 ∧ if x(a) = 0110 ... (6.10) 6.1. CLASSICAL CIRCUITS 3 The NOT operation is represented in binary arithmetic as x = 1 x. (6.11) ¬ − We have now constructed the function f(x) from three elementary logi- cal connectives: NOT, AND, OR. The expression we obtained is called the “disjunctive normal form” of f(x). We have also implicitly used another operation, COPY, that takes one bit to two bits: COPY : x xx. (6.12) → We need the COPY operation because each f (a) in the disjunctive normal form expansion of f requires its own copy of x to act on. In fact, we can pare our set of elementary logical connectives to a smaller set. Let us define a NAND (“NOT AND”) operation by x y = (x y)=( x) ( y). (6.13) ↑ ¬ ∧ ¬ ∨ ¬ In binary arithmetic, the NAND operation is x y = 1 xy. (6.14) ↑ − If we can COPY, we can use NAND to perform NOT: x x = 1 x2 = 1 x = x. (6.15) ↑ − − ¬ (Alternatively, if we can prepare the constant y = 1, then x 1 = 1 x = x.) Also, ↑ − ¬ (x y) (x y)= (x y) = 1 (1 xy)= xy = x y, ↑ ↑ ↑ ¬ ↑ − − ∧ (6.16) and (x x) (y y)=( x) ( y) = 1 (1 x)(1 y) ↑ ↑ ↑ ¬ ↑ ¬ − − − = x + y xy = x y. (6.17) − ∨ So if we can COPY, NAND performs AND and OR as well. We conclude that the single logical connective NAND, together with COPY, suffices to evaluate any function f. (You can check that an alternative possible choice of the universal connective is NOR: x y = (x y)=( x) ( y).) (6.18) ↓ ¬ ∨ ¬ ∧ ¬ 4 CHAPTER 6. QUANTUM COMPUTATION If we are able to prepare a constant bit (x =0 or x = 1), we can reduce the number of elementary operations from two to one. The NAND/NOT gate (x,y) (1 x, 1 xy), (6.19) → − − computes NAND (if we ignore the first output bit) and performs copy (if we set the second input bit to y = 1, and we subsequently apply NOT to both output bits). We say, therefore, that NAND/NOT is a universal gate. If we have a supply of constant bits, and we can apply the NAND/NOT gates to any chosen pair of input bits, then we can perform a sequence of NAND/NOT gates to evaluate any function f : 0, 1 n 0, 1 for any { } → { } value of the input x = x1x2 ...xn. These considerations motivate the circuit model of computation. A com- puter has a few basic components that can perform elementary operations on bits or pairs of bits, such as COPY, NOT, AND, OR. It can also prepare a constant bit or input a variable bit. A computation is a finite sequence of such operations, a circuit, applied to a specified string of input bits.1 The result of the computation is the final value of all remaining bits, after all the elementary operations have been executed. It is a fundamental result in the theory of computation that just a few elementary gates suffice to evaluate any function of a finite input. This result means that with very simple hardware components, we can build up arbitrarily complex computations. So far, we have only considered a computation that acts on a particular fixed input, but we may also consider families of circuits that act on inputs of variable size. Circuit families provide a useful scheme for analyzing and classifying the complexity of computations, a scheme that will have a natural generalization when we turn to quantum computation. 6.1.2 Circuit complexity In the study of complexity, we will often be interested in functions with a one-bit output f : 0, 1 n 0, 1 . (6.20) { } →{ } 1The circuit is required to be acyclic, meaning that no directed closed loops are permitted. 6.1. CLASSICAL CIRCUITS 5 Such a function f may be said to encode a solution to a “decision problem” — the function examines the input and issues a YES or NO answer. Often, a question that would not be stated colloquially as a question with a YES/NO answer can be “repackaged” as a decision problem. For example, the function that defines the FACTORING problem is: 1 if integer x has a divisor less than y, f(x,y)= 0 otherwise; ( (6.21) knowing f(x,y) for all y<x is equivalent to knowing the least nontrivial factor of y. Another important example of a decision problem is the HAMIL- TONIAN path problem: let the input be an `-vertex graph, represented by an ` ` adjacency matrix ( a 1 in the ij entry means there is an edge linking vertices× i and j); the function is 1 if graph x has a Hamiltonian path, f(x)= (6.22) ( 0 otherwise. (A path is Hamiltonian if it visits each vertex exactly once.) We wish to gauge how hard a problem is by quantifying the resources needed to solve the problem. For a decision problem, a reasonable measure of hardness is the size of the smallest circuit that computes the corresponding function f : 0, 1 n 0, 1 . By size we mean the number of elementary gates or components{ } → that { we} must wire together to evaluate f. We may also be interested in how much time it takes to do the computation if many gates are permitted to execute in parallel. The depth of a circuit is the number of time steps required, assuming that gates acting on distinct bits can operate simultaneously (that is, the depth is the maximum length of a directed path from the input to the output of the circuit). The width of a circuit is the maximum number of gates that act in any one time step. We would like to divide the decision problems into two classes: easy and hard. But where should we draw the line? For this purpose, we consider infinite families of decision problems with variable input size; that is, where the number of bits of input can be any integer n. Then we can examine how the size of the circuit that solves the problem scales with n. If we use the scaling behavior of a circuit family to characterize the dif- ficulty of a problem, there is a subtlety. It would be cheating to hide the difficulty of the problem in the design of the circuit. Therefore, we should 6 CHAPTER 6. QUANTUM COMPUTATION restrict attention to circuit families that have acceptable “uniformity” prop- erties — it must be “easy” to build the circuit with n + 1 bits of input once we have constructed the circuit with an n-bit input. Associated with a family of functions fn (where fn has n-bit input) are circuits C that compute the functions.{ We} say that a circuit family C { n} { n} is “polynomial size” if the size of Cn grows with n no faster than a power of n, size (C ) poly (n), (6.23) n ≤ where poly denotes a polynomial. Then we define: P = decision problem solved by polynomial-size circuit families { } (P for “polynomial time”).