Lecture : Introduction to Quantum Computing Rajat Mittal IIT Kanpur What is quantum computing? This course is about the theory of quantum computation, i.e., to do computation using quantum systems. These quantum systems follow the rules of quantum mechanics. Hence, the task is to encode computation in quantum mechanical systems. Before we explain the meaning of the previous paragraph, let us ask a more basic question. Exercise. What is computation? In a very informal way, computation is a calculation done by a physical device (computer) in an automated manner. The main idea is that instead of doing calculations on our own, we can use some physical device to do the calculations for us. The physical device (computer) is able to calculate because of the laws of nature. Because of the properties of current and voltages, we can implement AND, OR and NOT gates which provide the basic building blocks of a computer. The fundamental idea that any physical law/process can potentially be used to do computation led to the the origin of quantum computation. An example will help in understanding this deep idea. Suppose there is an insect named Multa which has rings on its body. The number of rings on a Multa depends on the number of rings on its parents. Specifically, if the mother has m rings and the father has n rings then the baby Multa has mn rings. We can use Multa to create a computer which can multiply. If we need to multiply m with n. Find two Multas with m and n rings. Whenever Multa mates with the other Multa, the offspring has the required number of rings. So just count the number of rings on the offspring. We are now ready to answer the question, Exercise. What is quantum computing? When computation is done using the principles of quantum mechanics, it is called quantum computing. In other words if the computation can be done on a physical device obeying quantum mechanical laws then it is called quantum computing. You might ask, everything in the world obeys quantum mechanics, then any computation is quantum computation? We know that classical and quantum laws are similar in large scale systems. It is only in the very small systems where peculiarities of quantum mechanics are visible. So it is understood that quantum computers are useful only when these peculiarities can be exploited to do computation. Why do we need quantum computing? Church Turing hypothesis is one of the most fundamental assertion in computability theory. It says that any function calculable by a machine can also be computed by a Turing machine. In other words, if a machine can run an algorithm to do a task then there exist another algorithm to do the same task on a Turing machine. Since anything which can be done on a quantum computer can be simulated on a classical computer, this hypothesis is not violated by a quantum computer. This means that anything we can do on a quantum computer can also be done/simulated by a classical computer. Then why do we need quantum computer? Succinctly, because quantum computers might be much faster.
The Church-Turing hypothesis was strengthened into Strong Church Turing hypothesis which states that any algorithm, which can be performed on any machine, can be efficiently simulated using a Turing machine. Strong Church-Turing hypothesis has worked for a long time. Still, this hypothesis might face challenges from different models of computation. In other words, it might be possible that some weird physical law might compute things much faster than a classical Turing machine. Since we believe that quantum mechanics is the theory of everything around us, it might make sense to have a quantum Turing machine instead of classical Turing machine. David Deutsch gave the concept of quantum Turing machine. We don t have any algorithm/task on a quantum computer which violates the Strong Church-Turing hypothesis, but there are examples where the quantum algorithm works much more efficiently than the best known classical algorithm. Quantum mechanics has strange properties of superposition and entanglement. Superposition basically says that a quantum system can not only have classical states, but it can also exist in a mixed state (superposition) of these classical states. Because of superposition, we get the property of entanglement. Informally, the state of two systems cannot be described as the product of the state of one system times the state of other system. It is natural to study these properties and their impact on computation. The first part of this course will cover the basics required to understand quantum computing. The next part will be focussed on introducing the model of quantum computation. We will finish by looking at algorithms which have shown that quantum computers can potentially be better than a classical computer. We will not be able to cover quantum information theory and quantum cryptography, which are deep and very interesting topics in itself. Though, this course will create the background to learn that material. Scientists have been trying to build quantum computer, to realize quantum computation on a physical device, using various techniques. We do not have a desktop quantum computer but there are quantum computers on few qubits and many protocols have been experimentally realized. We will not be covering these areas. Again, students are encouraged to learn more about these topics on their own. 3 Deutsch s algorithm To motivate quantum computing, we will give a very small example where quantum can perform better than a classical computer. To understand that example, we will introduce few basic concepts of quantum computing. Notice that they are introduced just so as to understand the algorithm. A much more rigorous study will be done in the course. 3. Qubits The fundamental unit of computation is a bit on a classical computer. A state which can be either in 0 or. The analog of a bit on a classical computer is called a qubit. This qubit can be in a state 0 or (corresponding to the classical states) or even in a superposition of these states. Specifically, the state of a qubit is ψ = α 0 + β. Exercise 3. Why do we have a mathematical equation for a qubit. Shouldn t it be described by a physical object? Where α, β are complex numbers such that α + β =. The symbol is used to represent a state. This particular form of the qubit is motivated from the postulates of quantum mechanics. We will see further justification of it in future. The states 0 and are called the basis states and the above equation states, any linear combination of the basis states with norm is a valid state. It is important to notice that we cannot look at the qubits and figure out α, β. We are only allowed to measure the qubit. If we measure in the basis states 0,, then with α probability we will get state 0 and otherwise. This provides more justification as to why the norm of a state should be.
Like in the case of classical computing, we use multiple qubits to store the data in a quantum computer. What are the possible states of two qubits? The basis states should be 00, 0, 0,. Here 0 0 is identified with 00 and similarly for other basis states. So any linear combination of these states with norm should be a valid state. Again, where i α i =. ψ = α 00 + α 0 + α 3 0 + α 4. 3. Operations We have defined the state of the quantum computer. The next step would be to see, what kind of operation can we perform on this computer? In other words, we are searching for the analog of NOT, AND, NAND, OR gate on a quantum computer. For simplicity, we will only talk about single qubit gates, gates which act on only one qubit. We can define the quantum NOT gate which takes 0 to and to 0. Exercise 4. Is this description sufficient? Since our state space is big, any linear combination of 0 and, we need to define the action on the complete state space. Using the postulates of quantum mechanics, this is done linearly. So for a quantum NOT gate, α 0 + β goes to α + β 0. Linearity implies that any quantum gate on a single qubit can be written as a matrix (if there are n qubits, then n n matrix). Since any state has unit norm, these matrices should be unitary. Note. This means that to specify a quantum gate, we only need to mention its action on the basis elements. Notice that there are infinite possible single qubit gates as compared with finitely many classical gates. Can we realize each of them on a quantum computer? It turns out that there are elementary gates which can be composed to perform any possible quantum gate approximately (even multiple qubit gates). Whether this can be done efficiently is a question of great interest. Another interesting single qubit gate is known as Hadamard gate. This is the gate which takes 0 to ( 0 + ) and to ( 0 ). Exercise 5. Check that the gate is unitary and write the matrix representation of this gate. Linearity in the circuit allows us to apply an operation/function on many inputs simultaneously. Notice that we said apply and not compute. These distinctions will be clear after the explanation, but you should be very careful in drawing conclusions from the next paragraph. Suppose there is a circuit which evaluates f(x) given x. A quantum gate is reversible and hence a gate which gives f(x) on x is not acceptable (Why?). One of the possible implementations is given in the diagram below. To compute the function value on a bit b, we set the control qubit to 0 and data qubit to b. What would happen if we feed the state ( 0 + ) 0 = ( 00 + 0 ) to such a gate. The output, by linearity, would be, ( 0, f(0) +, f() ). Note. This does not mean that we can get f(0) and f() simultaneously, because a measurement (the only way to observe a quantum system) will only yield one possible outcome. 3
Fig.. Quantum implementation of computing a function 3.3 The algorithm It might seem like quantum computing is of not much use, we can apply the function on multiple inputs but can only get the answer on one input. Next, we describe Deutsch s Algorithm, which shows how multiple applications can give interesting results not possible in a classical computer. Suppose there is a function from {0, } to {0, }. We want to know if f(0) = f() or not. This has to be done using minimum applications of function f. For the classical case, clearly we need two queries to the function f. Let us take the quantum implementation of the function discussed in the previous section. If we set the control qubit to ( 0 + ) and data qubit to ( 0 ). Let us denote data qubit by D and control by C and see what happens. The initial state can be written as, ( 0 D + D ) ( 0 C C ) = ( 0 D( 0 C C ) + D ( 0 C C )). After applying the function, ( 0 D( f(0) C f(0) C ) + D ( f() C f() C )). If f(0) = f() then the first qubit (data) will be in the state ( 0 + ) and otherwise ( 0 ). These states are the output of the Hadamard gate. So if we apply inverse of Hadamard gate (which is a Hadamard gate), in first qubit (register) we get 0 if f(0) = f() and otherwise. Hence by measuring the first register, we have solved the problem using just one query to the function. 4 Assignment Exercise 6. Read about randomized computing. Is it different from quantum computing? Exercise 7. Read about DNA computing. Exercise 8. Show that a unitary matrix preserves the norm. Exercise 9. Read about Solovay-Kitaev theorem. 4
References. M. A. Nielsen and I. L. Chuang. Quantum computation and quantum information. Cambridge, 00. 5