<<

Principles, Designs and Analysis of Devices

Goong Chen David A. Church Berthold-Georg Englert Carsten Henkel Bernd Rohwedder Marlan O. Scully ii Contents

1 Introduction to Quantum Computation 1 1.1 Introduction. Turing machines and binary logic gates ...... 1 1.2 Quantum mechanical systems ...... 5 1.3 Hilbert spaces ...... 13 1.4 Universality of elementary quantum gates ...... 18 1.5 Quantum algorithms ...... 26 1.5.1 The Deutsch–Jozsa problem ([15]) ...... 26 1.5.2 Bernstein–Vazirani problem ([6]) ...... 28 1.5.3 Simon’s problem ([50]) ...... 30 1.5.4 Grover’s quantum search algorithm ([25]) ...... 32 1.5.5 Shor’s factorization algorithm ([49]) ...... 34 1.6 Quantum adder and multiplier ...... 37 1.7 codes ...... 41 1.8 Quantum computing devices and requirements ...... 41

2 Two-Level Atoms and Cavity QED 41 2.1 Two-Level atoms ...... 41 2.1.1 Atom-light interaction ...... 41 2.1.2 Reduction to a two-level atom ...... 44 2.1.3 Single atom rotation ...... 46 2.1.4 Two-level atom hardware ...... 48 2.2 Quantization of the electromagnetic field ...... 51 2.2.1 Normal mode expansion ...... 51 2.2.2 Field mode quantization ...... 52 2.2.3 Energy spectrum and stationary states ...... 53 2.2.4 Cavity hardware ...... 56 2.3 Cavity QED for the quantum phase gate ...... 59 2.3.1 Atom-cavity Hamiltonian ...... 60 2.3.2 Large detuning limit ...... 62 2.3.3 Two-qubit operation ...... 64 2.3.4 Atom-cavity hardware ...... 66

iii iv CONTENTS

3 Imperfect Quantum Operations 71 3.1 Fidelity ...... 71 3.2 Density matrices ...... 72 3.3 Time evolution of density matrices ...... 75 3.3.1 The von Neumann equation ...... 75 3.3.2 Quantum operations ...... 75 3.3.3 The Kraus representation theorem ...... 76 3.3.4 Quantum Markov processes ...... 78 3.3.5 Non-Markovian environments ...... 81 3.4 Examples of master equations ...... 82 3.4.1 Leaky cavity ...... 82 3.4.2 Unstable two-level system ...... 83 3.4.3 Dephasing ...... 85 3.5 Fidelity calculations ...... 86 3.5.1 Fluctuating gate parameters ...... 86 3.5.2 Spontaneous decay ...... 88

4 Ion Traps 95 4.1 Introduction ...... 95 4.2 Ion confinement, cooling, and condensation ...... 98 4.2.1 Confinement. Several types of ion traps ...... 98 4.2.2 Ion cooling and condensation ...... 105 4.3 Ion ...... 111 4.4 Summary of ion preparation ...... 116 4.5 Coherence ...... 118 4.5.1 Coherence of the motional qubit ...... 119 4.5.2 Coherence of the internal qubit ...... 122 4.5.3 Coherence in logic operations ...... 123 4.5.4 Studies of decoherence through coupling to engineered reservoirs ...... 126 4.5.5 Summary of ion coherence ...... 127 4.6 Quantum gates ...... 128 4.6.1 General considerations ...... 129 4.6.2 Cirac–Zoller CNOT gate ...... 140 4.6.3 Wave packet or Debye–Waller CNOT gate ...... 146 4.6.4 Sørensen–Mølmer gate ...... 147 4.6.5 Geometrical phase gate ...... 151 4.6.6 Summary of quantum gates ...... 154 4.7 A vision of a large scale confined-ion quantum computer . . . . 156 4.8 Trap architecture and performance ...... 158 4.9 Teleportation of coherent information ...... 159 4.10 Experimental DFS logic gates ...... 160 4.11 Quantum error correction by ion traps ...... 161 4.12 Summary of ion quantum computation ...... 162 4.12.1 Assessment ...... 162 4.12.2 Qubits ...... 162 CONTENTS v

4.12.3 Coherence ...... 164 4.12.4 Gates ...... 165 4.12.5 Computation ...... 166 4.12.6 Summary ...... 168 4.12.7 Outlook ...... 169

5 Quantum Dots Quantum Computing Gates 175 5.1 Introduction ...... 175 5.1.1 QD properties and fabrication: from quantum wells, wires to quantum dots ...... 176 5.1.2 QD-based single- devices and single-photon sources ...... 181 5.1.3 A simple quantum dot for quantum computing . .... 184 5.1.4 Spintronics ...... 186 5.1.5 Three major designs of QD-based quantum gates .... 186 5.1.6 Universality of 1-bit and 2-bit gates in quantum computing188 5.2 in quantum dots microcavity ...... 190 5.2.1 Resonance, 1-bit and CNOT gates ...... 192 5.2.2 Decoherence and measurement ...... 194 5.3 Coupled electron spins in an array of quantum dots ...... 195 5.3.1 Electron ...... 195 5.3.2 The design due to D. Loss and D. DiVincenzo ...... 197 5.3.3 Model of two identical laterally coupled quantum dots . 199 5.3.4 More details of the QD arrangements: Laterally coupled and vertically coupled arrays ...... 206 5.3.5 Decoherence and measurement ...... 209 5.3.6 New advances ...... 211 5.4 Biexciton in a single quantum dot ...... 211 5.4.1 Derivation of the unitary rotation matrix and the condi- tional rotation gate ...... 214 5.4.2 Decoherence and measurement ...... 218 5.4.3 Proposals for coupling of two or more biexciton QD . . . 218 5.5 Conclusions ...... 219

6 Linear Optics Computers 185 6.1 Classical electrodynamics – Classical computers ...... 186 6.1.1 Light beam manipulation with four degrees of freedom . 187 6.1.2 Optical circuits and examples ...... 196 6.1.3 Complexity issues of LOCC and alternatives ...... 200 6.2 Quantum electrodynamics – Quantum computers ...... 204 6.2.1 Quantum optical states ...... 205 6.2.2 Quantum operations and gates ...... 210 6.2.3 The approach of Knill, Laflamme and Milburn ...... 216 6.2.4 ...... 224 vi CONTENTS

6.2.5 Application of quantum teleportation to LOQC . . . . . 228 6.3 Summary and outlook ...... 237

7 Nuclear Magnetic Resonance (Optional and Tentative) 245

A 247 A.1 The Fock–Darwin States ...... 247

B 251 B.1 Evaluation of the exchange energy ...... 251 Chapter 1

Introduction to Quantum Computation

1.1 Introduction. Turing machines and binary logic gates

