Quantum Computation: Lecture Notes

Citation preview

Lecture 2: Basics of Quantum Mechanics Scribed by: Vitaly Feldman Department of Mathematics, MIT September 9, 2003

In this lecture we will cover the basics of Quantum Mechanics which are required to under­ stand the process of quantum computation. To simplify the discussion we assume that all the Hilbert spaces mentioned below are finite­dimensional. The process of quantum computation can be abstracted via the following four postulates. Postulate 1. Associated to any isolated physical system is a complex vector space with inner product (that is, a Hilbert space) known as the state space of the system. The state of the system is completely described by a unit vector in this space. Qubits were the example of such system that we saw in the previous lecture. In its physical realization as a polarization of a photon we have two basis vectors: |�� and |↔� representing the vertical and the horizontal polarizations respectively. In this basis vector polarized at angle θ can be expressed as cos θ |↔� − sin θ |��. An important property of a quantum system is that multiplying a quantum state by a unit complex factor (eiθ ) yields the same complex state. Therefore eiθ |�� and |�� represent essentially the same state. Notation 1. State χ is denoted by |χ� (often called a ket) is a column vector, e.g., ⎛ ⎞ 1/2 √ ⎝ i 3/2 ⎠ 0 |χ�† = �χ| (often √ called a bra) denotes a conjugate transpose of |χ�. In the previous example we would get (1/2, −i 3/2, 0). It is easy to verify that �χ|χ� = 1 and �x|y� ≤ 1. Postulate 2. Evolution of a closed quantum system is described by a unitary transformation. If |ψ� is the state at time t, and |ψ � � is the state at time t� , then |ψ � � = U |ψ� for some unitary operator U which depends only on t and t� . Definition 1. A unitary operator is a linear operator that takes unit vectors to unit vectors. For every ψ, �ψ | U † U |ψ� = 1 and therefore U † U = I. Here by A† we denote the adjoint operator † of A, that is, the operator that satisfies (�x| A† ) = A |x� for every x. Definition 2. A Hermitian operator is an operator that satisfies A† = A.

1

P. Shor – 18.435/2.111 Quantum Computation – Lecture 2 Commonly used operators on qubits H described as follows. � � 0 1 σx = � 1 0 � 0 −i σy = � i 0 � 1 0 σz = 0� −1 � 1 1 1 √ H= 2 1 −1

2

are Pauli matrices I, σx , σy , σz and Hadamard transform

Maps: |0� → |1� ; |1� → |0� ;

|0�+|1� √ 2



Maps: |0� → i |1� ; |1� → −i |0� Maps: |0� → |0� ; |1� → − |1� Maps: |0� →

|0�+|1� √ ; 2

|1� →

|0�−|1� √ 2

Postulate 2 stems from Sr¨odinger equation for physical systems, namely i�

d |ψ� = H |ψ� dt

where H is a fixed Hermitian operator known as the Hamiltonian of a closed system. Postulate 3. Quantum measurements are described by a collection {Mm } of measurement opera­ tors. These are operators acting on a state space of the system being measured. The index m refers to the measurement outcomes that may occur in the experiment. If the state of the quantum system is |ψ� immediately before the measurement then the probability that result m occurs is given by p(m) = �ψ | Mm † Mm |ψ� , and the state of the system after the measurement is Mm |ψ� �

.

�ψ| Mm † Mm |ψ�

The measurement operators satisfy the completeness equation, � Mm † Mm = I . m

The completeness equation expresses the fact that probabilities sum to one: � � 1= p(m) = �ψ| Mm † Mm |ψ� . m

m

We will mostly see the following types of measurements. Suppose |v1 � , |v2 � , . . . , |vd � form an orthonormal basis. Then {Mi = |vi � �vi |} is a quantum measurement. From state |ψ� in this measurement we will obtain |vi � �vi |ψ� with probability |�vi |ψ�|2 . |�vi |ψ�| Definition 3. A projector is a Hermitian matrix with eigenvalues 0 and 1. The subspace with eigenvalue 1 is the subspace associated with this operator.

P. Shor – 18.435/2.111 Quantum Computation – Lecture 2

3

Suppose S1 , S2 , . . . , Sk are orthogonal subspaces that span the state space. Then {Pi } is a quantum measurement where Pi is the projector onto Si . We can write |ψ� = α1 |ψ1 � + α2 |ψ2 � + · · · + αk |ψk � , where |ψi � ∈ Si . Then this measurement takes |ψ� to |ψi � with probability |αi |2 . Postulate 4. The state space of a composite quantum system is the tensor product of the state spaces of the component physical systems. Moreover, if we have systems numbered 1 through n, and system number i is prepared in the state |ψi �, then the joint state of the total system is |ψ1 �⊗|ψ2 �⊗· · ·⊗|ψn �. Definition 4. Let S1 and S2 be Hilbert spaces with bases |e1 � , . . . , |ek � and |f1 � , . . . , |fl � respectively. Then a tensor product of S1 and S2 denoted S1 ⊗ S2 is a kl­dimensional space consisting of all the linear combinations of all the possible pairs of original bases elements, that is, of {|ei � ⊗ |fj �}i≤k,j≤l (|v� ⊗ |w� is often contracted to |v� |w� or |vw�). In a more concrete matrix representation the tensor product of two vectors is the Kronecker product of vectors. For example, ⎛



√1 2 − √12

� �



3 5 4 5



⎜ ⎜ =⎜ ⎝

3 √ 5 2 4 √ 5 2 −3 √ 5 2 −4 √ 5 2



⎟ ⎟ ⎟ ⎠

The tensor product satisfies the property that the product � � of two unit vectors is a unit vector. This is to verify as follows. Let |v1 � = ai |ei � and |v2 � = bj |fj � be two unit vectors. Then �

� �

|v1 � ⊗ |v2 � = ai |ei � ⊗ bj |fj � = ai bj |ei � |fj � . Therefore, ||v1 � ⊗ |v2 �|2 =



|ai bj |2 =



|ai |2



|bj |2 = ||v1 �|2 ||v2 �|2

Another important property of the tensor product space is that it contains vectors which are not tensor product themselves. For example, it can be easily verified that the vector 1 √ (|e1 � |f2 � − |e2 � |f1 �) 2 is not a tensor product itself. Such vectors are called “entangled”.

     

  

                                                                                                              " " "

 #$% #"% #%

 & & &

 #"% #"% #"%

