710 likes | 731 Views
Dive into the fascinating concept of quantum computation where multiple parallel worlds evolve to deliver an observable output, akin to a giant computer stealing cycles from the mind of God. Discover the implications and possibilities.
E N D
Great Theoretical Ideas In Computer Science Quantum Computation: Stealing Cycles From The Mind Of God Lecture 28 CS 15-251
What if . . . . Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
… we could spawn off exponentially many quantum worlds . . . Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…the evolution of each world being equivalent to one thread of a massive parallel computation . . . Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
… at the end of which the many quantum worlds coalesced back into our single world… Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
… in which the output of the computation was observable to us? Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
That would be like using the naturally parallel quantum evolution of the universe as one giant computer. Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
That would be like stealing computational cycles from the mind of God! Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Sounds like a Douglas Adams plot……. but some physicists interpret the potential of using quantum mechanics in computation in just that way! Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Quantum Mechanics • All of the strange things in quantum mechanics are captured by the two slit experiment. Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Two-Slit ExperimentThomas Young 1801 Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Watched Pot / Unwatched Pot Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Richard Feynman [1982] • Can a classical computer simulate a quantum process in a reasonable amount of time? If not, can we use the quantum universe to perform amazing computations that are currently not accessible to us? Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Electron is in either a 0 … ground state 1 … excited state Storing A Bit In An Atom Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Superposition of 0 and 1 states. State 0 with amplitude a; State 1 with amplitude b. a2 + b2 = 1 a,b complex Quantum Bit (Qubit): a|0> + b|1> Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Unobserved Qubit Electron is in a superposition of states. 0 with amplitude a and 1 with amplitude b. Observe The Qubit You see a 0 with probability a2 1 with probability b2 Electron is now just a classical bit: 0 or 1. The Qubit: a|0> + b|1> Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Superposition of 0 and 1 states. State 0 with amplitude a; State 1 with amplitude b. a2 + b2 = 1 a,b complex Quantum Bit (Qubit): a|0> + b|1> We now understand that a and b are the square roots of probabilities! Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Superposition of 0 and 1 states. State 0 with amplitude a; State 1 with amplitude b. a2 + b2 = 1 We will only need a,b real. Quantum Bit (Qubit): a|0> + b|1> (a,b) 1 Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Two Ways To Represent A Fair Coin: • 1/sqrt(2)|0> + 1/sqrt(2)|1> • 1/sqrt(2)|0> - 1/sqrt(2)|1> Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Possible Qubit Implementations • a|0> + b|1> • Polarizations of a photon • Nuclear spin in uniform magnetic field • State of electron orbiting single atom Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. n-qubit Register • n qubits side by side. Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Unobserved Register Superposition of all possible 2n n-bit strings. Each string s will have an amplitude as. S n-bit strings s (as)2 = 1 Observe Register You see the string s with probability (as)2 Register is now just the classical string s. n-Qubit Register Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Register R Superposition of all possible 2n n-bit strings. Each string s will have an amplitude as. S n-bit strings s (as)2 = 1 |R> will be a vector with 2n entries, one for each n-bit string. In position s, will be the number as Vector Representation Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
|s> is the vector representation of the string s, it is the vector with 1 in position s and 0 in all other positions. |R> will be a vector with 2n entries, one for each n-bit string. In position s, will be the number as |R> = Ss as|s> Vector Representation Example: The qubit |b> = a|0> + b|1> Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
x|R>= Ssxas|s> |R> + |T> = Ss (as + bs)|s> |R> = Ss as|s>|T> = Ss bs|s> Vector Math Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer Preview n-qubit register • Unobserved Register: Each time step, f takes the superposition to a new superposition. • Observe register at the end of computation to get string s with probability (amplitude of s)2 Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer Preview n-qubit register • Quantum Mechanics requires that f be a linear, unitary function from register superpositions to register superpositions. Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer Preview n-qubit register • The important thing about “unitary” is that f be reversible, in other words 1-1 and onto. Quantum computers can be run backwards. Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer Preview n-qubit register • LINEARITY: • f(a1|s1> + ….+ ai|si> + … + ak|sk>)= • a1|f(|s1>)> + ….+ ai|f(|si >)> + … + ak|f(|sk>)> Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer Preview n-qubit register • At each point in time the register is in a superposition: |R> = a1|s1> + ….+ ai|si> + … + ak|sk> where si is the ith n-bit string. Ss (as)2 = 1. • The next time step, the register will be in f(|R>), where f is a linear, unitary function. Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer Preview n-qubit register • This can be viewed as a vector processor on huge (2n entries) vectors. It is reminiscent of the vector view of generating functions. Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer Preview n-qubit register • You can think of 2n worlds, each with its own amplitude. One world for each register contents. Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Let’s back up and review things we understand fairly well… Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Classical Computers Review(Processor Assignment) • 2n possible states • One for each n-bit sequence Combinational Logic (AND, NOT) n-bit register One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Watched Pot Unwatched Pot State Evolution:Classical Computer BOIL BOIL Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Probabilistic Computers Review Combinational Logic (AND, NOT); Coin Flip Gates • 2n possible states • One for each n-bit sequence • produces 0 with prob ½ and 1 with prob ½ n-bit register $ One time step $ Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Watched Pot Unwatched Pot State Evolution:Probabilistic Computer 1 .5 .5 .25 .25 .25 .25 At time t, the machine is in a probability distribution on its 2n states. Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Probabilistic Computers Review Combinational Logic (AND, NOT); Coin Flip Gates • At any point in time, the machine is in a probability distribution on all n-bit strings. Observing the register at the end is like sampling a point from the final distribution on n-bit strings computed by the machine. n-bit register $ One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
X:= 0; X:= $; X:= $ Output X. A Silly Probabilistic Algorithm X=0 X=1 X=0 X=1 X=0 Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Quantum Computers • Instead of a distribution of 2nprobabilities, for each of the 2n possible strings in the register – we associate a superposition of 2namplitudes, for each of the 2n possible n-bit strings. Quantum Logic Gates n-qubit register One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Probability Distribution on X: Pr[X=0] = a Pr[X=1] = b a+b = 1 Superposition on X: Amplitude of X=0 is a Amplitude of X=1 is b a2 + b2 = 1 Probability Distribution Versus Superposition For A Bit X 0· a,b · 1 a,b real Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Quantum Computers • At any point in time, the machine will be in a superposition of all possible n-bit strings. When we observe the register, we will see string s with probability (amplitude of s)2. Quantum Logic Gates n-qubit register One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer n-qubit register • f is linear and reversible: • f(a1|s1> + ….+ ai|si> + … + ak|sk>)= • a1|f(|s1>)> + ….+ ai|f(|si >)> + … + ak|f(|sk>)> Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer n-qubit register • At each point in time the register is in a superposition: |R> = a1|s1> + ….+ ai|si> + … + ak|sk> where si is the ith n-bit string. Ss (as)2 = 1. • The next time step, the register will be in f(|R>), where f is a linear, unitary function. Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
…. Quantum Computer n-qubit register • There are only two quantum logic gates used in this talk: • The Quantum Coin Gate • The Toffoli Gate Quantum Logic Gates compute f One time step Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
The Quantum Coin Gate (Q$)Operates on a single qubit • Q$(|0>) = 1/sqrt(2) [|0> + |1>] • Q$(|1>) = 1/sqrt(2) [|0> - |1>] • By linearity constraint: • Q$(a|0> + b|1>) = • 1/sqrt(2) [ (a+b)|0> + (a-b)|1> ] Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
X:= 0; X:= Q$(X); X:= Q$(X) Output X. A Profound Quantum Algorithm X=0 X=1 X=0 X=1 X=0 ALWAYS OUTPUTS 0. Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
X:= 0; X:= Q$(X); X:= Q$(X) Output X. Q$(|0>) = 1/sqrt(2) [|0> +|1>] Q$(|1>) = 1/sqrt(2) [|0> - |1>] X=0 X=1 X=0 X=1 X=0 Each yellow arrow is a transition with amplitude 1/sqrt(2) ; The blue arrow is –1/sqrt(2). Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
Flip n quantum coins twice • Start with register |R> = |0000..0> • Flip one quantum coin per qubit • |R> = 1/sqrt(2n) S |s> • Flip each qubit again … • |R> = |00000..0> Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789
If c=1, T acts like a NAND gate. If a=1, c=0, then T outputs 1,b,b; This is a FANOUT gate for b. The Toffoli Gate Toffoli a a a b b c c XOR (a AND b) Steven Rudich: www.cs.cmu.edu/~rudich www.discretematch.com rudich0123456789