The earliest ideas of simulating and utilizing quantum systems to do compu- tation, i.e., quantum computation, can be attributed to P. Benioff ([5, 1980]) and R. Feynman ([23, 1982]). In his 1980 paper, Benioff introduced a model. Deutsch ([12, 13]) further developed more concrete proposals and introduced the model of computation. Later, Yao [61] showed that the quantum circuit model of computation is equivalent to the quantum Turing machine model. The foundation of modern computer science is built on the theory of Tur- ing machines. Alan Turing (1912–1954) ([43]) published his ideas of an ab- stract computing machine (now called a “Turing machine” (TM) in 1936, which moved from one state to another using a precise finite set of rules, given by a finite table, and depending on a single symbol it read from a tape ([45]). A TM, at the time Alan Turing invented it in his 1936 paper [54], was a hypothetical computer. It consists of the following:

(i) an infinite tape on which symbols may be read and written.

(ii) The machine travels right or left along the tape, following a program.

(iii) At each step the machine writes to the tape, travels either left or right and changes state, according to a set of internal states.

(iii) The set of symbols and the set of internal states are both finite sets.

Turing wrote [54]:

1 2 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

“... Some of the symbols written down will form the sequences of figures which is the decimal of the real number which is being computed. The others are just rough notes to ”assist the memory”. It will only be these rough notes which will be liable to erasure. ...”

Further, he established that a universal Turing machine existed [54]:

“...which can be made to do the work of any special-purpose ma- chine, that is to say to carry out any piece of computing, if a tape bearing suitable ”instructions” is inserted into it. ...”

The tape referred above in his description of a universal Turing machine was the “computer memory” and the instructions on the tape constituted the “computer program.” We may formalize the notion of a TM as follows.

Definition 1.1.1. A (classical) Turing machine (TM) is a 6-tuple (Q, A, δ, q0,qa,qr), where

Q = {q1,q2,...,qm}is a finite set of control states; A = {α1,α2,...,αn}, the alphabet, is a finite set of distinct symbols; q0,qa,qr ∈Qare, respectively, the initial, accepting and rejecting states; and δ : Q × A −→ A × Q ×{L, R}, is a transition function mapping from each “square” (q, α) ∈ Q×A on a “tape” to (q0,α0,L)or (q0,α0,R), left (L) or right (R) of that square on the tape.  A simple TM satisfying the above definition is exemplified below. Example 1.1.1. Consider

Q = {x, qa,qr}, A={1,B}, where B stands for “blank” while “Halt” means that the computation process is finished. Define

δ(x, 1) = (1,x,R), δ(x, B)=(1,qa,R), δ(0,B)=(0,qr,R).

Then the above input-output relation defined by δ defines a fault-tolerant TM performing an “unary increment” ([11]), i.e., it takes a string of 1’s and add an additional 1 at the end, e.g.,

1111 −→ 11111. 1.1. INTRODUCTION. TURING MACHINES AND BINARY LOGIC GATES3

It functions as follows. On the “tape,” initially the entries are 1 1 1 1 B B B ··· ··· B ··· , where B signifies “blank”. It first encounters 1 at square 1, as δ(x, 1) = (1,x,R), so the TM writes 1 there and moves R (right) and goes to state x. At square 2, 3 and 4, it does the same. At the 5th square, because

δ(x, B)=(1,qa,R), so the TM moves to square 6, rewrites B into 1, and finishes the computation (i.e., halt) by entering the accepting state qa. What is written on the tape is 1 1 1 1 1 B B B ··· B ··· and the outcome is the unary incremented 11111. If originally on the tape, there are entries other than 1 and B, say 1 1 0 1 B B ··· B ··· , then at the third square, “0” is not an unary symbol, and the TM realizes that the string on the tape is an invalid input. As δ(x, 0) = (0,qr,B), the TM rejects the input string by entering the rejecting state qr.  The execution of the transition function δ and the computation on a TM is done by logic gates. Such gates are based on binary logic. For example, we have the NOT-gate and AND-gate, as shown in Fig. 1.1 NOT−gate AND−gate

x x y x x y

xx xy x y 01 00 0 10 01 0 10 0 11 1

Figure 1.1: The NOT-gate and the AND-gate, and their truth tables. Note that the NOT-gate is reversible but the AND-gate is irreversible.

In Table 1.1, we provide a list of classical logic gates and notation for perform- ing Boolean operations. 4 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

AND: ∧ x ∧ y = x · y OR: ∨ x ∨ y = x + y − x · y NOT: ¬ ¬x =1−x, x¯ =1−x COPY COPY x = xx ↑ NAND: x ↑ y = ¬(x ∧ y)=(¬x)∨(¬y) (NOT AND) ↓ NOR: x ↓ y = ¬(x ∨ y)=(¬x)∧(¬y) (NOT OR) Table 1.1: Classical gates for Boolean operations, where x, y ∈ {0, 1}.

The dissipation of heat generated by the computer has always been an im- portant issue in the design of computers. In the early 1960’s, R. Landauer of IBM identified the (main) source of heat generation as due to the irreversibility of the computing process [35]. For example, the AND-gate “∧” is irreversible because if x∧y = z, then we cannot determine x and y from the value of z. This can be easily seen from the truth table for “∧” given in Fig. 1.1. If all the com- puting gates are reversible, then heat generation by the computer can be dramatically curtailed. (Ideally, such heat generation can be reduced to 0.) Even though the 1-bit AND-gate is irreversible, ∧, an “equivalent” reversible 3-bit AND-gate can be constructed, as shown in Fig. 1.2.

xx 0 0 xAND x 1 1 xx (x x ) 2 2 01

Figure 1.2: The reversible 3-bit AND-gate. Here ⊕ means the usual addition, but modulo 2. By choosing x2 =0, the output on the lowest wire gives us x0 ∧ x1(= x0x1).

A gate operation is said to be universal if all the other logic operations can be expressed by this gate. The 1-bit NAND-gate ↑ in Table 1.1 is universal, e.g., as we can carry out negation, ∧ (and) and ∨ (or) by NAND:

x¯ = x ↑ 1,x∧y=(x↑y)↑1,x∨y=¯x↑y¯=(x↑1) ↑ (y ↑ 1).

Nevertheless, the NAND-gate is irreversible. In order to have a gate operation that is both reversible and universal, the number of bits involved must be at least 3. A famous theorem due to Fredkin and Toftoli [24] states the following: 1.2. QUANTUM MECHANICAL SYSTEMS 5

“There exists a 3-bit “universal gate” for reversible computation, i.e., a gate which, when applied in succession to different triplets of bits in a gate array, could be used to simulate any arbitrary re- versible computation.” This universal, reversible gate, called the Toffoli gate, is exactly the 3-bit AND-gate as shown in Fig. 1.2. All the quantum computing gates to be studied in this book will soon be known to be reversible, as quantum operations are unitary transformations and thus are reversible. A quantum Toffoli gate will be given in Fig. 1.5. It can be represented by an 8 × 8 unitary matrix. Since the classical Toffoli gate is uni- versal, we see that all the classical logic circuits can be simulated by quantum circuits.

1.2 Quantum mechanical systems. Basics of atoms and molecules

We assume that the reader has rudimentary knowledge of modern physics and multivariate calculus. Quantum mechanics was developed in the 20th Century by the work of great physicists Planck, Einstein, Heisenberg, Schr¨odinger and Dirac. But here we begin our discussion by presenting the Schr¨odinger equa- tion as a fundamental postulate of quantum mechanics. The majority of quantum computer proposals utilize particular quantum mechanical properties, such as photon emission and absorption, electronic and nuclear spins, energy level transitions, etc., in atomic, molecular and opti- cal systems. The physical law governing such phenomena is the Schr¨odinger equation ∂ i~ ψ = Hψ, (1.1) ∂t where ψ, the wave function, depends on both time t ∈ R and space r =(x1,x2, N ...,xN) ∈R ;ψ is a complex-valued function H in (1.1) is an operator, called the Hamiltonian, and ~ is the Planck constant. H consists of two parts: H = K + V, (1.2) where H = the kinetic energy of the system, V = the potential energy of the system. Both K and V are functions of (rr, t) classically. As heuristics, we consider the motion of a harmonic oscillator which, classically, describes a 1-dimensional vibrating spring with an attached mass m and spring constant k:

1 2 K = p ,p=the linear momentum = mv = mx,˙ 2m 1 V = kx2, 2 6 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION where x denotes the displacement of the mass from the equilibrium, and x˙ = dx/dt. The Hamiltonian principle gives us the equations of motion

x˙ = ∂H/∂p = p/m, p˙ = −∂H/∂x = −kx.

Thus,

x¨ =˙p/m = −kx/m, mx¨ + kx =0, which is the equation of motion of the harmonic oscillator in Newtonian me- chanics. In quantum mechanics, K and V and, thus, H, are regarded as operators in a proper Hilbert space1 through quantization: ~ d p 7→ ; x 7→ x · (i.e., x · (ψ)=xψ, the multiplication operator), (1.3) i dx 1 ~ 2 d 2 K = p2 −→ − , 2m 2 m dx2 1 1 V = kx2 −→ kx2·, 2 2 and, thus, (1.1) becomes a time-dependent partial differential equation (PDE)

2 2 ∂ ~ ∂ 1 2 i~ ψ(x, t)=− ψ(x, t)+ x ψ(x, t); x, t ∈ R. (1.4) ∂t 2m∂x2 2k The proper abstract functional space setting for a rigorous mathematical inves- tigation of the equation (1.4) is  Z ∞  2 2 L (R)= f: R→C| |f(x)| dx < ∞ 2, (1.5) −∞ called the space of square Lebesgue-integrable functions on R. A function f ∈ L2(R), after normalization to norm 1, i.e.,

 1/2  1/2 . Z∞ Z∞ fˆ = f  |f(x)|2dx , kfˆk≡ |fˆ(x)|2dx =1 −∞ −∞ becomes a so-called bound state (pure) in quantum mechanics. We will return to the quantum-mechanical harmonic oscillator eq. (1.4) in Section 2.2 of Chap. 2. We may now proceed to consider a concrete system involving a few parti- cles of electrons and nuclei in atomic and molecular physics. The Schr¨odinger

1We defer until Definition 1.3.1 later in this section to introduce what a Hilbert space is and the relevant notation. 2The integral in (1.5) is the Lebesgue integral. But for all practical purposes, the reader may view it as the usual Riemann integral in calculus. Both the Riemann and the Lebesgue integrals obey the same linearity rules. They differ only in sequential convergence properties. 1.2. QUANTUM MECHANICAL SYSTEMS 7 equation modeling such a system provides satisfactory explanations of their chemical, electromagnetic and spectroscopic properties. Assume that the sys- tem under consideration is non-relativistic, and has N1 nuclei with masses MK and charges eZK,e being the electron charge, for K =1,2,...,N1, and PN1 N2 = ZK is the number of electrons. The position vector of the Kth K=1 nucleus will be denoted as RK , while that of the kth electron will be rk, for k =1,2,...,N2. Let m be the mass of the electron. The Schr¨odinger equation for the overall system is given by " XN1 2 XN2 2 ∂ ~ 2 ~ 2 i~ Ψ(RR,rrr, t)=HΨ(RR,rrr, t)= − ∇K − ∇k K ∂t K=1 2M k=1 2m XN1 XN2 2 XN2 2 ZKe 1 e − + |RK − rk| 2 |rk − rk0 | K=1 k=1 k6=k0 k,k0=1 

XN1 2  1 ZKZK0 e  +  Ψ(RR,rrr, t), (1.6) 2 |RK − RK0 | K6=K0 K,K0=1 where H is the Hamiltonian and 3 R =(R1,RR2,...,RRN1),rr=(r1,rr2,...,rrN2),rrj=(xj,yj,zj)∈R .

The above PDE has a total of 3(N1 + N2)+1dependent variables and is often too complex for practical purposes of studying atomic or molecular problems. Born and Oppenheimer [7] provide a reduced order model by approximation, permitting a particularly accurate decoupling of the motions of the electrons and the nuclei. The main idea is to assume that Ψ in (1.6) takes the separable form of a product Ψ(RR,rr)=G(R)F(RR,rr), which, after assuming that the electronic motions have much faster time scale than those of nuclear motions, leads to

2 XN2 XN2 2 XN1 XN2 2 ∂ ~ 2 1 e ZKe i~ F(RR,rrr, t)= − ∇k + − ∂t 2m 2 |rk − rk0 | |RK − rk| k=1 k6=k0 K=1 k=1 k,k0=1 ! XN1 2 1 ZK ZK0 e + F (RR,rrr, t). (1.7) 2 |RK − RK0 | K6=K0 K,K0=1

In “typical” molecules, the time scale for the valence electrons to orbit about the nuclei is about once every 10−15 second (and that of the inner-shell elec- trons is even smaller), that of the bonds vibration is about once every 10−14 8 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION second, and that of the molecule rotation is every 10−12 second. This differ- ence of time scale makes the Born–Oppenheimer approximation valid, as the electrons move so fast that they can instantaneously adjust their motions with respect to the vibration and rotation movements of the slower and much heav- ier nuclei. The Born–Oppenheimer approximation breaks down in several cases, chief among them when the nuclear motion is strongly coupled to electronic mo- tions, e.g., when the Jahn–Teller effects [29, 30] are present. It also requires corrections for loosely held electrons such as Rydberg atoms. Using atomic units and considering only steady-states for (1.7): −iEt F (RR,rrr, t)=F(rr, t)=e ψ(r),rr=(r1,rr2,...,rrN2), rj =(xj,yj,zj), 1≤j ≤N2, we obtain the time-dependent form of the Born–Oppenheimer approximation

XN2 X XN2 XN1 1 2 1 Zk Hψ = Eψ, H = − ∇j + − 2 rjk |rj − Rk| j=1 1≤j

rjk ≡|rj −rk|,j,k=1,2,...,N2. Example 1.2.1. We use the simplest atom, the hydrogen H, as an example to illustrate a quantum mechanical model and the idea of quantum numbers.In the Born–Oppenheimer model (1.8), by letting, N2 = N1 =1, with Z1 =1and R1 =00, equation (5.20) becomes   1 2 1 3 − ∇ − ψ(r)=Eψ(r),rr∈R, (1.9) 2 r the Born–Oppenheimer separation of the hydrogen atom. We write (5.21) in spherical coordinates in view of the symmetry involved: 2 1 ∂ 1 2 2 (rψ)+ Λ ψ+ ψ−2Eψ =0, (1.10) r ∂r2 r2 r where   2 2 1 ∂ 1 ∂ ∂ Λ ≡ + sin θ , (the Legendrian); (1.11) sin2 θ ∂φ2 sin θ ∂θ ∂θ r = the radial variable, 0

Equation (5.21) has separable solutions

ψ(r)=ψ(r, θ, φ)=R(r)Y(θ, φ). (1.12)

The angular variables are quantized first as we know that angular functions are the spherical harmonics

Y (θ, φ)=Y`m(θ, φ)=Θ`m(θ)Φm(φ),`=0,1,2,...,m=`, ` − 1,...,−`, (1.13) 3 on the unit sphere S2 ≡{r∈R ||r|=1}, satisfying 2 Λ Y`m(θ, φ)=−`(`+1)Y`m(θ, φ), (1.14) where in (5.27),

−1 imφ Φm(φ)=(2π) 2e , (1.15)   1 (2` +1)(`−|m|)! 2 |m| Θ`m(θ)= P (cos θ), (1.16) 2(` + |m|)! ` |m| (P` is the associated Legendre function).