!   ' ' (

   !       ! )       !                  %  !                         !           *(  +              !            *(                                           !    !  *(  !      !            ,                    !          !   

 







 





     

    * -  ) !          .             /  * -                          0                                  

























       

*        !             1            $  "    +                  23   24    3'        "



23   24 " $ " $ $ $ $ "



$ $ " "



$ " $ "

 

3' $ " " "

 



   )           24 3'  23   /          1   224   !        24                     23  !    24  3'  !   5    !    6    !       5        3  !      5        /                 !                   !         !                 !                         !           7                      2 )             ) $  8 $        "             8 $  $ * !                                               







 









 



























      

/                9            )                    9       !                                                    :!                                    7                       !    !                        ,                                . 6                 ;                                            











&



      

   (         )             >       23    ?    ?   /      ""          !      3             ! )     23        "             23   ,    24     >    $       ,      923=  ) " $   "  3       ! 1         * ! 0   @"AB?C           !    1              0  %          )  

  



 

/2-= /2-= /2-= /2-=

$$$$$$$$$$$$$$$$$$$$ 3= -= D=2E 3= -= D=2E $$$$$$$$$$$$$$$$$$$$



  

$$$$$$$$$$ $$$$$$$$$$ 3= -= 3= -=

                   >      1       ;              1           /2-= F 3= -= FD=2E  !   /2-=   $      /2-= 3= -=  $    % !           5                    



    

                           7   !    3 and the error probability decreases exponentially in the number of random inputs we pick.

5.1

Quantum algorithm

We can compute the answer with certainty using quantum computation. Input is of the form |0∈�n |1∈, and we assume that we have a black box quantum gate, B b on n + 1 bits satisfying Bb |x∈ |y ∈ = |x∈ |y ≥ f (x)∈ . where x is an n-bit binary number. In the following description, we make use of the Hadamard gate ⎞ ⎟ 1 1 1 . H=� 2 1 −1 Let |x∈ represent the tensor product of |0∈ and |1∈ vectors in the order of the binary representation of x and x · z be the dot product of bit representations of x and z. Note that H

�n

|x∈ =

n −1 2⎠

z=0

(−1)x·z |z ∈

We begin: Apply

H �(n+1)

:

1 2n/2 1

Apply Bb :

2n/2

n −1 2⎠

x=0

n −1 2⎠

Apply

≤ In+1 :

|0∈ − |1∈ � 2

|x∈ (−1)

f (x)





.

|0∈ − |1∈ � 2



.

⎞ ⎟ 2 −1 2 −1 1 ⎠ ⎠ |0∈ − |1∈ f (x)+x·z � (−1) |z∈ . 2n x=0 z=0 2 n

H �n

x=0

|x∈



n

Now measure all bits in the |0∈, |1∈ basis. There are two possibilities. Exchange the order of summations. • If f (x) is constant, the dot product for z = 0 is uniformly 0 so the summation over x with z = 0 n n produces vector is normalized, it must be (−1) f (0 ) |0∈�n (|0∈ − � a factor of 2 . Since the state |1∈)/ 2. Thus we will measure |0∈ �n for the first n bits with certainty if f is constant. • If f (x) is balanced, the x summation over |0∈ �n is negative on half the x and positive on the other half and so cancels out: there is no probability of measuring |0∈ �n .

Lecture 11: Applications of Grover’s Search Algorithm Scribed by: Yuan­Chung Cheng Department of Chemistry, MIT October 9, 2003

In this lecture we will cover several applications of Grover’s search algorithm, and show that Grover’s search algorithm is optimal. Grover’s search algorithm: ∃ function O such that O|x� = −|x� O|x� = |x�

if x ∈ T, otherwise.

We�want to find elements in the target set T. If there are N |x�’s and M targets, after N c· M iterations of G, most amplitude will be in the target set. The following operator G is performed in each iteration: G = H⊗n (2|0��0| − I)H⊗n · O, � and the initial state is prepared in √12n x |x�. In addition to perform the search of a target in a set of elements, the Grover’s search algorithm has other possible applications. Here we will demonstrate how to use Grover’s search algorithm to speed up classical algorithms, and do target counting.

Speed up classical algorithms NP problems are those for which a solution is easy to check, but not necessarily easy to find. Examples of NP problems are: � � n distances between them, we want Travel Salesman Problem (TSP): Having n cities and 2 to find a tour of the cities of length at most D. 3­SAT: Given a boolean formula of totally n variables in conjunctive normal form with at most 3 variables in each clause, ex. (x1 ∨ x3 ∨ x7 ) ∧ (x1 ∨ x¯5 ∨ x9 ) ∧ (x2 ∨ x¯3 ∨ x11 ) . . ., we want to know if there exist a set of {xi , i = 1 . . . n} such that the whole formula is satisfied.

1

P. Shor – 18.435/2.111 Quantum Computation – Lecture 11

2

Using the 3­SAT problem as an example, classically we have to search exhaustively and try every set of values, therefor the algorithm takes 2n time. Here we will show that the problem can be done using the Grover’s search algorithm in 2n/2 time. A better way to start is to find a maximal set of disjoint clauses in the formula. We can rename the variables and write the formula as (x1 ∨ x2 ∨ x3 ) ∧ (x4 ∨ x5 ∨ x6 ) ∧ . . . ∧ (xm−2 ∨ xm−1 ∨ xm ) ∧ . . . (xi ∨ xn−1 ∨ xn ), where 1 < m < n, and 1 < i < m. In this form, we have a disjoint clauses set (from x1 to xm ), and the rest of the formula are 2­SAT. Since we know polynomial time algorithm for 2­SAT problems, we can easily solve the left­over part. Notice that we need to try only 7 values for each clause,and there are at most n3 clauses. The time is 7n/3 ≈ 2.93n . If we apply Grover’s search algorithm, we can do with time in O(2.93n/2 ). This is almost close to the best classical algorithm O(2.43n ). This demonstrates that applying Grover’s algorithm to a relatively simple classical algorithm can gain substantial speed up (however, not exponential speed up). It is possible that the Grover’s algorithm and be used on best classical algorithm can gain speed up that can not be done classically.

