Quantum Computing MAS 725 Hartmut Klauck NTU 13.2.2012 Organization Lectures: Mo. 10:00, TR+9 Lecturer: Hartmut Klauck Office: SPMS-MAS-05-44 Website: http://www.ntu.edu.sg/home/hklauck/QC12.html Grading Homework (biweekly): 40% Final exam: 60% Homework must be written individually! And handed in on time Required Background Linear algebra Some basic probability theory No background in physics required Textbook Nielsen/Chuang: Quantum Computation and Quantum Information (Cambridge) Recommended Reading http://homepages.cwi.nl/~rdewolf/qcnotes.pdf http://www.cs.berkeley.edu/~vazirani/s09quantum.html http://www.cs.uwaterloo.ca/~watrous/lecture-notes.html Quantum Mechanics Quantum mechanics is one of the basic theories of physics Quantum mechanics is concerned with states, and how they evolve/change Includes many “strange” effects that are different from “classical”, Newtonian mechanics: Superposition Entanglement Such effects usually appear in very small systems Quantum Mechanics and Computing Moore’s Law: The number of transistors that can be placed on a chip doubles every two years I.e., the computational power doubles This trend has been approximately true for more than 50 years Main way to achieve this is by making smaller transistors! Even today quantum mechanical effects are important to chip design Quantum Mechanics and Computing Another problem: heat generation in integrated circuits This heat is the result of erasing information Quantum computations are (for the most part) reversible Reversible computations (ideally) do not generate (much) heat Quantum Mechanics and Computing Chip designers nowadays mostly “combat” quantum effects Is it possible to make good use of quantum effects? Quantum Computing First suggested by Feynman and Benioff in the 1980’s Feynman’s observation: Simulating quantum systems on classical computers takes exponential time in the ‘size’ of the quantum system Conclusion: build universal quantum systems • Quantum systems that can simulate all other quantum systems (up to a size) I.e., quantum computers Quantum Computing Hence reasons for investigating quantum computing are: Making good use of quantum effects instead of trying to force microscopic system to adhere to classical physics There are quantum algorithms and protocols that achieve things that seem to be impossible for classical algorithms/protocols If the world is quantum mechanical, the ultimate limits of computation are determined by quantum physics Quantum Computing Examples Some example of tasks that quantum computers can do: Efficiently factor natural numbers Break public key cryptosystems like RSA Search an unordered database in sublinear time Provide cryptographic protocols that are secure without placing assumptions on the computational power of an eavesdropper Quantum Computing Models There are several models of quantum computing E.g. Deutsch (1985) defined Quantum Turing Machines as a universal model of quantum computation Another (easier to handle) model are quantum circuits But first we need to understand some basics about quantum mechanics Quantum Mechanics The double slit experiment for light Quantum Mechanics Perform the “same” experiment with electrons We observe the same outcome of the experiment Even when single electrons are emitted The wave-like behavior is not just statistical Quantum Mechanics The name “Quantum Mechanics” (coined by Planck) derives from the fact that certain quantities can change only by a discrete amount E.g. The smallest unit of electromagnetic radiation is a photon (a quantum of light) It is possible to emit and detect single photons Quantum Mechanics Quantum Mechanics Some History Development of quantum mechanics: Planck 1900, Schrödinger, Heisenberg, Bohr, Einstein..... 1930’s: von Neumann’s formalism 1935: Einstein, Podolsky, Rosen describe “entanglement” in an attempt to show that quantum mechanics is not a “complete” theory of reality (German “Verschränkung”) Today quantum mechanics is the best established theory in physics (Quantum) Computer Science 1936: Turing defines a “universal” machine (Church Turing Thesis) 1948: Shannon’s Information Theory 1965: Moore’s Law 1982: Feynman proposes quantum computers (to simulate quantum systems) 1982 Wiesner: first proposal of quantum cryptography published (after more than 10 years) (Quantum) Computer Science 1985: Deutsch finds the first quantum algorithm 1993: quantum teleportation 1994: Shor finds a quantum algorithm for factorization 1996: Grover’s algorithm finds a marked element in a database with n elements in time Since then the field is steadily growing… Quantum States Quantum mechanics is an abstract theory of states and transformations on states Can be derived from certain axioms Quantum states are vectors in a Hilbert space Hilbert Space: A real or complex vector space with an inner product that maps vectors to their length Must be complete We will only consider finite dimensional spaces Usually either Rn or Cn Bits A bit is either the value 0 or the value 1, stored in a register We will write the state of a bit as |0i, |1i Examples: A bit stored in the memory of a computer The path that a ball took in a giant double slit experiment Bits and Qubits We identify the states |0i, |1i with the basis vectors of a two dimensional space (say C2): (1,0) and (0,1) The states of a quantum bit (qubit) are arbitrary unit vectors in C2 Hence all the states of a qubit are: |0i + |1i with ||2 +||2=1 Qubits |0i, |1i are two basis vectors in C2 Qubits have states: |0i+ |1i with ||2 +||2=1 , are called amplitudes Qubit states are unit vectors under the euclidean norm Comparison to Probability Theory Suppose we have a random bit (say a coin flip) Then we need to specify the probability of 1 and 0 (coin may not be fair) For example 0 has probability p, 1 has probability 1-p ) probability distributions on bits are unit vectors under 1-Norm Qubits: , are complex numbers, possibly negative! The squares of the absolute values of the amplitudes form a probability distribution The Quantum Formalism Quantum states are vectors in a Hilbert space The Hilbert space corresponds to a register that can hold a quantum state Hilbert space here: Ck with the inner product h (vi) | (wi) i = i=1…k vi* wi x*: complex conjugate Dirac Notation h | “BRA” row vector | i “KET” column vector h|i inner product (product of a row and a column vector) |ÁihÃ| outer (matrix valued) product Many Qubits To hold k qubits we need a Hilbert space of dimension 2k I.e. 2k basis vectors (corresponding to the 2k values of k bits) First notation: |ii, i=1,...,2k. Unit vectors are of the form i i |ii; i=1....2k with i |i |2 = 1 Better notation: identify i=1...2k with x2{0,1}k Basis states are |xi, x2 {0,1}k Basis states correspond to classical values a register can hold General quantum states are linear combinations of the 2k classical (basis) states Also called “superpositions” Tensor Product For Hilbert spaces H, K, with dimensions dH and dK their tensor product HK is a Hilbert space of dimension dH¢dK Tensor product of vectors: (a1,..., al) (b1,...,br)= (a1b1,a1b2,...,a1br,a2 b1,......,albr) Example: |0i = (10)T; |1i= (01)T and |01i= |0i|1i = (0100)T A basis of HK: all |xi|yi =|xyi where |xi,|yi are basis vectors of H,K Not all vectors in HK are tensor products of vectors in H and K Example Basis of C4: |00i, |01i, |10i, |11i Another basis: (|00i + |11i) (|00i - |11i) (|01i + |10i) (|01i - |10i) (scaled by square root of 2) None of these are tensor products of vectors in C2 What can we do with one or more qubits? Quantum systems evolve according to the Schrödinger equation The result can be described as the application of a unitary transformation to the quantum state Additionally quantum states can be measured This leads to observable output Need some background from linear algebra… Linear Algebra Linear transformations: A(x+y)=Ax + Ay x,y: vectors in Ck, A: k£k matrix (complex entries) Over the reals a linear transformation O is orthogonal, if OOT=I Over the complex numbers a matrix U is unitary, if UUy =I U*: take the complex conjugate of all entries Uy = (U*)T Unitary transformation preserve the euclidean length of vectors Transformations in QM: unitary (i.e., reversible and length preserving) Examples On one qubit: classical transformations: identity, negation Hadamard Transformation: Applying Hadamard Applying Hadamard Applying Hadamard Unitary Transformations Define U |xi for all x2 {0,1}k ) U is defined. The U|xi need to be unit vectors and U|xi? U|yi for all xy Tensor product for matrices: A B= Unitary Transformations Hadamard Transformation x,z2{0,1}n and x¢z= xizi For any x we have Hn |xi= 1/2n/2 (|0i +(-1)x(1) |1i)(|0i +(-1)x(n) |1i) Applying many unitary transformations Later we will construct unitary transformations as the product of many “simple” unitary transformation First applying a unitary U, and then a unitary V is the same as applying the product VU. Note that the product of two unitary matrices is unitary Careful: matrix multiplication is not commutative! The exact sequence of multiplications matters Measurements Quantum states (unit vectors in Ck) can be changes by applying a unitary transformation Computations on quantum states consist of unitary transformations and measurements Measurements allow us to access the result of a computation What happens if we measure i i |ii ? The result will be i with probability |i|2 i |i2|=1 is very helpful now! After measuring the value i the state “collapses” to |ii Example Measuring the state Will result in the outcome 0 or 1, each with probability ½ If we measured 1, the resulting state after the measurement will be Overview Quantum states: unit vectors in a Hilbert space, the log of the dimension corresponds to the number of qubits States in a Hilbert space of dimension 2k correspond to superpositions of strings of length k and the space is a register of k qubits Evolution: by applying unity transformations Measurement: i |ii results in output i with probability |i|2, the state collapses to |ii if i is the measurement result