Using (5.26)–(1.14) in (5.21), we obtain the equation for the radial function   1 00 `(` +1) 2 (rR) − R+ −2E R=0. (1.17) r r2 r

Solutions to the eigenvalue problem (1.17) that are square integrable over 0 < r<∞are known to be   (n − ` − 1)! ` 2`+1 −r R(r)=Rn`(r)=(−2) (2r) L (2r)e ; 2n[(n + `)!]3 n+` ` =0,1,2,...,n−1, (1.18) 1 1 En = − ,n=1,2,..., independent of `, 2 n2 2`+1 where Ln+` are the associated Laguerre functions such that for m, n =0,1,2,...

m 00 m 0 m xLm+n +(m+1−x)Lm+n +(m+n)Lm+n =0, exx−(m+n) dm+n Lm (x)= (e−xx2m+n), m+n (m+n)! dxm+n

0 (when m =0,Ln(x)is simply denoted as Ln(x)). The electron state of the hydrogen can thus be characterized by three “quan- tum numbers” n, `, m:   |n`mi = Rn`(r)Θ`m(θ)Φm(φ), with a proper normalization factor, n =1,2,...;`=0,1,2,...,n−1; m = −`, −` +1,...,0,1,...,`,  1 1 with energy level E = En = − ,n=1,2,..., independent of ` and m. 2 n2 10 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

The first quantum number n is called the principal quantum number. This n sometimes is referred to as the shell. For each given n =1,2,..., there can 2 be at most 2n electron “orbitals.” The principal quantum number represents physically the radial “range” that the region extends from the center of the atom. The second quantum number ` is called the subsidiary quantum number. This value ` =0,1,2,...,n−1, is often associated with the “shape” of the orbital. For example,

(i) ` =0implies spherically shaped, denoted also as an “s” (sharp) orbital. There can be a maximum of 2 electrons with the assignment of s.

(ii) ` =1implies double loped, denoted also as a “p” (principal) orbital. There can be a maximum of 6 electrons with the assignment of p.

(iii) ` =2implies quadra-lobed, denoted also as a “d” (diffuse) orbital. There can be a maximum of 10 electrons with the assignment of d.

(iv) ` =3implies octa-lobed, denoted also as an “f” (fundamental) orbital. There can be a maximum of 14 electrons with the assignment of f. The rest of the orbital assignments corresponding to ` =4,5,..., goes on by

g,h,i,j,k,... .

The shapes of s, p and d orbitals are shown in Fig. 1.3

The third quantum number m is called the magnetic quantum number. There can be a maximum of two electrons due to e+imφ and e−imφ with the same value of m while having the same quantum numbers ` and n. This quantum number is associated with the Zeeman effect as when a magnetic field is applied, hyperfine lines of spectra would split from degenerate states of electrons with the same n, ` but different m. There is a fourth quantum number, called the spin quantum number, which is not modeled by the Schr¨odinger equation. The spin quantum number for an electron is either +1/2 (spin up) or −1/2 (spin down). 

We now examine some further fundamentals of the atomic physics that are essential in any quantitative study of the manipulation of the quantum behav- ior of atoms. A complete description of the Hamiltonian (i.e., energy) of an atom contains 9 terms as follow [21]:

H = Hel + HCF + HLS + HSS + HZe + HHF + HZn + HII + HQ. (1.19)

The first three terms have the highest order, called the atomic Hamiltonian. They are the electronic Hamiltonian term, crystal field term and the spin-orbit inter- action term, respectively. The electronic Hamiltonian consists of kinetic energy 2 2 of all electrons, mvi /2=pi/2m, and two Coulomb terms: the potential energy 1.2. QUANTUM MECHANICAL SYSTEMS 11

z s (a)

y x

z z p x (b) p y z p z y y x y x x

d xz dyz d xy

(c)

d x22 −y

dz2

Figure 1.3: Shapes of s, p and d orbitals; cf. [1, p. 76]. (a) s-orbital, spherical in shape; (b) p-orbitals, with 2 lobes; (c) d-orbitals, with 4 lobes. Each of the orbitals displayed here has multiplicity 2 because of the azimuth +imφ −imφ phase e and e . 12 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

2 of electrons relative to the nuclei, −zne /rni, and the inter-electronic repulsion 2 energy, e /rij : X 2 X 2 X 2 pi e zne Hel = − + . i 2m i>j rij i,n rni These three summations agree, respectively in sequential order, to the first three summations in (1.8). The term HCF is called the crystal field term. It comes from the interaction between the electron and the electronically charged ions forming the crystal, and is essentially a type of electrical potential energy: X Qje V = − , i,j rij where Qj is the ionic charge and rij is the distance from the electron to the ion. Normally, only those ions nearest to the electron are considered. The third in the atomic Hamiltonian is the interaction between spin and orbit HLS = λL~ · S,~ where L~ and S~ are the angular momenta of the orbit and spin, respectively, and λ is the coupling constant. In this section, we will use S~ for the electron spin and I~ for the nuclear spin. The remaining six terms are called spin Hamiltonians. Terms HZe and HZn are two resulted from the application of an external magnetic field:

HZe = βB~ · (L~ + S~), X HZn = − gniβnB~ · I~i, i where B~ is the magnetic field strength. These two terms are called Zeeman terms, and they play big roles in NMR (nuclear magnetic resonance) and ESR (electron spin resonance). The nuclear spin-spin interaction term HII is also important in quantum computation, X HII = I~i · Jij · I~j , i>j because it provides a mechanism for the interaction between qubits. Hyper- fine interaction arises from the the interaction between the nuclear magnetic moments and the electron, X HHF = S~ · Ai · I~i. i

In (1.19), HSS is the spin-spin interaction term, expressed as

2 1 2 2 HSS = D[S − S(S +1)]+E(S −S ). z 3 x y 1.3. HILBERT SPACES 13

The very last term in (1.19) is called the quadrupolar energy:   2 2 e Q ∂ V 2 2 2 HQ = (3I − I(I +1)+η(I −I )). 4I(2I − 1) ∂Z2 z x y

For a specific system, only Hamiltonian playing major roles is needed in the final model. For example, in the study of ESR, only three terms are retained and the Hamiltonian is written as

H = HZe + HHF + HSS, while in the NMR case H = HZn + HII.

1.3 Hilbert spaces

A rigorous mathematical study of linear evolution partial differential equations such as (1.2) was developed during the 1950s based on functional analysis and operator theory [27, 53, 9]; see (1.22) and (1.23). The partial differential opera- tors “live” on a Hilbert space which is a space of functions. Definition 1.3.1. Let H be a vector space distributed over C. We say that H is a Hilbert space if H is equipped with an inner product h·|·i such that for each pair of vectors x, y ∈H, there is an associated complex number hx|yi3 satisfying

hy|xi = hx|yi, hx + y|zi = hx|zi + hy|zi, hαx|yi =¯αhx|yi, hx|xi≥0, hx|xi=0 only if x =0, and if we define the norm kxk≡[hx|xi]1/2 of any x ∈H, the space H is com- plete with respect to the norm, i.e., for any (Cauchy) sequence {xn|n =1,2,...} satisfying lim kxn − xmk =0, n,m→∞ this sequence has a limit x0 ∈H,

lim xn = x0, lim kxn − x0k =0.  n→∞ i.e., n→∞

The space L2(R) we mentioned earlier is a Hilbert space, with the inner product defined by Z ∞ hf|gi = f(x)g(x)dx; −∞

3The notation for an inner product favored by most mathematicians is hx, yi instead of hx|yi, the Dirac bra-ket notation. 14 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION while C(R, C) the space of all continuous functions mapping from R to C is not a Hilbert space because it cannot be equipped with an inner product that is complete. Every Hilbert space arising from physical applications has a countable or- thonormal basis, i.e., there exists a set {φi|i =1,2,3,...}⊆Hsuch that ( 1 if i = j, hφi|φji = δij = 0 if i =6 j; and for any f ∈H, we have an orthonormal expansion X∞ f = hφi|fiφi. i=1

Let H1, H2 be two Hilbert spaces and A: H1 →H2 be a bounded linear oper- ator, i.e., A satisfies kAfk2 ≤ Ckfk1 for some constant C ≥ 0, where kk1and kk2are, respectively, the norms on H1 and H2. In particular, when H2 = C,Ais said to be a linear functional. The vector space of all linear functionals endowed with the natural addition and scalar multiplication is a vector space denoted as H∗, which is algebraically isomorphic to H. (This is called the Riesz Representation Theorem in functional analysis.) Thus H∗ is itself a Hilbert space, called the dual space of H. Let H be a complex Hilbert space with inner product h·|·i. For any subset S ⊆H, define   Xn  | ∈ C ∈ ∈ span S = closure of  αjψj αj ,ψj S, j =1,2,...,n, for all ψj S j=1 in H. (1.20)

In quantum mechanics, the Dirac bra-ket notation writes the vector ψk as |ki, pronounced ket k, where k labels the vector. The role of ψj in the inner product hψj|ψki is that ψj is identified as a linear functional on H by

∗ ∗ ψj : H−→C; ψj(ψk)≡hψj|ψki.

∗ The Dirac bra-ket notation writes ψj as hj|, pronounced bra j. The inner prod- uct is now written as hψj|ψki = hj|ki.

Let A: H→Hbe a linear operator. Then in Dirac’s notation we write hψj |Aψki as hj|A|ki. The set of all kets (|ki) generates the linear space H, and the set of all bras (hj|) also generates the dual linear space H∗. These two linear spaces are called, respectively, the ket space and the bra space, which are dual to each other. The 1.3. HILBERT SPACES 15 natural isomorphism from H onto H∗,orfromH∗ onto H, is called “taking the adjoint” by physicists. An expression like hj|A|ki has an intended symmetry: one can think of A acting on |ki on the right as a matrix times a column vector, or A acting on hj| on the left as a row vector times a matrix. The solution of the Schr¨odinger equation

∂ i~ ψ(t)=Hψ(t),ψ(0) = ψ0 ∈H(initial condition), (1.21) ∂t can now be written as

ψ(t)=e−iHt/~ψ(0), −∞

hx|A|yi = hy|A†|xi, for all x, y ∈H; (overbar means complex conjugate).

A linear operator A is said to be unitary if

† † AA = A A = I, the identity operator on H.

(We sometimes use 1H or just 1 to denote the identity operator I.) Assume that the Hamiltonian H in (1.21) is independent of time. Then as H = H†, for any t ∈ R,

+ e−iHt/~(e−iHt/~)† = e−iHt/~eiH t/~ = e−iHt/~eiHt/~ = I, consequently, e−iHt/~ is unitary for any t ∈ R. If H in (1.21) is time-dependent: H = H(t), then the solution to (1.21) can- not be represented in terms of a 1-parameter evolutionary group. Rather, a 2-parameter group {U(t, s)|−∞

ψ(t)=U(t, 0)ψ0, −∞

In quantum mechanics, the preferred notation for basis is, respectively, |0i and |1i, where |0i and |1i generally refer to the “spin” state of a certain quantum system under discussion. “Spin up” and “spin down” form a binary quantum alternative and, therefore, a quantum bit or, a qubit. These spin states may then further be identified with e1 and e2 through, e.g.,

    1 0 |0i = , |1i = . (1.24) 0 1

For a column vector, say e1, we use superscript T to denote its transpose, such T as e1 =[10], for example. The spin states |0i and |1i form a standard or- thonormal basis for the (single) qubit’s ket space. The tensor product of a set 2 of n vectors |zji∈Cj, specified by the quantum numbers zj for j =1,2,...,n, is written interchangeably as

|z1i⊗|z2i⊗···⊗|zni=|z1i|z2i···|zni=|z1z2 ···zni. (1.25)

The tensor product space of n copies of C2 is defined to be

⊗n (C2) = span{|j1j2 ···jni|jk ∈{0,1},k=1,2,...,n}. (1.26)

It is a 2n-dimensional complex Hilbert space with the induced inner product from C2.Aquantum state is a vector in (C2)⊗n (or in any Hilbert space H) with the unit norm4. A quantum state is said to be entangled if it is not a tensor prod- uct of the form (5.21). A is a unitary linear transformation on H. The unitary group U(H) on H consists of all unitary linear transformations on H with composition as the (noncommutative) natural multiplication operation of the group. 2 ⊗n It is often useful to write the basis vectors |j1j2 ···jni∈(C ) ,jk ∈{0,1},

4This type of quantum state is actually a more restrictive type, called a pure state. A pure state,

say ket |ki, could be identified with the projection operator |kihk|. Then a general state is a convex

È È sum of such projectors, i.e., ck|kihk| with ck ≥ 0 and ck =1. k k 1.3. HILBERT SPACES 17 k =1,2,...,n, as column vectors according to the lexicographic ordering:       1 0 0       0 1 0       0 0 1       | ··· i . | ··· i . | ··· i . ··· 00 00 = . , 00 01 = . , 00 10 = . ,       0 0 0 0 0 0 0 0 0     0 0     0 0     0 0     | ··· i . | ··· i . 11 10 = . , 11 11 = . ; (1.27)     0 0 1 0 0 1 cf. (1.24). A quantum Turing machine (QTM) ([12]) has basic components same as those of the classical TM, cf. Definition 1.1.1. A QTM is a 6-tuple (Q, A, δ, q0,qa,qr), also same as those given in Definition 1.1.1, except that the transition function δ satisfies δ : Q × A × Q × A ×{L, R}−→C with X 2 |δ(q1,a1,q2,a2,d)| =1, for all (q1,a1)∈Q×A.

(q2,a2,d)∈Q×A×{L,R}

The above signifies the restriction that all the operations on the QTM must be unitary.

Energy no magnetic m=-1/2 (β: spin down) field is applied magnetic field is applied m=1/2 (α: spin up)

Figure 1.4: Splitting of energy levels of a nucleus with spin quantum number 1/2. 18 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

1.4 Universality of elementary quantum gates. Quantum circuits

Any 2 × 2 unitary matrix is an admissible quantum operation on one qubit. We call it a 1-bit gate. Similarly, we call a 2k × 2k unitary transformation a k-bit gate. Let a 1-bit gate be   u00 u01 U = ; u10 u11 we define the operator Λm(U) [3] on (m +1)-qubits (with m =0,1,2,...) through its action on the basis by  m |x1x2···xmyi if ∧k=1xk =0, Λm(U)(|x1x2 ···xmyi)= m u0y|x1x2···xm0i+u1y|x1x2 ···xm1iif ∧k=1xk =1, where “∧” denotes the Boolean operator AND. The matrix representation for Λm(U) according to the ordered basis (1.27) is   1    .   ..  Λm(U)=  .  1   (1.28)   u00 u01 u10 u11 2m+1×2m+1

This unitary operator is called the m-bit-controlled U operation. An important logic operation on one qubit is the NOT-gate   01 σx = ; (1.29) 10 which is one of the Pauli spin matrices. (The two other important Pauli matri- ces are     0 −i 10 σy = ,σz= . (1.30) i 0 0−1

From σx, define the important 2-bit operation Λ1(σx), which is the controlled- not gate, henceforth acronymed the CNOT gate. For any 1-bit gate A, denote by A(j) the operation (defined through its ac- tion on the basis) on the slot j:

A(j)|x1x2 ···xj ···xni=|x1i⊗|x2i⊗···⊗|xj−1i⊗[A|xji]⊗|xj+1i⊗···⊗|xni.

Similarly, for a 2-bit gate B, we define B(j, k) to be the operation on the two qubit slots j and k [8]. A simple 2-bit gate is the swapping gate

Usw|x1x2i = |x2x1i, for x1,x2 ∈{0,1}. (1.31)

Then Usw(j, k) swaps the qubits between the j-th and the k-th slots. 1.4. UNIVERSALITY OF ELEMENTARY QUANTUM GATES 19

The tensor product of two 1-bit quantum gates S and T is defined through

(S ⊗ T )(|xi⊗|yi=(S|xi)⊗(T|yi), for x, y ∈{0,1}.

A 2-bit quantum gate V is said to be primitive ([8, Theorem 4.2]) if

V = S ⊗ T or V =(S⊗T)Usw for some 1-bit gates S and T . Otherwise, V is said to be imprimitive. It is possible to factor an n-bit quantum gate U as the composition of k-bit quantum gates for k ≤ n. The earliest result of this universality study was given by Deutsch [13] in 1989 for k =3. Then in 1995, Barenco [2], Deutsch, Barenco and Ekert [14], DiVincenzo [17] and Lloyd [37] gave the result for k =2. Here, we quote the elegant mathematical treatment and results by J.-L. Brylinski and R. K. Brylinski in [8].

Definition 1.4.1 ([8, Def. 4.2]). A collection of 1-bit gates Ai and 2-bit gates Bj is called (exactly) universal if, for each n ≥ 2, any n-bit gate can be obtained by composition of the gates Ai(`) and Bj(`, m), for 1 ≤ `, m ≤ n.  Theorem 1.4.1 ([8, Theorem 4.1]). Let V be a given 2-bit gate. Then the following are equivalent: (i) The collection of all 1-bit gates A together with V is universal. (ii) V is imprimitive. Rather than following [8], which requires some knowledge of the Lie algebra theory, we will include an elementary proof of the universality of 2-bit gates at the end of this section.  A common type of 1-bit gate from AMO (atomic, molecular and optical) devices is the unitary rotation gate   cos θ −ie−iφ sin θ Uθ,φ ≡ iφ , 0 ≤ θ, φ ≤ 2π. (1.32) −ie sin θ cos θ

We have (the determinant) det Uθ,φ =1for any θ and φ and, thus, the collec- 2 tion of all such Uθ,φ is not dense in U(C ). Any unitary matrix with deter- minant equal to 1 is said to be special unitary and the collection of all special unitary matrices on (C2)⊗n, SU((C2)⊗n), is a proper subgroup of U((C2)⊗n). 2 It is known that the gates Uθ,φ generate SU(C ). Another common type of 2-bit gate we shall encounter in the next two sec- tions is the quantum phase gate (QPG)   100 0   010 0 Qη = , 0 ≤ η ≤ 2π. (1.33) 001 0 000eiη 20 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

Theorem 1.4.2 ([8, Theorem 4.4]). The collection of all the 1-bit gates U θ,φ, 0 ≤ θ, φ, φ ≤ 2π, together with any 2-bit gate Qη where η 6≡ 0 (mod 2π), is universal. 

Note that the CNOT gate Λ1(σx) can be written as

Λ1(σx)=Uπ/4,π/2(2)QπUπ/4,−π/2(2); (1.34) cf. [16, (2.2)]. Thus, we also have the following.

Corollary 1.4.3. The collection of all the 1-bit gates Uθ,φ, 0 ≤ θ, φ ≤ 2π, together with the CNOT gate Λ1(σx), is universal.  We now introduce the standard notation for several of the basic types of quantum gates as follows. (When several wires are present, the top wire al- ways correspond to the leading qubit.)

NOT-gate σx (cf. (1.29)) unitary rotation gate Uθ,φ (cf. (1.32)) Uθ,φ The Walsh–Hadamard gate H:  1 H|0i = √ (|0i + |1i)    2 √1 11 1  H = − H|1i = √ (|0i−|1i)  2 1 1 2

H

The CNOT-gate Λ1(σx)

The 2-bit controlled-U gate Λ1(U) (cf. (1.28) with m =1)   10 0 0   01 0 0    ......  Λ1(U)=   .  00.U  . U 00. The QPG (cf. (1.33)) 1.4. UNIVERSALITY OF ELEMENTARY QUANTUM GATES 21

The tensor product S ⊗ T gate (where S and T are 1-bit gates)

S

T

Also, the Toffoli quantum gate is the 3-bit controlled-not gate as shown n Fig. 1.5.

Figure 1.5: The Toffoli quantum gate Λ2(σx).

According to the above notation, then diagramatically, the quantum circuit for (1.34) is given in Fig. 1.6.

Q π

π π π π U , U , 4 2 4 2

Figure 1.6: The quantum circuits for equation (1.34). The top wire represents the leading qubit (which is the most significant), while the second wire repre- sents the second qubit.

Let f be a Boolean function, where n f : {0, 1}×{0,1}×···×{0,1}={0,1} →{0,1}. (1.35)

For x ∈{0,1}nand y ∈{0,1}, define the Boolean function evaluation (unitary) operator n+1 n+1 Uf : {0, 1} ×{0,1} Uf |xi|yi = |xi|y ⊗ f(x)i (y ⊕ f(x) ≡ y + f(x)mod2).

This operator is represented as follows: 22 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

. . x . Uf . x . .

y y + f(x)

A very efficient operation in quantum computing is the n-bit quantum Fourier transform (QFT). QFT is a unitary operation

n n QFT: {0, 1} →{0,1} 2Xn−1 | i 1 2πixy/2n | i QFT x = n−1 e y , 2 y=0 where in the exponents on the right hand side above, x and y are taken to be numbers in {0, 1, 2,...,2n −1} corresponding to their binary representation. It is straightforward to verify that the circuit diagram for QFT can be given as follows

x 0 ... H y 0

x y 1 ... H R1 1

x ... H RR y 2 1 2 2 . . . .

x n − 2 ... yn − 2

HR R y xn − 1 1 ...n −1 n− 1 where   10 Rd = d ,d=1,2,...,n−1 0eiπ/2

|xi=|x0x1x2 ...xn−1i, |yi=|y0y1y2...yn−1i.

We now address the property of universality of 2-bit quantum gates. We first give the following theorem, which is not exactly self-contained but con- tains some major ideas of a useful matrix factorization. In what follows, U(2n) 1.4. UNIVERSALITY OF ELEMENTARY QUANTUM GATES 23 denotes the group of all 2n × 2n unitary matrices, while SO(2n) is the special orthogonal group of 2n × 2n matrices, i.e., M ∈ U(2n) satisfies M ∈ SO(2n) if and only if the determinant of M is 1. Theorem 1.4.4. Let V ∈ U(2n). Then 2Yn−1 iY−1 V = Vij . (1.36) i=1 j=0

n for a collection of matrices Vij ∈ U(2 ) such that    Vij : Sij −→ S ij is the identity transformation,  S ≡ {| i| ∈{ n − } 6 6 }  ij span m m 0,1,...,2 1 ,m=i, m = j ,  (1.37) 0 ≤ j

In other words, each V ∈ U(2n) is a product of (generalized) controlled-U(2) unitary ⊥ matrices Vij , which acts nontrivially only on Sij = span{|ii, |ji}. Proof. We first quote the following fact [42, 48]: For any V ∈ U(2n), there exists n a collection of unitary matrices Ti,j, 0 ≤ j

n n where Ti,j ∈ SO(2 ) ⊆ U(2 ) is a rotation involving |ii and |ji and satisfying (1.37), and D is a 2n × 2n diagonal matrix whose diagonal entries are complex numbers of unit magnitude. Now we can break up D into   d0    d1  D =  .  = D1D2 ...D2n−1 (1.39)  ..  d2n−1 where   d0 0    0 d1   1  D1 =   (1.40)  .   ..  1 and   1    .   ..    Di =  di  (1.41)  .   ..  1 24 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

n for i =2,3,...,2 −1. It is easy to see that D1 acts trivially except on |0i and |1i, and the other Di’s act non-trivially only on |ii. In addition, Di’s commute with each other, and each Di commutes with Tk,l, ∀0 ≤ l

V = T2n−1,2n−2 ...T2n−1,0T2n−2,2n−3 ...T2n−2,0 ...T2,1T2,0T1,0D1D2 ...D2n−1  =T2n−1,2n−2T2n−2,2n−3 ...T2n−1,0D2n−1   T2n−2,2n−3 ...T2n−2,0D2n−2  n − ......  2 1strings of products  T2,1T2,0D2  T1,0D1 (1.42)

For 0 ≤ j

Therefore we have reached 2Yn−1 iY−1 V = Vij i=1 j=0 where each Vij is a unitary matrix which acts nontrivially only on the states |ii and |ji satisfying (1.37).

Each factor Vij in (1.36) satisfies (1.37) and thus Vij acts nontrivially only on the states |ii and |ji. Denote the restriction of Vij to the 2-dimensional subspace ⊥ b b Sij = span{|ii, |ji} by Vij . Then Vij ∈ U(2). As pointed out in [3, p. 3465], each b Vij is not a standard Λn−1(Vij ) (in the notation of [3, p. 3458]) gate in the sense that the controls are states rather than bits. Nevertheless, using Proposition 1.4.5 below, Barenco et al. [3, §VIII] point out how to rearrange basis states with a “gray code connecting state |ii to state b |ji” such that Vij becomes unitarily equivalent to Λn−1(Vij ). In this sense, Vij b are generalized controlled-Vij gates.

Proposition 1.4.5. The symmetric group S2n of permutations on the symbols 0, 1, 2, ...,2n−1is generated by the 2-cycle (2n−2, 2n−1) and the 2n-cycle (0, 1, 2,...,2n− 1). Proof. This is a basic fact which can be found in most basic algebra or group theory books. Incidentally, we note that the 2-cycle (2n − 2, 2n − 1) is a permutation be- tween the states | |11...{z 10}i and | 11| {z...1}i and thus can be realized by the n bits n bits controlled-NOT gate with the nth qubit as the target bit and the first (n − 1) bits as the control bits as shown in Fig. 1.7. 1.4. UNIVERSALITY OF ELEMENTARY QUANTUM GATES 25

On the other hand, the 2n-cycle (0, 1, 2,...,2n−1) makes the rotation of the states |0i→|1i→···→|2n−2i→|2n−1i→|0i, i.e., the |xi→|x+1 mod2ni operation. This can be implemented by the circuit as shown in Fig. 1.8. Therefore, any permutation of the basis states |xi, x =0,1,2,...,2n−1, can be realized by finitely many controlled-NOT operations consisting of circuits as shown in Figs 1.7 and 1.8. Thus, each factor Vij in (1.36) can be realized by the circuit as shown in Fig. 1.9.

σ x

Figure 1.7: The n-bit controlled-NOT gate Λn−1(σx), where σx is given by n n (1.29). This gate implements the two cycle (2n − 2, 2n − 1) in Proposition 1.4.5.

1

n Figure 1.8: This circuit implements the operation |xi→|x+1mod2ni or, n n equivalently, the 2n-cycle (0, 1, 2,...,2n −1) in Proposition 1.4.5. Note that the bit |1i at the bottom of the figure is the “scratch bit” which is sometimes omit- ted in circuit drawing. All the gates in this circuit are controlled-NOT gates. 26 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

n n (i,2 -1) (i,2 -1) n n (j,2 -2) (j,2 -2)

V ij

b Figure 1.9: The unitary matrix Vij in (1.36) as a controlled-Vij gate where b n n Vij ∈ U(2). The operations (i, 2 − 1) and (j, 2 − 2) in the two boxes are cyclic permutations (which can be realized by concatenations of circuits in Figs. 1.7 and 1.8).

By concatenating together all the blocks Vij as shown in Fig. 1.9 according to the factorization (1.36), we have constructed all V ∈ U(2n) with controlled- b Vij gates according to (1.36).

1.5 Quantum algorithms

In this section, we describe, in some brevity, several quantum algorithms and their circuit designs. Two of them, Grover’s quantum search and Shor’s fac- torization algorithms, have received the most recognition so far as their back- ground problems are more “pragmatic,” as they are related to data mining and decryption. But algorithmic development is an active area in quantum com- puting and we expect to see more and more new algorithms with speedup targeting a variety of real-world applications.

1.5.1 The Deutsch–Jozsa problem ([15]) n Consider a Boolean function f : {0, 1} →{0,1}(cf. (1.35)). We say that a Boolean function is constant if n f(x)=c for some c ∈{0,1},for all x ∈{0,1} .

On the other hand, we say that f is balanced if −1 −1 card(f ({0})) = card(f ({1})), where card denotes the cardinality of a set. Then Deutsch–Jozsa problem is: 1.5. QUANTUM ALGORITHMS 27

“Given a Boolean function f : {0, 1}n →{0,1},f known to be ei- ther constant or balanced, determine whether f is constant or bal- anced.”

With the classical computer, in general we need 2n−1 +1evaluations of f to determine with certainty whether f is constant or balanced. But with the quan- tum computer, we need only one evaluation of f to make this determination with certainty. The Deutsch–Jozsa algorithm goes as follows.

1. Prepare an (n +1)-bit quantum register and initialize it to the state (|0i)n|1i. 2. Apply the Walsh-Hadamard transform to all the qubits.

3. Apply function evaluation unitary transform Uf

Uf : |xi|yi→|xi|y ⊕ f(x)i

4. Apply the Walsh-Hadamard transform to the first n qubits (of x). 5. Measure the first n qubit. If the outcome is |00 ...0i, then f is constant. If the outcome is not |00 ...0i, then f is balanced.

The circuit diagram is given in Fig. 1.10.

|0i H H

Uf

|0i H H

|1i H

Figure 1.10: Circuit diagram for the Deutsch–Jozsa algorithm. 28 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

Example 1.5.1. We provide a simple example for n =2to illustrate how the Deutsch–Jozsa algorithm works. (a) Let f(00) = f(01) = f(10) = f(11) = 1. The following sequence of quan- tum states shows the flow of computation utilizing the Deutsch-Jozsa al- gorithm. Start from the initial state |001i. Then

|00i|1i |0i + |1i |0i + |1i |0i−|1i |00i + |01i + |10i + |11i |0i−|1i → √ √ √ = √ 2 2 2 2 2 −|00i−|01i−|10i−|11i |0i−|1i |0i+|1i|0i+|1i|0i−|1i → √ =− √ √ √ 2 2 2 2 2 |0i−|1i →−|00i √ . 2 The outcome of measuring the first 2 qubit is |00i, hence f is constant. (b) Let f(00) = f(01) = 0, and f(10) = f(11) = 1. The following sequence of quantum states shows the result of computation utilizing Deutsch-Jozsa’s Algorithm. We start from the initial state |001i. Then,

|00i|1i |0i + |1i |0i + |1i |0i−|1i |00i + |01i + |10i + |11i |0i−|1i → √ √ √ = √ 2 2 2 2 2 |00i + |01i−|10i−|11i |0i−|1i |0i−|1i|0i+|1i|0i−|1i → √ = √ √ √ 2 2 2 2 2 |0i−|1i →|10i √ . 2 The outcome of measuring the first 2 qubit is |10i, hence f is balanced. 

1.5.2 Bernstein–Vazirani problem ([6]) n Let x = x1x2 ...xn and y = y1y2 ...yn be two n-bit strings in {0, 1} . We define the dot product x · y by

x · y = x1y1 ⊕ x2y2 ⊕ ...⊕xnyn.

The Bernstein–Vazirani problem is

n “Given a Boolean function fa : {0, 1} →{0,1}defined by fa(x)= a·x, where a is an unknown n-bit string in {0, 1}n, determine the value of a.”

As a contains n bits, with the classical computer, we need n evaluations of fa to determine the value of a. But with the quantum computer, we need only one evaluation of fa to determine a. 1.5. QUANTUM ALGORITHMS 29

The Bernstein–Vazirani algorithm proceeds as follows.

1. Prepare an (n +1)-bit quantum register and initialize it to n the state (|0i) |1i. 2. Apply the Walsh-Hadamard transform to all the qubits.

3. Apply the function evaluation unitary transform Ufa

Ufa : |xi|yi→|xi|y ⊕ fa(x)i.

4. Apply the Walsh-Hadamard transform to the first n qubits. 5. Measure the first n qubits. The outcome is |ai.

|0i H H

U fa

|0i H H

|1i H

Figure 1.11: Circuit diagram for the Bernstein–Vazirani algorithm.

Example 1.5.2. We use n =2to illustrate some details as how the algorithm works. Let a =11. The following sequence of quantum states shows the flow of computation utilizing the Bernstein-Vazirani algorithm. Start from the initial 30 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION state |001i. Then |00i|1i |0i + |1i |0i + |1i |0i−|1i |00i + |01i + |10i + |11i |0i−|1i → √ √ √ = √ 2 2 2 2 2 | i−| i−| i | i | i−| i → 00 01 10 + 11 0 √ 1 2 2 |0i−|1i →|11i √ . 2 The outcome of measuring the first 2 qubits is |11i, hence a =11. 

1.5.3 Simon’s problem ([50]) We say that a function f : {0, 1}n →{0,1}nis 2–1 if for each z ∈ Range(f), there are exactly two distinct n-bit strings x and y such that f(x)=f(y)=z. A function f : {0, 1}n →{0,1}nhas a period a if f(x)=f(x⊕a), for all x ∈{0,1}n. Simon’s problem is stated as follows. “Given a function f : {0, 1}n →{0,1}nwhich is 2-1 and has period a, determine the period a.” It is known that with the classical computer, we need exponentially many (with respect to n) evaluations of f to determine the period a. But with the quantum computer, we need only O(n) evaluations (expected) of f to deter- mine the period a. Simon’s algorithm can be stated as follows. 1. Repeat the following procedure for n times. (a) Prepare a 2n-bit quantum register and initialize it to the state (|0i)n(|0i)n. (b) Apply the Walsh-Hadamard transform to the first n qubits.

(c) Apply function evaluation unitary transform Ufa

Ufa : |xi|yi→|xi|y ⊕ fa(x)i.

(d) Apply the Walsh-Hadamard transform to the first n qubits. (e) Measure the first n qubits. Record the outcome |xi. 2. With the n outcomes x1, x2, ..., xn, solve the following system of linear equations:   x1 · a =0  x2·a=0 .  .  . xn·a=0. The solution a is the period of f. 1.5. QUANTUM ALGORITHMS 31

|0i H H

|0i H H Uf |0i

|0i

Figure 1.12: Circuit diagram for Simon’s algorithm. Operation and measure- ment by this circuit need to be repeatd O(n) times.

Example 1.5.3. As an illustration, let n =2. Let f(00) = 01, f(01) = 11, f(10) = 01, and f(11) = 11. The following sequence of quantum states shows the flow and result of computation utilizing Simon’s algorithm. We start from the initial state |0000i. Then,

|0000i |0i + |1i |0i + |1i 1 → √ √ |00i = (|00i + |01i + |10i + |11i)|00i 2 2 2 1 1 → (|0001i + |0111i + |1001i + |1111i)= ((|0i + |1i)|0i|01i +(|0i+|1i)|1i|11i) 2 2 1 1 → (|0i(|0i + |1i)|01i + |0i(|0i−|1i)|11i)= (|0001i + |0101i + |0011i−|0111i). 2 2

The outcome of measuring the first 2 qubits yields either |00i or |01i. Suppose that we have run the above computation twice and obtained |00i and |01i,re- 32 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION spectively. We now have a system of linear equations  00 · a =0 01 · a =0

The solution is a =10, the period of this function. 

1.5.4 Grover’s quantum search algorithm ([25]) Suppose we are given an unsorted database with N items. We want to find a target item w. This problem can be formulated using an oracle function f : {0, 1,...,N −1}→{0,1}, where w ∈{0,1,...,N −1}is given, and  0, if x =6 w, f(x)= (1.43) 1, if x = w.

The (single-item) search problem can now be stated as follows:

“Given an oracle function as in (1.43), find the w such that f(w)=1.”

This is an example of “data-mining.” N+1 It can be proved that with the classical computer, in average 2 oracle calls are needed in order to find√ the search target. But with the quantum com- puter, on average, we need O( N) oracle calls tofind the search target. So there is a quadratic speedup. As a special case when N =4, by using Grover’s algorithm, exactly one oracle call suffices in order to find the search target with certainty. L.K. Grover’s quantum search algorithm proceeds as follows. Without loss of generality, let N =2n. 1. Prepare an (n +1)-bit quantum register and initialize it to the state (|0i)n|1i. 2. Apply the Walsh-Hadamard transforms individually and simultaneously to all the n +1qubits. √ π 3. Repeat the following procedure for about 4 N times. See Fig. 1.13. (a) Apply function evaluation unitary transform Uf (selective sign flip- ping operator) Uf : |xi|yi→|xi|y ⊕ fa(x)i.

This is equivalent to the unitary operator Iw = I − 2|wihw| on the first n qubits. (b) Apply unitary operator (inversion about the average operator) Is = 2|sihs|−Ion the first n qubits. See Fig. 1.14. 4. Measure the first n qubits. We obtain the search target with a high prob- ability. 1.5. QUANTUM ALGORITHMS 33

|0i H

Uf Is Uf Is

|0i H

|1i H

Figure 1.13: Block diagram for Grover’s algorithm.

H H

Figure 1.14: Circuit diagram for the inversion about the average operator Is. 34 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

Example 1.5.4. Let N =22 =4, and Item 3 be the search target. The qubit representation of 3 is |11i. The following sequence of quantum states shows how the computation works utilizing Grover’s algorithm. Start from the initial state |001i. Then

|00i|1i |0i + |1i |0i + |1i |0i−|1i |00i + |01i + |10i + |11i |0i−|1i → √ √ √ = √ 2 2 2 2 2 | i | i | i−| i | i−| i → 00 + 01 + 10 11 0 √ 1 2 2 |0i−|1i →|11i √ . 2

The outcome of measuring the first 2 qubits yields |11i, which is the search target w =3. 

1.5.5 Shor’s factorization algorithm ([49]) RSA cryptosystem, due to R. Rivest, A. Shamir and R. Merkle, is the most widely used public key cryptosystem presently. Decoding of RSA-encrypted messages depends on the factorization of a composite integer that is a product of two large prime numbers. It is known that the integer factorization prob- lem is classically intractable. Given an integer N, the most efficient classical algorithm to date, number field sieve, has a time complexity of

O(exp (log N)1/3(log log N)2/3).

Shor’s quantum factorization algorithm has a time complexity of

O((log N)2 log log N log log log N).

Hence it is a polynomial time algorithm. We consider the integer factorization problem:

“Given a composite positive integer N, factorize it into the product of its prime factors.”

Shor’s algorithm utilizes several fundamental theorems in number theory. We refer the reader to a quite accessible account by Lomonaco [38], so that we can omit the number-theoretic prerequisite here and go ahead to describe how the Shor algorithm works, as follows. 1.5. QUANTUM ALGORITHMS 35

1. Choose a random integer a

(a) Prepare two L-bit quantum registers in initial state   2L−1 1 X √ |xi |0i, L 2 x=0

where L is chosen such that N 2 ≤ 2L < 2N 2. (b) Apply Uf : |xi|0i→|xi|fa,N (x)i:

2L−1 2L−1 1 X 1 X √ |xi|0i→√ |xi|fa,N (x)i L L 2 x=0 2 x=0

(c) Apply QFT to the first register:   2XL−1 2XL−1 2XL−1 1 1  2πixy/2L  √ |xi|fa,N (x)i→ e |yi |f(x)i L L 2 x=0 2 y=0 x=0

(d) Make a measurement on the first register, obtaining y. y (e) Find T from y via continued fractions for 2L . This step might fail– in that case, repeat (2a).

T/2 3. If T is odd, then repeat Step 1. If T is even and N|a +1, repeat Step 1. If T is even and N - aT/2 +1, compute d = gcd(aT/2 −1,N), which is a nontrivial factor of N. 36 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

|0i H |0i H |0i H QF T

|0i H

|0i |0i |0i a a2 a22 a2n−1

|0i

Figure 1.15: Quantum circuit for the Shor algorithm.

Example 1.5.5. Let N =15. Choose L =8such that N 2 = 225 < 2L < 450 = 2N 2. Choose a random integer a =2, which is coprime with 15. Thus x fa,N (x)=2 mod 15. The following sequence of quantum states shows the flow of computation utilizing Shor’s Algorithm:

2X8−1 | i| i→ 1 | i| i 0 0 4 x 0 2 x=0 2X8−1 → 1 | i| i 4 x fa,N (x) 2 x=0 1 = (|0i|1i + |1i|2i + |2i|4i + |3i|8i 24 + |4i|1i + |5i|2i + |6i|4i + |7i|8i + ... +|28 −2i|4i + |28 − 1i|8i) 2X8−1 2X8−1 → 1 1 xy| i| x i 4 4 ω y 2 mod 15 2 x=0 2 y=0 1.6. QUANTUM ADDER AND MULTIPLIER 37

2X8−1 2X8−1 → 1 | i xy| x i 8 y ω 2 mod 15 , 2 y=0 x=0

8 where ω = e2πi/2 . Suppose that the outcome of measuring the first n qubits is 56 |56i. We can compute the continued fraction of 256 to be [0, 4, 1, 1, 3] i.e., 56 1 =0+ . 256 1 4+ 1 1+ 1 1+ 3

4 4/2 The second number 4 satisfies 2 =1mod 15.So4is the period of fa,N ; 2 − 1=3yields a factor of 15 and 15 = 3 × 5. 

1.6 Quantum adder and multiplier

To show some basic quantum computer design concept, such as how the quan- tum computer performs elementary arithmetic operations of addition and mul- tiplication, in this section we illustrate the quantum networks of adder and multiplier design, based on Vedral, Barenco and Ekert [58], cf. also [46, §2.4]. First, consider the quantum adder. We need several basic circuits, as indi- cated in Figs. 1.16, 1.17 and 1.18.

i S i j j k i j k

S: |i,j,k |i,j, i j k , for i,j,k {0,1}

Figure 1.16: The quantum circuit for the S (sum) subroutine. 38 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

c i c i j C j k j k

c 0 c 0i jk c j c i k

|c ,j, j k, c jk c j c k C: |c i0 ,j,k,c i 0 ii ,

for c i,j,k, c 0 {0,1}

Figure 1.17: The quantum circuit for the C (carry) subroutine. Here c0 denotes the input carry bit (inherited from the preceding, lower qubits), while c0, origi- nally 0, at the output will be the next carry bit. The reader can easily check that the circuit works as intended.

c 1 c 1 −1 j C j k j k c c j c k jk 2 21

−1 C : |c 12 ,j,k,c |c1 ,j,j k, c2 j c1 k jk,

for c 1 ,j,k,c 2 {0,1}; −1 C C = I

−1 Figure 1.18: The quantum circuit for the C (reverse carry) subroutine. It corresponds to the inverse operation of C.

Using S, C and C−1 as described, then Fig. 1.19 provides the network for an n-bit quantum adder. The inputs are anan−1 ···a1a0 and 0bnbn−1 ···b1b0, and the outputs are anan−1 ···a1a0 and a + b. Note that the wire for bn+1 denotes a possible highest order carry qubit. Remark 1.6.1. The designs as given here ([58]) utilize only the CNOT and Tof- foli gates. They have the same complexity of the classical circuits and, thus, do not show any special advantage of quantum computing, when the adding operations involve only two integers. Quantum computing’s main advantages come from QC’s capability to uti- lize entanglement and then by achieving massive parallelism. For example, we illustrate how to add 2 to 0, 1, 3 and 5 in one adder operation. Write |ai = |010i (a=2in decimal representation), |bi = α1|000i+α2|001i+α3|011i+α4|101i, 1.6. QUANTUM ADDER AND MULTIPLIER 39

a 0 a 1 a a a . 2 . a n ADDER b 0 b . 1 b . a+b b n

0 = bn+1

c 0 = 0 c 0 = 0 a S a 0 −1 0 C C b 0 s 0

c 1 = 0 c 1 = 0 a S a 1 −1 1 C C b 1 s 1

c 2 = 0 c 2 = 0

a 2 S a 2 C −1 C b 2 s 2 c = 0 c 3 = 0 3

c = 0 c n−1 = 0 n−1 a a n−1 −1 S n−1 b C C n−1 s n−1 c = 0 n c n = 0 a S a n C n b n s n

bn+1 = 0 s n+1

s = sn+1 s n s n−1 ... s1 s 0 = a+b

Figure 1.19: Quantum adder network (given by [58]), where s = a + b is the sum of two binary numbers a and b. 40 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION where |bi is a superposition of quantum states corresponding to 0, 1, 3 and 5. By inputing |bi into the quantum adder, we will obtain the outcome

|ψi = α1|010i+α2|011i+α3|101i+α4|111i.

This shows some ideas why entanglement plays a crucial role in the speedup by QC.  Once we have understood the circuit design for the quantum ADDER, we can easily follow [58] to give the design of the quantum circuit for the (con- trolled) MULTIPLIER. The main idea of the MULTIPLIER design for perform- ing the multiplication of x·a, where x = xnxn−1 ···x1x0 and a = anan−1 ···a1a0, is based on addition:

0 1 2 n x · a = x02 · a + x12 · a + x22 · a + ···+xn2 ·a.

j−1 In Fig. 1.20, the top register entering ADDER j is exactly the number xj−12 · a, for j =1,2,...,n+1. Therefore, we obtain the desired outcome. In Figs. 1.20 and 1.21, by following [58] an extra control bit c is added, which can either activate (c =1)or deactivate (c = c) the entire circuit. Thus, this circuit is called the controlled multipliers. Also, note that the number a is not explicitly shown in the circuit Fig. 1.20. The matter of fact is that 2ja is generated by a set of Toffoli gates. This is illustrated in Fig. 1.21 in some detail. One can further design the exponentiation ax mod N quantum operation using the ADDER and MULTIPLIER circuits. Thus this and all the other quan- tum arithmetic operations require for the Shor algorithm can be carried out successively by the corresponding circuits.

       x          0   x     1  

  .

x n     c    c cc

    Ctrl−MULT  

ADDER ADDER ADDER  x 00x x x      . . .        0  y 0y  1 2 n+1    

Figure 1.20: Quantum circuit of a controlled multiplier design (adapted from [58]) for performing the multiplication x · a, where x and a have, respectively, binary representation xnxn−1 ···x1x0 and anan−1 ···a1a0. Details of the area framed within the dotted lines are given in Fig. 1.21. 1.7. QUANTUM ERROR CORRECTION CODES 41

            cc     

  x x   0 0 

    x 1    x1     .

x n xn

a0

a1

a2 0

0ADDER ADDER

a3

1 2 0 y

Figure 1.21: This circuit explains part of Fig. 1.5.4 with some details. We use a = |0011i as an example. The leftmost two Toffoli gates prepare a for ADDER1. Between ADDER1 and ADDER2, a set of four Toffoli gates prepares 2a for the top register if x1 =1. Otherwise if x1 =0, then what is prepared for the top register is just 0. To the right of ADDER2, the rightmost two Toffoli gates recover the top register to 0 and set it up for ADDER3.

1.7 Quantum error correction codes

1.8 Quantum computing devices and requirements

At present, several types of elementary quantum computing devices have been developed, based on AMO (atomic, molecular and optical) or semiconductor physics and technologies. We may roughly classify them into the following types:

atomic — ion and atom traps, cavity QED [11];

molecular — NMR;

semiconductor — coupled quantum dots [10], silicon (Kane) [32];

crystal structure — nitrogen-vacancy (NV) diamond;

superconductivity — SQUID. 42 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION

The above classification is not totally rigorous as new types of devices, such as quantum dots, or ion traps imbedded in cavity-QED, have emerged which are of the hybrid nature. Also, laser pulse control, which is of the optical nature, seems to be omnipresent. In [4], a total of 12 types of quantum computing proposals have been listed5.

5The additional proposals not listed above but given in [4] are quantum Hall qubits, electrons in liquid helium, and spin spectroscopies. 266 CHAPTER 1. INTRODUCTION TO QUANTUM COMPUTATION