Approximate counting: How many solutions are there? Grover’s algorithm can be combined with the quantum phase estimation algorithm to approximately count the number of targets in the set, i.e. the value of M . Classically, suppose you need to�sample

A values to get M ± εM . The expected number in target set is A· M N , standard deviation is The estimate of M , Mest , is the number of targets you found times N/A. Mest = =



M N.

N f ound A · number� N M AM ±N A A N� A N

= M ± NAM � � � N = M 1 ± AM Therefore, M (1 + ε) = M (1 ±



N AM ).

To get M within ±ε range, we need to sample A times,

N . M ε2

where A ≈ The efficient of the estimation is ∼ 1/ε2 . We can use Grover’s algorithm to improve the performance. Recall that in the Grover’s search algorithm, if we define � |α� = √N1−M |x� |β� =

√1 M

/ �x∈T |x�, x∈T

what Grover’s algorithm does in each iteration is � to rotate the state vector in the |α�, |β� basis θ counter­clockwise for θ angle, where 2 = arcsin( M N ). In the |α�, |β� basis, we can write the G operator as a rotation matrix (for N � M ): � � cos θ − sin θ . G = sin θ cos θ

P. Shor – 18.435/2.111 Quantum Computation – Lecture 11

3

Figure 1: Circuit for quantum counting. The eigenvalues of the matrix are e±iθ . Therefore, we can use phase estimation algorithm to obtain the phase factor θ, and compute the number of targets in the set. Figure 1. shows the circuit for approximate quantum counting to t qubits accuracy on a quantum computer. We now analyze the efficiency of the quantum counting algorithm. Suppose we get θ to t bits accuracy, i.e. θest = θ ± 21t . We need 2t calls to the function. By the definition of θ, we have M θ = . 2 N To estimate the error, we take the derivative on both side to obtain the relationship between the change of θ, δθ, and the change of M , δM : sin2

2 sin

θ θ δM cos · δθ = . N 2 2

Using N � M, and θ � 1, we obtain √ M θ cos ≤ 2δθ M N . N 2 � √ We define εM = δM ≈ 2δθ M N , so δθ = M · 2 . Therefore, in terms of ε, the number of calls

� N ε 2 needed to get to the accuracy of ε is ∼ M N · ε . This is the square­root of what we need in the classical algorithm. �

δM = 2N δθ

Grover’s search algorithm is optimal Suppose we have a new quantum algorithm that can find state |x�. We define Ox as the oracle of finding state |x�: � |x� → −|x� Ox = |y� → |y� if y �= x Let |ψ� be the starting state of the algorithm. One can write any algorithm of finding state |x� as

P. Shor – 18.435/2.111 Quantum Computation – Lecture 11



1 − ε|x� +



4

ε|g� ≈ Un Ox . . . U3 Ox U2 Ox U1 Ox |ψ�,

where |g� is composed of states ⊥ to |x�. For a successful algorithm, the outcome of the operations should be very close to the target state, that is, ε has to be very small. Let’s also define |ψkx � = Uk Ox Uk−1 Ox . . . U1 Ox |ψ�, |ψk � = Uk Uk−1 . . . U1 |ψ�. Notice that |ψkx � and |ψk � differ by the oracle operator Ox that separates the target state from other states. From this, we can define the Euclidean distance between these two states after k operations: Dk =



�|ψkx � − |ψk ��2 .

(1)

x

This distance can serve as a measurement of how much this algorithm can made to distinguish 2 |x� and |y� states. We will show that D√ k ≤ O(k ). To solve Grover’s problem, one needs at least Dleast ≈ O(N ). Therefore, at least k ∼ N is necessary, which is what Grover’s search algorithm does. Consider the Euclidean distance of the k + 1 states: � Dk+1 = �Uk+1 Ox |ψkx � − Uk+1 |ψk ��2 x � = �Ox |ψkx � − |ψk ��2 x � = �Ox (|ψkx � − |ψk �) + (Ox − I)|ψk ��2 , x

where we have applied the property that the unitary operator Uk+1 preserves the norm. Use the inequality �b + c�2 ≤� b �2 +2 � b � · � c � + � c �2 , we obtain �� � �Ox (|ψkx � − |ψk �)�2 + 2�Ox (|ψkx � − |ψk �)� · �(Ox − I)|ψk �� + �(Ox − I)|ψk ��2 x � � � �(Ox − I)|ψk ��2 2 · �|ψkx � − |ψk �� · �(Ox − I)|ψk �� + ≤ �|ψkx � − |ψk ��2 + x x x � ≤ Dk + 4 · �|ψkx � − |ψk �� · ��x|ψk � · |x�� + 4,

Dk+1 ≤

x

(2) where we have used the property that the unitary operator Ox preserves the norm and Ox − I = −2|x��x|. Now apply the Cauchy’s inequality, � �� � �|ψkx � − |ψk ��2 · ��x|ψk � · |x��2 , �|ψkx � − |ψk �� · ��x|ψk � · |x�� ≤ x

x

in Eq. (2), we obtain the recursion relation Dk+1 ≤ Dk + 4

� Dk + 4.

Assume Dk ≤ 4k 2 , we get Dk+1 ≤ (4k 2 + 8k + 4) = 4(k + 1)2 .

P. Shor – 18.435/2.111 Quantum Computation – Lecture 11

5

Hence we have shown that the best you can do to distinguish the target states and other states using j operations is Dj ≤ 4 · j 2 . Note that the least distance√you need to distinguish target states in totally N states is Dleast ≈ O(N ). Therefore, at least k ∼ N is necessary to solve the Grover’s problem. This shows that you can not do better than Grover’s algorithm.

18.435 Lecture 13 October 16th , 2003 Scribed by: Eric Fellheimer This lectured started with details about the homework 3: Typo in Nielsen and Chuang: If you pick random x such that gcd(x, N) = 1, x < N and N is the product of m distinct primes raised to positive integral powers, and r is the order of 1 x mod N, then the probability that r is even and x r / 2 ≠ −1mod N ≥ 1 − m−1 . The book 2 erroneously has the power of 2 as m opposed to m -1.

In exercise 5.20 : The book states at the bottom of the problem that a certain sum has N value when l is a multiple of N/r. The answer should actually be N/r when l is a R multiple of N/r. Also, there will be a test on Thursday, October 23rd -Open books -Open notes -in class -covers through Grover’s algorithm, teleportation, and superdense coding

