Quantum Computer Algorithms: basics Michele Mosca Canada Research Chair in Quantum Computation SQUINT Summer School on Quantum Information Processing June 3
Overview A quantum computing model Basis changes Eigenvalue kick-back Some simple algorithms
A QUANTUM COMPUTING MODEL
Classical logic gates A gate is a function from m bits to n bits, for some fied numbers m and n AND NOT a b a b a a
Classical circuits We glue gates together to make circuits (or arras of gates ) which compute Boolean functions
Universal sets of logic gates A set B of gates is universal if, for an Boolean function F, there is a circuit composed of gates in B that computes F E.g. B = { NOT } is not universal E.g B = { AND } is not universal E.g. B = {NOT, AND, FANOUT } is universal
eample A circuit made from gates from set A = {,, }
Universal sets of logic gates If B is universal B = {,, } then e.g. = C C C
Universal sets of logic gates We can eactl simulate the circuit with gates from A with a circuit with gates from B C C C C
Making irreversible gates reversible Note that irreversible gates are reall just reversible gates where we hardwire some inputs and/or throw awa some outputs a a b b a b a b a b
Making irreversible circuits reversible a b c d Replace irreversible gates with their reversible counterparts a b c d
New gates and notation X X -gate or NOT-gate X controlled-not gate b b b b
A Classical Computing Model Acclic circuits of reversible gates
Eample phsical realization NOT (negligible coupling to the environment)
More logic gates (negligible coupling to the environment)
A classical computation
Aside: Is this realistic? We do have a theor of classical linear error correction. But before we worr about stabilizing this sstem, let s push forward its capabilities.
A quantum gate i NOT + i NOT +
A simple quantum circuit i + NOT NOT i
Linear Algebra notation NOT NOT i i i i i i =
Notation = = = = = = =
A quantum computation NOT i + NOT I i + CNOT i +
A quantum computation NOT I + i + i c NOT I i i i i
A Quantum Computing Model Acclic circuits of unitar gates (from a finite universal set ) and von Neumann measurements in the computational basis? = {,} a n
Universalit A set B of quantum gates is universal if, for an positive integer n, an unitar operator ( n U S U ) on n qubits and for an e >, there is a finite circuit in those gates that implements satisfing U ~ U ~ U < e where A = min?? = A?
In other words A set B of quantum gates is universal if, for an positive integer n, the gates of B acting on n qubits span a dense subset of S U ( n ). Wh not demand eact implementation of all operators? Eact universalit would require an infinite set of gates B and/or infinite sized circuits.
Some universal sets {C-NOT, all -qubit gates} {C-NOT, H, P} most -qubit gates are universal
BASIS CHANGES
Distinguishing orthogonal states Given a state {??, }? B =,?, K N?? = i j d i j we can in principle determine which state we have b performing a Von Neumann measurement with respect to the basis B
Distinguishing orthogonal states We can implement this measurement efficientl if we can efficientl implement the unitar transformation A? j = j? j A A t? j j
In general We can measure an state wrt the basis B in this wa j a j? j A A t? j j a j j j with probabilit a j
The Hadamard basis change H H H + + H
The Hadamard transformation: summar b H + ( ) b
The Hadamard transformation: circuit notation b b H + ( )
The Hadamard transformation on several bits H + ( ) H + ( ) H 3 + ( ) 3
The Hadamard transformation: global view H 3 H {, } 3 ( ) 8 3 H
The Hadamard transformation: global view 3 H H H {, } 3 ( ) 8 3
The Hadamard transformation: global view H H H 3 = {,} 3 ( ) 8 3
The Hadamard transformation on several bits + ( ) H + ( ) H 3 + ( ) H 3
The Hadamard transformation: global view H {, } 3 ( ) 3 H 3 H
The Hadamard transformation: global view {, } 3 ( ) 3 H H H 3
Looking at NOT and CNOT in Hadamard bases Consider appling a NOT (or X ) gate to the following states + X + X ( ) In other words: X = H Z H Z =
e.g. Now consider appling a controlled-not gate to the following states ( ) C N O T + ( + ) ( ) C N O T + ( + ) ( ) C N O T ( ) ( ) C N O T ( )
e.g. Now consider appling a controlled-not gate to the following states ( )( ) C N O T + + ( + )( + ) ( )( ) C N O T + ( )( + ) ( )( ) C N O T + ( )( ) ( )( ) C N O T ( + )( )
Eigenvalue kick-back
Computing functions into the phase Suppose we know how to compute a function f : {,} {,} c U f a c f ( ) ( ) ( ) a ( ) f ( )
Generalization: Eigenvalue kick-back Suppose we know how to compute an operator U? = Then the controlled-u gives us e if? c U? =? c U? = e if? ( ) (? e if )? c U + = +
How do we implement c-u? Replace ever gate G in the circuit for with a c-g. For eample, =
SOME SIMPLE ALGORITHMS
Deutsch s problem Compute ( ) f ( ) using U onl once f f H H f
Deutsch algorithm H f () H ( ) f () f () f = ) f ( ) f ( ( ) + ( ) )( ) f ( ) ( ) ) ( f ( ) f ( + ( ) )( )
Deutsch-Jozsa problem f : {,} n {,} Suppose promise that f is either constant or balanced. Decide if f is constant or balanced. with the Equivalentl, determine ( ) n f ( )
Deutsch-Jozsa problem H H H H {,} 3 ( ) 3 f ( ) + H H Probabilit of measuring f is ( ) i.e. we measure iff f is constant 3 f ( )
Bernstein-Vazirani problem Suppose f ( ) = a f : {,} n for some {,} a {, } is of the form n Given determine c U a f c f ( ) a = a a K a n
Bernstein-Vazirani problem H H H H H H a a a 3 f {,} 3 3 {,} 3 ( ) 3 a
Another propert of Hadamard transformation Consider n Z S + = + S s s S S Let Then = + S t t n t S S H ) ( { } S s t s Z t t S n = =, :
e.g. Consider }, { s S = s S + = + Then ( ) = + = + S t n t t n t s t n t n t t t S H ) ( ) ( ) (