From last lecture: We know that quantum circuits can simulate Quantum Turing Machines (QTM) with polynomial overhead. Now we will look in the reverse direction: implementing a Turing machine to simulate a quantum circuit. We will need to show that we can approximate any gate with a finite set of gates. Thm: CNOT gates and one-qubit gates are universal for quantum computation

Proof: α β  γ δ    We already know gates of the form  1    1  α β  sufficient, where   is a unitary matrix. γ δ  We know use the fact that: β 1  α   1   1      1 γ δ    1  1 

β α  1  γ δ  

     1

β α   1   are   1   δ γ

β 1  α  1    1   =     1  1     1  γ δ 

This reduces the proof to only finding the first 2 of the 3 matrices above. The first 2, however, can be considered single-qubit operations. So if we can construct arbitrary single qubit operations, our proof is complete. We now look at forming controlled T2 gates with

eiΦ1 T=  

e

−i Φ1

  or T = 

cos(θ ) − sin( θ )  sin( θ ) cos(θ )   

We now know: eiΦ1  cos(θ ) − sin( θ ) e iΦ 2      e −iΦ1   sin( θ ) cos(θ )   e −iΦ 2   give arbitrary determinant 1, unitary 2X2 matrices. Thus, our proof is complete.

We know suppose Alice and Bob share stat (1/2) (|0000> + |0101> + |1011> + |1110>) where Alice owns the first 2 qubits. They can use this state to teleport Alice’s 2 qubits to Bob. To do this, Alice must send Bob 4 classical bits.

Quantum linear optics as a means for computation -

suppose you have a probabilistic method of applying CNOT gates and you know when it has worked you can measure in the Bell basis you can de single qubit operations

We argue that this strange set of requirements actually allows universal computation We want σ 1' ⊗ σ 2' CNOT

σ 1−1 ⊗ σ 1−2 a, b = CNOT a, b

We now want to know that for each a,b {X, Y, Z, I} there exists a’, b’ such that σ a' ⊗ σ b' CNOT σ a ⊗ σ b = CNOT Knowing that the Pauli matrices are self inverses, we get: σ a ' ⊗ σ b' = CNOT σ a ⊗ σ b CNOT CNOT σ x (1) CNOT = σ x (1) ⊗ σ x (2) CNOT σ x ( 2) CNOT = σ x ( 2) CNOT σ z (1) CNOT = σ z (1) Thus, we have: CNOT σ y (1) CNOT = − i CNOT σ z (1)σ x (1) CNOT CNOT σ y (1) CNOT = − i CNOT σ z (1) CNOT CNOT σ x (1) CNOT CNOT σ y (1) CNOT = − i σ z (1) σ x (1) σ x ( 2) CNOT σ y (1) CNOT = σ y (1) σ x ( 2)

We have shown that we can teleport through controlled not gates to use quantum linear optics as a means of quantum computation.

Adiabatic Quantum Computation Physical systems have Hamiltonians H such that Ψ system.

H

Ψ = E is the energy of the

H is a Hermitian operator. The wave function satisfies the Schrödinger Equation: ih

d Ψ =H Ψ dt

Thm: If you change the Hamiltonian sufficiently slowly, and start in the ground state, you remain in the ground state. Here, “sufficiently slow” means T is proportional to 1/|g|^2, where g is the gap between first and second energy eigenvalues.

If we start in state Hinit and end in Hfinal, Hinit / Hfinal are sums of Hamiltonians involving no more than a few qubits. Finally, there is a theorem which states that using this setup can be equated to using quantum circuits.

Lecture 14: Cluster States

Scribed by: Ilia Mirkin Department of Mathematics, MIT October 21, 2003 A cluster state is a highly entangled rectangular array of qubits. We measure qubits one at a time. The wiring diagram tells us which basis to measure each qubit in, and which order to measure them in. A wiring diagram is represented by connecting up the dots (which represent qubits) with lines. A junction of two separate lines represents a gate. These gates do not have to be unitary, but if done right, are. p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

Figure 1: Unconnected cluster states p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

p

Figure 2: Wiring diagram for two gates Measurement on a wiring diagram is done by first measuring all the qubits that are not in the wiring diagram (i.e. unconnected) in the σz basis. Once those qubits are measured, we measure the qubits in the circuit from left to right in the specified basis. 1

P. Shor – 18.435/2.111 Quantum Computation – Lecture 14

2

Cluster state given by eigenvalue equations. The neighborhood of a qubit are the up, down, left, and right qubits. K (a) = σx(a) ⊗



σz(b) |b ∈ neighborhood(a)

(1)

b

The claim is that K (a) commutes with K (b) when a �= b. To show that this is true, we can look at the following cases: neighborhood(a) ∩ neighborhood(b) = ∅

(2)

When this is true, then there is absolutely no overlap between K (a) and K (b) and thus the two commute. neighborhood(a) �� b

(3)

This means that neighborhoods overlap, but that the qubit b is not in the neighborhood of a in an arrangement such as p

ap u p

ap l ap p

p

ap r bp

ap d p

p

Figure 3: Neighborhoods overlap

K (a) = σx(a) ⊗ σz(ar ) ⊗ · · · K (b) = σx(b) ⊗ σz(ar ) ⊗ · · · K (a) K (b) = σx(a) ⊗ σz(ar ) ⊗ · · · ⊗ σx(b) ⊗ σz(ar ) ⊗ · · · And in the third case, a and b are adjacent to each other. p

ap u p

ap l ap p

bp

ap d p

p

bp r p

Figure 4: a and b are adjacent

(4) (5) (6)

P. Shor – 18.435/2.111 Quantum Computation – Lecture 14

3

K (a) K (b) = σx(a) ⊗ σz(b) ⊗ · · · ⊗ σx(a) σz(b) · ··

(7)

In all three cases K (a) and K (b) both commute, so the claim holds. This means that K (a) are all simultaneously diagonalizable. Any simultaneous eigenvector of K (a) , a ∈ C (cluster) is a cluster state. Each K (a) has eigenvalue ±1, making for 2n vectors of eigenvalues {Ka }�. � � � �φ{κa } is a cluster state with eigenvalue κa on qubit a, {κa } = {±1}. Thus φ{κa } |φ � = {κa } C C



0 if {κ a } = � {κa }. For example,

κb = +1 κ = −1 � � � � �a �

φ{κa } |φ{κ�a } = − φ{κa } |Kb |φ{κ�a } = − φ{κa } |φ{κ�a } =0 C



If {κa } = {κa } except for κb = −κb , then

(b) σz

(10)

C

C



(8) (9)

� �

� �

� φ{κa } = �� φ � {κa } C

C

� � � �

Ka σz(b) � φ{κa } C = (−1)δab σz(b) Ka �φ{κa } C � � = (−1)δab σz(b) κa �φ{κa } C � �

� = κa σz(b) �φ{κa } C Cluster state for ∀a κa = 1, start in state |ψ�C = then apply Sab to all neighbors a, b.



a

|+�a , where |+� =

(11)

(12) (13) √1 (|0� + |1�). 2



Sab

⎞ 1 0 0 0

⎜ 0 1 0 0 ⎟ ⎟ = ⎜ ⎝ 0 0 1 0 ⎠

0 0 0 −1





1 =

I + σz(a) + σz(b) − σz(a) ⊗ σz(b) 2

We

Here are a few examples of gates that can be made using wiring diagrams: Transmission Line CNOT Gate σ p p p p x p p σp x σp x σp x σp x σp x p σy p Hadamard p p p σp x σp y σp y σp y σp x σp x σ σ σ p

p

p

p

y

p

σp x σp x σp y p σx p

y

p

p

y

Rotation σp x σp x ±θ σp x σp x p

Figure 5: CNOT Gate, Transmission Line, Hadamard, Rotation

(14)

(15)

P. Shor – 18.435/2.111 Quantum Computation – Lecture 14

4

|ψ� p |+� p |+� p Sab

Figure 6: Transmission line We also know that Sab commutes with Sa� b� . In the |0�, |1� basis, Sab� can be represented by a diagonal matrix, which means that they have to commute. K (a) a,b Sab |+�⊗n is an eigenvector of K (a) . Demonstration of a transmission line effect: 1 Sab |+� |+� = Sab (|00� + |01� + |10� + |11�) 2 1 = (|00� + |01� + |10� − |11�) 2 1 = √ (|+� |0� + |−� |1�) 2

(16) (17) (18)

With this, we apply Sab and measure both a and b in the |+�, |−� basis. This is equivalent to measuring in the �++| Sab , �+−| Sab , �−+| Sab , �−−| Sab basis, which is also equivalent to measuring in the √12 (�0+| + �1−|) basis. In this way we get the teleportation effect on the original |ψ�.

Lecture 16: Quantum Error Correction Scribed by: Dah-Yoh Lim October 30, 2003

1

Introduction

Today we are going to look at how one can do error correction in the quantum world. In the PreShannon days, simple repetition codes were used: to transmit bit 0, it is first encoded into a string of zeros, say 0000. Similarly, 1 gets encoded into 1111. One can prove that if you want to reduce the error rate to 1/n, and the channel flips bits with probability 1/�, then you need roughly log n log(1/�) repetitions.

2

Quantum Analog to Repetition Code

The analog to the repetition code is to say encode |0� as |000� and |1� as |111�. Note that this is not the same as copying/cloning the bit, since in the quantum world we know that cloning is not possible. So for instance, under this encoding E the EPR state √12 (|0� + |1�) would be encoded as √1 (|000� 2

2.1

+ |111�).

Bit Errors

Suppose there is a bit error σX at the third qubit. (3)

(3)

(3)

(3)

σX E(|0�) = σX (|000�) = |001�. Similarly, σX E(|1�) = σX (|111�) = |110�. To correct bit errors, simply project onto the subspaces {|000�, |111�}, {|001�, |110�}, {|010�, |100�}, {|100�, |011�}.

2.2

Phase Errors

Suppose there is a phase error σZ . 1 1 (j) (j) 1 σZ E( √ (|0� + |1�)) = σZ √ (|000� + |111�) = E( √ (|0� − |1�)), 2 2 2 for j = 1, 2, 3. Therefore, if we use this code, single bit errors can be corrected but phase errors will be come 3 times more likely! 1

P. Shor – 18.435/2.111 Quantum Computation – Lecture 16 Recall that 1 H≡√ 2



1

1

1 −1



2

.

This takes bit errors to phase errors. If we apply H to the 3-qubit protection code, we get: 1 1 √ (|0� + |1�) → √ (|000� + ... + |111�), 2 2 2 and

1 1 √ (|0� − |1�) → √ (|000� − |001� + ... − |111�), 2 2 2

with a negative sign iff the string contains an odd number of 1s. Now consider the following 3-qubit phase error correcting code: 1 |0� → (|000� + |011� + |101� + |110�), 2 and

1 |1� → (|011� + |100� + |010� + |001� ). 2 Now if there is a phase error on the first qubit:

(1)

(1)

σZ (|000� + |011� + |101� + |110�) 2 1 = (|000� + |011� − |101� − |110�). 2

σZ E(|0�) =

(i)

(i)

Next, note that σZ E(|0�) and σZ E(|1�) are orthogonal, for i = 1, 2, 3. Therefore, to correct (i) (i) phase errors we can project onto the four subspaces {σZ E(|0�), σZ E(|1�)} and {E(|0�), E(|1�)}. Now we have a code that corrects phase error but not bit errors.

2.3

Bit and Phase Errors

If we concatenate the codes that corrected bit and phase errors respectively, then we can get a code that corrects both errors. Consider: 1 E(|0�) = (|000000000� + |000111111� + |111000111� + |111111000�) 2 1 E(|1�) = (|111111111� + |111000000� + |000111000� + |000000111�). 2 It is easy to see that this corrects bit errors. Note that the error correcting procedure does not collapse the superposition, so it can be applied to superpositions as well. There is a continuum of � � α β that one can apply to the 1st qubit. γ δ � � � � −iθ 1 0 0

e ≡ Rθ .

In general, phase errors can be expressed as = eiθ 0 e2iθ 0 eiθ

P. Shor – 18.435/2.111 Quantum Computation – Lecture 16

3

1 Rθ ( (|000� + |011� + |101� + |110�)) 2 1 = (e−iθ |000� + e−iθ |011� + eiθ |101� + eiθ |110�) 2 1 −eiθ + e−iθ 1 eiθ + e−iθ (|000� + |011� + |101� + |110�) + (|000� + |011� − |101� − |110�) = 2 2 2 2 (1) = cos θE(|0�) − i sin θσZ E(|0�), i.e. phase error on the 1st qubit. With our 9-qubit code, let’s say we apply �

α β γ

δ



=



α β γ

δ



to some qubit. Since

α+δ α−δ β+γ β−γ I+ σZ + σY , σX + i 2 2 2 2

we can separate its operation on ηE |0� + µE |1� as follows: � � α β

(ηE |0� + µE | 1�)

γ δ α−δ α+δ (ηE|0� + µE |1�) + σZ (ηE |0� + µE |1�) = 2 2 β+γ β−γ + σX (ηE |0� + µE |1�) + i σY (ηE |0� + µE |1�). 2 2 However, we know that projection onto |φ� is equivalent to applying the projection matrix |φ��φ|; therefore, we see that the code corrects phase errors too.

3

7 bit Hamming Code

The Hamming code encodes 4 bits into 7 bits. The 24 codewords are: S0 S1 0000000 1111111 1110100 1011000 0111010 0101100 0011101 0010110 1001110 0001011 0100111 1000101 1010011 1100010 1101001 0110001 Recall that a linear code is a code where the sum of two codewords (mod 2) is another codeword. The Hamming code is a⎤ linear code, i.e. one can chose 4 basis elements generated by GC = ⎡ 1 1 1 1 1 1 1

⎢ 1 1 1 0 1 0 0 ⎥ ⎢ ⎥ ⎣ 0 1 1 1 0 1 0 ⎦, where the rowspace of this matrix gives all the codewords. The parity 0 0 1 1 1 0 1

P. Shor – 18.435/2.111 Quantum Computation – Lecture 16

4



⎤ 1 1 1 0 1 0 0 check matrix is HC = ⎣ 0 1 1 1 0 1 0 ⎦, which is exactly the generator matrix for the dual 0 0 1 1 1 0 1 code (the set of vectors orthogonal to every vector in the code C).

3.1

Quantum Hamming Code

The quantum analog of the Hamming Code is as follows: |0� →

1

Σ |v � ;

|1� →

23/2 v∈HC

1

Σ |v + e�,

23/2 v∈HC

where e is the string of all 1s. Note that this corrects σX on any qubit (because of the properties of the Hamming code). Also, if we apply the Hadamard transformation to the quantum Hamming code, we can correct phase errors as well:

H ⊗7 E|0� =

1

Σ H ⊗7 |v �

23/2 v∈HC 1

1

27 −1

Σ Σ (−1)x·v |x� 23/2 27/2 x=0 v∈HC 1 = 7/2 23 Σ |x� x∈GC 2 1 = √ (E |0� + E |1�). 2 1 ⊗7 H E|1� = 3/2 Σ H ⊗7 |v + e� 2 v∈HC 1 1 27 −1 = 3/2 7/2 Σ Σ (−1)x·(v+e) |x� 2 2 x=0 v∈HC 1 = 7/2 23 Σ (−1)x·e |x� x∈GC 2 1 = √ (E |0� − E |1�) 2 = EH |1�. =

So, the σX and σZ errors are “independent”, and therefore this code can correct σX error in any qubit and σZ error in any other qubit.

Lecture 19: How to Build Your Own Quantum Computer Guest Lecturer: Isaac Chuang Scribed by: Fen Zhao Department of Mathematics, MIT November 13, 2003

1

The DiVicenzo Criteria

The DiVicenzo Criteria list four things required for quantum computing: robust qubits, a universal gate set, a fiducial input state, and projective measurements.

1.1

Robust Qubits

A quantum qubit is based on 2 level quantum systems. One must also remember that a tensor product Hilbert space is needed; for example a harmonic oscillator is not a tensor product space and therefore makes a bad quantum computer. In general, a two level atom would make a good quantum computer. One must also have a long coherence time. This is characterizes how the environment interacts with your ideal qubit system. The imperfect qubit system will have many states besides the two you are interested in. One can think of decoherence as the effects of all the interactions outside your idea set of interactions. |Ψ(t)� = e−iHt |Ψ(0)�

⎡ a b g ... ⎢c d h ⎢ H = ⎢ e f i ⎣

.. .. . .

⎤ ⎥ ⎥ ⎥ ⎦

In the Hamiltonian above, the elements in bold represent the your ideal set of interactions, and everything else is the non­ideal part that causes decoherence. There are many sources of decoherence. Gravity causes decoherence if one states weights more thant the other. There may be stray long range fields, typically associated with charge. There can be leakage into larger Hilbert spaces; a two state atom may have higher energy levels that the state can move to. However, there does exists true finite spaces in nature, such as spin. There are two measurements of decoherence, T1 and T2 . T1 is called the “longitudinal coherence time,” or the “spin lattice time,” or the “spontaneous emission time,” or the“amplitude damping.” It measures the loss of energy from the system. One can do an experiment to determine T1 . First 1

P. Shor – 18.435/2.111 Quantum Computation – Lecture 19

T1

2

T2

1

probability of being in |0> state

probability of being in |1> state

1

1/2

time

time

Figure 1: expected results for experiments for T1 and T2 initialize the qubit to the ground state |0�. Then apply X = |0� �1| + |1� �0|, and wait for time t and measure the probability of being in the |1� state. We expect an exponential decay e−t/Ti . T2 is called the “transverse coherence time,” or the “spin­spin relaxation time,” or the “phase coherence time,” or the “elastic scattering time,” or the “phase damping.” One can do an experi­ ment to determine T2 . First initialize the qubit to the ground state |0�. Then apply the Hadamard |1� √ , wait for time t, apply H again, and measure the probability transform H to get the state to |0�+ 2 of being in the |0� state. We expect that the measurement goes to 1/2 after a long time because after a long time, most likely something popped the state into either |0� or |1� state, which after √ the H transform sends the state to |0�±|1� . 2 In general T1 > T2 .

1.2

Universal Gate Sets

There are many different universal gate sets. We have seen that CNOT and single qubit gates form a universal gate set. CNOT, the Hadamard gate, and π/8 gate is another universal gate set. In practice experimentalists use controlled Hamiltonians that they turn on and off for certain time intervals. H = Hsys + P1 (t)X + P2 (t)Y...

For example, for an NMR setup, we may have

π� Jσz ⊗ σz + P1 (t)I ⊗ σx + P2 (t)I ⊗ σy ... 2 In the real world, there is no such thing as time dependent Hamiltonians. So how do we perform a sequence of operations? It is a just an approximation; fundemantally we will always have decoherence and will need fault tolerance. What happens is that our classical controls are actually quantum systems, and we must take into action the back action of the control system on our system. P1 (t)X is just an approximation; in reality, we have a Jaynes­Cumming type interaction Hamiltonian: H=

H = �ωN + δZ + g(a† σ− + aσ+ ) where σ� = X±Y 2 . In less abstract terms, there is decoherence that results after a photon interacts with a qubit because the photon will carry away information about the state of the qubit.

P. Shor – 18.435/2.111 Quantum Computation – Lecture 19

2

3

Implementations

In general, the challenge of quantum computing lies in the fact that quantum systems have short lifetimes, and that we need to control it externally. System NMR Ion Trap Dots Microwave Cavity Optical Cavity

T (sec) 102 to 108 10−3 10−6 100 10−5

Table 1: Some relaxation times for different implementations

2.1

Cavity QED

The Hamiltonian is described by atom, photon, and atom­photon interactions. The qubit is the sin­ gle photon. Gates for π/8 and Hadamard are implemented by beam splitter and the like. Turchette managed to achieve a control Z gate.

2.2

Ion Trap

The Hamiltonian is described by spin, photon­phonon (vibrational mode ) atom­photon­phonon interactions. The qubit is the atom (spin) and the phonon. The Deutsch­Joza algorithm has been implemented with ion traps. The system has a lifetime of O(1 − 100) (order of) milliseconds. Pulsed lasers are the universal gate set. The challenge is to get a stable O(10) Hz laser and cooling the ions to absolute zero.

2.3

NMR

The Hamiltonian is described by spins, spin­spin, and external control photon interactions. The spins interact with chemical bonds. The gates are implemented by radio frequency magnetic field pulses. Factoring with 6 qubits has been accomplished. In terms of robustness, 1 H, 13 C, 9 F , 14 N has coherence times of O(1) seconds.

2.4

All Silicon Quantum Computer

This implementation implants individual atoms into silicon surrounding and controls the atom electronically. It has a coherence of 100 ms at T = 9.2K. This implementation is scalable and uses current techniques of classical computer engineering.

3

Quantum Cryptography

Currently two companies make quantum cryptography systems. The purpose of quantum cryptog­ raphy is to make it more likely to detect an eavesdropper. They are based on the fact that an eavesdropper measuring a quantum system transmitted will collapse the system.

P. Shor – 18.435/2.111 Quantum Computation – Lecture 19

4

We can relate various techniques of quantum computing to features of it’s implementation. Data compression is related to cooling. Error correction is related to control and T1 and T2 . Noisy coding is related to precision of measurements. Cryptography is related to entanglement and non­locality.

Lecture 23: Fault­Tolerant Quantum Computation Scribed by: Jonathan Hodges Department of Nuclear Engineering, MIT December 4, 2003

1

Introduction

Before von Neumann proposed classical fault­tolerance in the 1940’s, it was assumed that a compu­ tational device comprised of more than 106 components could not perform a computation wihout encountering a fatal hardware error. Von Neumann proved that one could indeed make the com­ putation work, as long as a certain degree of overhead was tolerable. Thus follows the classical fault­tolerance theorem: Theorem 1 (Classical Fault­Tolerance). A computation of length n using perfect computational components can be executed reliably (i.e. with probability 1 − n1α for polynomial α ) using O(n log n) steps, provided the components work with probability 1 ­ � of the time and that the faults encountered are independent. We can sketch von Neumann’s proof of Fault­Tolerance as follows: Given classical AND,NOT, and OR gates let us encode a 0 into many 0’s for c log n times, where c is some constant. 0 → 0000000

(1)

Now take two identical copies of “0”, call them a and b, and put them through the AND gate. Ideally one should get 1111111. Instead, suppose the strings received are 1110101 on a and 0111111 on b. If one performs a bit­wise AND on each successive bit of the bit strings a and b, the result is 0110101. Taking “triples” of bits of this resulting addition, one performs a majority vote. Thus, if one bit has an error probablity of p , two bits in a triple being erroneous occurs with probabiltiy 3p2 . As long as p is small, one can perform operations with fault­tolerance. The same type of proof can be shown for NOT and OR gates, thus giving universality. In short, if one has compenents of a computer whose fidelity are high enough, and adding additional compents is relatively easy, then the computation is indeed plausible. As it turns out the critics were too critical. Your desktop computer does not even use a software error­correction for doing computations, as the � for our silicon­based hardware has become increasingly small.

2

Using classical techniques for quantum computation

Classically, four methods exist for dealing with fault­tolerant computing, but only one of these will prove feasible. Consistency checks, like the parity of a bit string, work classically, but in the quantum world are simply not powerful enough. Checkpoints require stoping the computation at a 1

P. Shor – 18.435/2.111 Quantum Computation – Lecture 23

2

specific point, checking the result, then starting the computation again. The probablistic nature of quantum mechanics and the no­cloning theorem make this technique useless for QC. Classically, one might make many copies of the computation to perform a massive redundancy scheme; however, this errs like consistency checks, as it is not “powerful enough” for quantum computations. Thus, one is left with error correcting codes, which have previously been shown portable from the classical to the quantum domain.

3

Quantum Fault Tolerance

In order to take an errorless quantum computation to a fault­tolerant computation, one first encodes each qubit into a quantum error correcting code. Every gate in the circuit should then be replaced by a fault tolerant version of it. Finally, insert an error correction step after every gate. Above we argued that fault­tolerance in classical computations need only AND, NOT, OR gates. For universal quantum computation only the CNOT and single­qubit gates are required, but formulating fault­ tolerant operations becomes easier with a finite gate set. CNOT, Hadamard, σx , σz , T, Toffoli, and π 8 will be proven useful. Theorem 2 (Kitaev­Solovay Theorem). Given a set of gates on SU(2) ( or SU(k) generally) that generates a dense set in SU(2), then any gate U ∈ SU(2) can be approximated to � using O(log c 1� ) gates where 1 ≤ c ≤ 2. See Appendix 3 of Nielsen and Chuang for more details.

3.1

Fault Tolerance of σx

In order to show that a σx gate can be done with fault tolerance, let us encode 1 qubit into k qubits using a CSS Code (the Steane Code). � 1 |0� −→ � |x� |C2 | x∈C2 � 1 |x + v� |1� −→ � |C2 | x∈C2

(2) (3)

Since dim(C1 ) is k, dim(C2 ) is k­1, this code will encode a single qubit, and satisfies the inequality 0 ⊆ C2 ⊆ C1 . The codewords v are those not overlapping the two classical codes; v ∈ C1 − C2 . Since the encoded |0� and |1� are orthogonal, a σx should just interchange the two encodings. These two states are separated by v, which amounts to peforming a σx on each individual qubit. Now suppose an error is made in performing σx on one of the qubits, where the errors on each qubit are uncorrelated. Then this code will be able to correct for these errors, resulting in a quantum error correcting code and operation that performs σx with fault­tolerance.

3.2

Fault Tolerance of σz

By using the Steane code above, the equivalent of σz on an unencoded qubit is to apply σz to those individual qubits with a 1 in the codeword w where w ∈ C2⊥ − C1⊥ . This results in a state |a� acquiring a phase of (−1)a.w . Under such a transformation the code words become 1



� � 1 1 |x� −→ � (−1)x.w |x� = � |x� |C2 | x∈C2 |C2 | x∈C2 |C2 | x∈C2 �

(4)

P. Shor – 18.435/2.111 Quantum Computation – Lecture 23

1 �



|C2 | x∈C2

|x + v� −→ �

1



|C2 | x∈C2

3

(−1)x.w (−1)v.w |x + v� = − �

1



|C2 | x∈C2

|x + v�

(5)

since at least 1 vector in C1 gives v.w = 1.

3.3

Fault Tolerance of Hadamard Gate

The fault tolerance of the Hadamard gate under this CSS encoding can be seen under the additional constraint C1 = C2⊥ . If the function E(x) represents the act of encoding the bit, the action of a Hadamard on an encoding qubit must follow the transformations: 1 E(|0�) −→ √ (E(|0�) + E(|1�)) 2 1 E(|1�) −→ √ (E(|0�) − E(|1�)) 2

(6) (7)

A Hadamard transformation of each individual qubit, H ⊗k , applied to E(|0�) will give precisely the correct encoded transformation.

H�

1



|C2 | x∈C2

|x� = =

� 1 (−1)x.y |x� � k 2 2 |C2 | y,x∈C2 � 1 � |y� |C2⊥ | y∈C1

= E(

|0� + |1� √ ) 2

The last line follows because E(|0�) is composed of all codeword in C2 and E(|1�) is everything in C1 , but not in C2 by definition. A Hadamard transformation on E(|1�), simply adds in the phase factor of (−1)y.v , which obviously follows from above. This phase factor will be unity if y ∈ C2 , but ­1 if y ∈ (C1 − C2 ), thus appropriately adding a phase to the states in the code that are E(|1�).

3.4

Fault Tolerance of CNOT Gate

The σx , σz , and H gates can all be performed on a single encoded qubit with fault­tolerance because these gates are always applied to single qubits. Likewise, given two single­qubit encoded states, one can perform CNOT operations between the k th qubit of one set, with the k th qubit of the other. Thus there are at most two qubits interacting for a single gate, making errors independent among the sets of qubits, and thus correctible with the CSS Code. This can be shown as follows: ⊗k UCN OT

� 1 � |x + va � ⊗ |y + vb � = |C2 | x∈C2

y∈C2

=

� 1 � |x� ⊗ |x + y + va + vb � |C2 | x∈C2

1 |C2 |

� x∈C2

y∈C2

|x� ⊗

� y∈C2

|y + va + vb �

P. Shor – 18.435/2.111 Quantum Computation – Lecture 23

4

If va = vb , then va + vb = 0 in binary addition and the vector is unchanged. Otherwise, the resulting state will be a string of 1’s added to all states |y�, which is just the encoding E(|1�). If an error occurs in any of the two­qubit CNOT operations, this will result in va or vb not being all 0’s or all 1’s, and the CSS code will correct the the appropriate state.

4

Error Correction With Fault­Tolerant Precision

Both classical and quantum error correction schemes require encoding information into a code, computing the syndrome of the code after errors may have occurred, then applying a syndrome­ dependent correction step to the coding to recover the information. A simple means of checking the syndrome would be to find the parity of a subset of qubits in a code. One could thus perform a series of CNOT gates where a single target qubit will be flipped depending on the states of the controlled qubits. Measurement of this ancilla qubit would unveil the syndrome, but not with fault­tolerant precision. This can easily be seen under a Hadamard transformation, H ⊗k+1 , which reverses the direction of the CNOT gates and gives the dual CSS code in the H⊥ space. (H is the parity check matrix of the code C1 .) Due to the reversed CNOT, if any of the gates have an error, the error will propagate forward in time due to the back­action of the CNOT. The stringent requirement of each error not affecting more than a single qubit (or pair in the FT CNOT construction) is not fulfilled. Using the idea of single failure points between qubits, as seen in the FT CNOT construction, we start our parity check register on k qubits in the state: |ψ� =

1 2k−1



|s�

(8)

s∈Zk2

Measurement of |ψ� in the canonical basis will result in either an odd parity bit string, indicating a syndrome of 1, or an even parity string for a 0 syndrome. The state |ψ� can be created by applying the Hadamard transformation to the “cat” state. 1 H ⊗k |ψ� = √ (|0� + |1�) 2

(9)

(The state |x� represents a k length string of x’s.) Now suppose a maximally entangled state can be created and verified by performing a few CNOT gates between the bits of the cat state and an ancilla. Fault tolerance is not an issue here; one only wants to know if the state is maximally entangled. Measuring |0� on the ancilla for a reasonable number of test qubits ensures that the state is in some superposition of the states |0� and |1�. The Hadamard transform of this state: � α+β 1 α−β 1 � H ⊗k (α |0� + β |1�) = ( √ ) k−1 |s� + ( √ ) k−1 |s� 2 2 2 2 s∈even s∈odd

(10)

Thus if α = β, the state is all zeros and no backaction will occur. The all ones state simply adds the ones vector to the qubits. Thus, fault­tolerant measurements can be obtained.