• Keine Ergebnisse gefunden

Quantum Computing WS 2009/10

N/A
N/A
Protected

Academic year: 2021

Aktie "Quantum Computing WS 2009/10"

Copied!
33
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Quantum Computing WS 2009/10

Prof. Dr. Erich Grädel

Mathematische Grundlagen der Informatik RWTH Aachen

(2)

c b n d

This work is licensed under:

http://creativecommons.org/licenses/by-nc-nd/3.0/de/

Dieses Werk ist lizenziert unter:

http://creativecommons.org/licenses/by-nc-nd/3.0/de/

© 2015 Mathematische Grundlagen der Informatik, RWTH Aachen.

http://www.logic.rwth-aachen.de

Contents

1 Introduction 1

1.1 Historical overview . . . 1

1.2 An experiment . . . 2

1.3 Foundations of quantum mechanics . . . 3

1.4 Quantum gates and quantum gate arrays . . . 7

2 Universal Quantum Gates 19 3 Quantum Algorithms 25 3.1 The Deutsch-Jozsa algorithm . . . 25

3.2 Grover’s search algorithm . . . 27

3.3 Fourier transformation . . . 34

3.4 Quantum Fourier transformation . . . 42

3.5 Shor’s factorisation algorithm . . . 46

(3)

1 Introduction

1.1 Historical overview

The history of quantum computing started in 1982 when Nobel laure- ate Richard Feynman argued that certain quantum mechanical effects cannot be simulated efficiently by classical computers. This started a debate whether these effects (in particular the parallelism which occurs inherently in quantum mechanical processes) could be employed by building a quantum computer.

Between 1985 and 1993, in a series of papers, Deutsch, Bernstein- Vazirani, Yao, and others advanced the theoretical foundations of quan- tum computing by providing theoretical models such as quantum Tur- ing machines and quantum gate arrays as well as introducing complex- ity classes for quantum computing and several simple algorithms that could be performed by a quantum computer.

A breakthrough occurred in 1994 when Peter Shor published his factorisation algorithm for quantum computers, which runs in poly- nomial time. His algorithm relies on the so-calledquantum Fourier transformation, which we will introduce later. Another example of a quantum algorithm is Grover’s search algorithm (1996), that can find a needle in a haystackof sizeNin time O(√

N).

Despite these surprising results, quantum computing still faces several problems: There are not many more algorithms known besides the one we have mentioned, and a quantum computer of moderate size that can keep a stable state for a sufficient amount of time needs yet to be built. So far, one was only able to build a quantum computer consisting of 7qubits, which successfully factorised the number 15=3·5.

(4)

1 Introduction

1.2 An experiment

The following experiment can be conducted using easily accessible ingredients:

• a powerful light source (e.g. alaser),

• three polarisation filters, which polarise light horizontally, verti- cally, and with an angle of 45°, respectively.

If we put one or more of the polarisation filters in front of the light source, we will make the following observations:

(1) If only the horizontal polarisation filter (→) is put in front of the light source, 50% of light passes through.

(2) If the vertical polarisation filter (↑) is put in front of the horizontal filter, 50% of light passes through the first filter, but the remaining light gets blocked by the second filter.

(3) However, if the diagonal filter (↗) is put between→and↑, we can observe that, from the total light emitted by the source, 50% passes through the first filter, 25% passes through the first two filters, and 12.5% of the light passes through all three filters, after all.

To explain these results, we describe the polarisation state of a photon by a vector

|φ⟩:=α|↑⟩+β|→⟩

in a 2-dimensional vector space with basis{|↑⟩,|→⟩}. Since the direc- tion of such a vector is all that matters, we only considerunit vectors:

|α|2+|β|2 =1. Also note that the choice of the basis is arbitrary: In- stead of{|↑⟩,|→⟩}, one could also take{|↗⟩,|↘⟩}or, for that matter, any pair of orthogonal unit vectors.

Themeasurementof a state corresponds to the projection of such a vector with respect to an orthonormal basis, e.g.{|↑⟩,|→⟩}, which is given by the present equipment: If the vector|φ⟩=α|↑⟩+β|→⟩is measured, it is projected either to|↑⟩(with probability|α|2) or to|→⟩

(with probability|β|2).

1.3 Foundations of quantum mechanics

After the measurement, the vectorφis “destroyed”, i.e. it has been transformed into one of the basic states|↑⟩or|→⟩. There is no way to gain backφ, and each successive measurement gives the same result as the first one.

To each polarisation filter belongs a different orthonormal basis: If the angle of the filter isη, then the corresponding basis is

{sinη|↑⟩+cosη|→⟩, cosη|↑⟩ −sinη|→⟩}.

In particular, for both the horizontal and the vertical polarisation filter, the corresponding basis is{|↑⟩,|→⟩}, whereas for the diagonal filter↗, the basis is

{|↗⟩,|↘⟩}=n1

2(|↑⟩+|→⟩), 1

√2(|↑⟩ − |→⟩)o

The photons that, after the measurement, correspond to the polari- sation, pass through the filter; the others are reflected. Hence, filter→ projects 50% of the photons onto|→⟩and lets them pass; the other 50%

are projected onto|↑⟩and thus reflected. Filter↑, on the other hand, reflects all photons that are projected on|→⟩. Hence, no light passes through this filter if it is put behind filter→.

Filter↗projects a photon in state|→⟩= 1

2|↗⟩ −12|↘⟩with probability 12 onto |↗⟩. Hence, if filter↗is put in between filter→ and filter↑, then 25% of the photons pass through the first two filters and are subsequently in state|↗⟩. Since|↗⟩= 1

2|→⟩+1

2|↑⟩, half of these are projected by↑to|↑⟩and can pass through.

1.3 Foundations of quantum mechanics

In general, astateis a complete description of a physical system. In quantum mechanics, a state is a unit vector in aHilbert space.

Definition 1.1. AHilbert space His a vector space over the fieldCof complex numbers, equipped with aninner product

⟨· | ·⟩:H×H→C

(5)

1 Introduction

with the following properties:

• ⟨ψ|φ⟩=⟨φ|ψfor allψ,φ∈H(for a complex numberz=a+ib, itsconjugate zis defined byz=a−ib).

• ⟨ψ|ψ⟩ ≥0 for allψ∈H, and⟨ψ|ψ⟩=0 if and only ifψ=0 (the zero vector).

• ⟨ψ|αφ1+βφ2⟩ = αψ|φ1⟩+βψ|φ2⟩for all ψ,φ1,φ2 ∈ H and α,βC.

Note that, ifHis a Hilbert space, then∥·∥: H→C, defined by

ψ∥:=qψ|ψ

for allψ∈H, defines anormonH.

Remark1.2. For Hilbert spaces of infinite dimension, in which we are not interested here, it is also required thatHiscomplete(with respect to∥·∥), i.e. that any Cauchy sequence has a limit.

In quantum mechanics, a vectorψ∈His usually written inDirac notationas|ψ⟩(readketψ). However, the zero vector is denoted by 0 (not|0⟩, which might be a different vector). For a given vector|ψ⟩, its dual vectoris denoted by⟨ψ|(readbraψ). Formally,ψ|is the function fromHtoCthat maps a vector|φ⟩to the number⟨ψ|φ⟩.

Definition 1.3. Anorthonormal basis of a Hilbert space H is a basis {|e1⟩, . . . ,|en⟩}ofHsuch that

⟨ei|ej⟩=



1 ifi=j, 0 ifi̸=j,

for alli,j=1, . . . ,n. In particular,∥ei∥=1 for alli=1, . . . ,n.

The elementary building blocks of a classical computer are thebits, which can be in one of two states 0 or 1. In quantum computing, the elementary building blocks are thequbits; these are superpositions of two vectors|0⟩and|1⟩, which form a basis for the 2-dimensional Hilbert spaceH2. (Note that any two Hilbert spaces of the same dimension are isomorphic.)

1.3 Foundations of quantum mechanics

Definition 1.4. Given a basis|0⟩,|1⟩ofH2, aqubitis any vector|ψ⟩= α|0⟩+β|1⟩ ∈H2such that|α|2+|β|2=1.

If a qubit|ψ⟩=α|0⟩+β|1⟩ismeasured, then with probability|α|2 we obtain the state|0⟩, and with probability|β|2we obtain the state|1⟩. Moreover, any successive measurement leads to the same result. Hence, although a qubit can be in one of infinitely many states, we can only extractonebit of classical information. This process of extraction (the measurement) is, in fact, a probabilistic process.

Of course, a quantum computer will normally not only have access to one qubit but to many of them. A classical system with n bits comprises 2nstates 0· · ·0, 0· · ·1 up to 1· · ·1. Ann-qubit system, on the other hand, has 2nbasic states and can reside in any superposition

α0|0· · ·0⟩+α1|0· · ·1⟩+· · ·+α2n1|1· · ·1⟩

such that∑2i=0n−1|αi|2=1. Such systems are also calledquantum registers.

Then-qubit spaceH2n can be obtained fromH2 by an operation called thetensor product. Formally, ifVandWare Hilbert spaces, then V⊗W(readV tensor W) is a Hilbert space of dimension dimV⊗W= dimV·dimW. Any two vectors|ψ⟩ ∈ V and|φ⟩ ∈ W correspond to a vector|ψ⟩ ⊗ |φ⟩ ∈V⊗W, and this operation is compatible with addition and scalar multiplication:

• (|ψ1⟩+|ψ2⟩)⊗ |φ⟩=|ψ1⟩ ⊗ |φ⟩+|ψ2⟩ ⊗ |φ⟩;

• |ψ⟩ ⊗(|φ1⟩+|φ2⟩) =|ψ⟩ ⊗ |φ1⟩+|ψ⟩ ⊗ |φ2⟩;

α|ψ⟩ ⊗ |φ⟩=|ψ⟩ ⊗α|φ⟩=α(|ψ⟩ ⊗ |φ⟩).

In fact, if{v1, . . . ,vn}is a basis ofVand{w1, . . . ,wm}is a basis ofW, then{vi⊗wj : i=1, . . . ,n, j =1, . . . ,m}is a basis of V⊗W. Note that this space is different from theproduct space V×W, which is of dimension dimV+dimW. Instead of|ψ⟩ ⊗ |φ⟩, we also write|ψ⟩|φ⟩ or|ψφ⟩. We have

H2n=H2⊗ · · · ⊗H2

| {z }

ntimes

,

and {|0· · ·0⟩,|0· · ·1⟩, . . . ,|1· · ·1⟩} is a basis of H2n. Note that

(6)

1 Introduction

dimH2n=2n. Hence, the dimension of the system grows exponentially in the number of qubits.

As opposed toH2×H2, not every state inH2⊗H2can be decom- posed into two states ofH2. We call such statesentangled.

Proposition 1.5. There exists a unit vector|ψ⟩ ∈ H2⊗H2 such that

|ψ⟩ ̸=|φ1⟩ ⊗ |φ2⟩for any two vectors|φ1⟩,|φ2⟩ ∈H2.

Proof. Consider, for example,|ψ⟩:= 12(|00⟩+|11⟩), and assume that there exists|φ1⟩,|φ2⟩ ∈ H2 with|ψ⟩ =|φ1⟩ ⊗ |φ2⟩. Then there exist α1,α2,β1,β2Csuch that|φi⟩=αi|0⟩+βi|1⟩fori=1, 2. Hence,

|ψ⟩= (α1|0⟩+β1|1⟩)⊗(α2|0⟩+β2|1⟩)

=α1α2|00⟩+α1β2|01⟩+α2β1|10⟩+β1β2|11⟩

Since{|00⟩,|01⟩,|10⟩,|11⟩}forms a basis ofH2⊗H2, we haveα1β2= α2β1=0. But then, alsoα1α2=0 orβ1β2=0, a contradiction. q.e.d.

In ann-qubit system, each qubit can be measured separately. The measurement of the first qubit of ann-qubit state|ψ⟩=v∈{0,1}nαv|v⟩ can have two outcomes:

• With probabilityp=w∈{0,1}n−1|α0w|2, the result of the measure- ment is|0⟩, and|ψ⟩is projected onto the vector

|0⟩ ⊗√1p

w∈{0,1}n−1

α0w|w⟩.

• With probabilityq=∑w∈{0,1}n−1|α1w|2, the result of the measure- ment is|1⟩, and|ψ⟩is projected onto the vector

|1⟩ ⊗√1q

w∈{0,1}n−1

α1w|w⟩.

A quantum-mechanical system evolves throughunitary transforma- tions. Formally, a linear operatorU: H→H:|ψ⟩ 7→U|ψ⟩is unitary if it preserves the inner product:

⟨Uψ|Uφ⟩=⟨ψ|φ

1.4 Quantum gates and quantum gate arrays

For the presentation of an operator by a matrixU⊆Cn×nthis means thatUU =UU =I (the identity matrix), whereUis theconjugate transposeofU, i.e. the matrix that results fromU by transposing U and replacing each entry by its conjugate. In particular, every unitary transformation is invertible, i.e.reversible.

Finally, we can postulate that any computation of a quantum computer consists of reversible building blocks (combined with mea- surements). This imposes a serious limitation on quantum computers.

For example, this implies that no quantum computer can simply copy around some qubits.

Theorem 1.6 (No-Cloning Theorem). Let H be any Hilbert space of dimensionn>1. There does not exist a unitary transformation Copy : H⊗H → H⊗H and a vector|0⟩ ∈ H such that Copy(|ψ⟩ ⊗ |0⟩) =

|ψ⟩ ⊗ |ψ⟩for allψ∈H.

Proof. Assume that Copy and|0⟩exist. Sincen>1, there exists a unit vector|1⟩that is orthogonal to|0⟩. Letψ= 1

2(|0⟩+|1⟩). We have:

Copy(|ψ⟩|0⟩) = √1

2(Copy(|0⟩|0⟩) +Copy(|1⟩|0⟩))

=√1

2(|0⟩|0⟩+|1⟩|1⟩)

The latter vector is different from|ψ⟩|ψ⟩=12(|00⟩+|01⟩+|10⟩+|11⟩),

a contradiction. q.e.d.

1.4 Quantum gates and quantum gate arrays

Definition 1.7. Aquantum gateon mqubits is a unitary transforma- tionU : H2m → H2m on the Hilbert space H2m = H2⊗ · · · ⊗H2 of dimension 2m.

Form=1, a quantum gate is a unitary transformationU:H2→ H2. Consider the standard basis|0⟩,|1⟩ofH2. The transformationUis uniquely determined by its behaviour on the basis vectors:

U:|0⟩ 7→a|0⟩+b|1⟩

(7)

1 Introduction

|1⟩ 7→c|0⟩+d|1⟩,

As usual in linear algebra, we write these vectors as column vectors(ba) and(dc), respectively. Hence, the application ofUon the basis vectors

|0⟩= (10)and|1⟩= (01)corresponds to a multiplication of the matrix a c

b d

!

with these vectors. ThatUis unitary is expressed by the matrix equation a b

c d

! a c b d

!

= 1 0 0 1

!

Example1.8.

(1) Thenotgate is given by the matrix M¬= 0 1

1 0

! .

We haveM¬|0⟩=|1⟩andM¬|1⟩=|0⟩. (2) Consider the matrix

M= 1 2

1+i 1−i 1−i 1+i

! . Mis unitary since

MM= 1 4

1−i 1+i 1+i 1−i

! 1+i 1−i 1−i 1+i

!

= 1 4

2(1−i2) (1−i)2+ (1+i)2 (1−i)2+ (1+i)2 2(1−i2)

!

= 1 0 0 1

! . Moreover, we have

1.4 Quantum gates and quantum gate arrays

M2=1 4

1+i 1−i 1−i 1+i

!2

= 0 1 1 0

!

=M¬. Hence,Mis a square root ofM¬, and we writeM=√

M¬. (3) TheHadamard transformationis given by the matrix

H= √1 2

1 1

1 −1

! .

It transforms the standard basis |0⟩,|1⟩ into the Hadamard basis (also called theFourier basis)

|0⟩=H|0⟩=√1

2(|0⟩+|1⟩)

|1⟩=H|1⟩=√1

2(|0⟩ − |1⟩) (see Section 1.2) and back:

H|0⟩=H 1/√

2 1/√

2

= 1

0

=|0⟩ H|1⟩=H1/√

2 1/√

2

= 0

1

=|1⟩

We denote the operation of a quantum gateUon 1 qubit as follows:

1 U

Other important gates on 1 qubit are S= 1 0

0 i

!

(Phase) and

T= 1 0

0 eiπ/4

! .

Note that S=T2.

(8)

1 Introduction

Form =2, we are dealing with 2-qubit gates, which are of the formU:H4 →H4. The standard basis ofH4is|00⟩,|01⟩,|10⟩,|11⟩, or as coordinates

1

00 0

,

0

10 0

,

0

01 0

,

0

00 1

.

Example1.9. Thecontrolled notgate (cnot) is given by the matrix

Mcnot=





1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0





We have:

Mcnot|00⟩=|00⟩, Mcnot|01⟩=|01⟩, Mcnot|10⟩=|11⟩, Mcnot|11⟩=|10⟩.

Hence,Mcnot|ij⟩=|i⟩ ⊗ |i⊕j⟩(⊕denotesexclusive or, i.e.i⊕j=1 if and only ifi̸=j). The operation ofcnoton 2 qubits is denoted as follows:

1

2

In general, ifUis a unitary transformation on 1 qubit, then we can define a unitary transformationc-U(readcontrolled U) on 2 qubits as follows:

c-U|ij⟩=|i⟩ ⊗



U|j⟩ ifi=1,

|j⟩ ifi=0.

Graphically, this operation is denoted as follows:

1.4 Quantum gates and quantum gate arrays

1

2 U

IfUis represented by the matrix(b da c), thenc-Uis represented by the matrix





1 0 0 0 0 1 0 0

0 0 a c

0 0 b d





.

Form=3, an interesting gate isc-cnot, better known as theToffoli gateTf, which is defined as follows:

Tf|ijk⟩=|ij⟩ ⊗ |ij⊕k⟩. The corresponding matrix is

















1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0















 .

Graphically, this operation is denoted as follows:

1

2

3

(9)

1 Introduction

Of course, it is also possible to consider the Toffoli gate as a classical gate

Tf :{0, 1}3→ {0, 1}3: (i,j,k)7→(i,j,ij⊕k).

In fact, every classical circuit can be simulated by a circuit consisting of Tf gates only. For f :{0, 1}n→ {0, 1}nconsider the reversible function f:{0, 1}n× {0, 1}n→ {0, 1}n× {0, 1}n:(x,y)7→(x,f(x)⊕y). We show that any reversible function can be computed by a circuit consisting of Tf gates.

More formally, we say that a setΩof reversible gates iscomplete (for classical reversible computation) if, given any reversible function g:{0, 1}n→ {0, 1}n, we can construct a circuit consisting of gates inΩ only that computes a functionh:{0, 1}n× {0, 1}k→ {0, 1}n× {0, 1}k such that for a fixedu∈ {0, 1}kwe have

h(x,u) = (g(x),v) for allx∈ {0, 1}n.

Theorem 1.10. {Tf}is complete (for classical reversible computation).

Proof. We use the fact that every function can be computed by (classical) circuit consisting ofnandgates. Then, we can replace eachnandgate with inputsxandyby a Toffoli gate with inputsx,yand 1 (Note that xy⊕1=¬(x∧y)):

x

y ¬(xy)

nand

x

y

1

x

y

xy1 Similarly, we can replace every branching with inputxby a Toffoli gate with inputs 1,xand 0 (Note thatx⊕0=x):

1.4 Quantum gates and quantum gate arrays

x

x

x

1

x

0

1

x

x0

q.e.d.

Recall thatc-UexecutesU on the target qubit if and only if the control qubit is set to 1:

1

2 U

We can switch the gate’s behaviour by introducing two¬gates:

1

2 U

= 1

2

¬ ¬

U

The resulting operation executesUif the control qubit is set to 0:

|ij⟩ 7→ |i⟩ ⊗



U|j⟩ ifj=0,

|j⟩ ifj=1.

Formally, the parallel execution of two unitary transformations corresponds to a tensor product of their matrices.

Definition 1.11. Let

A=





a11 · · · a1n ... ... am1 · · · amn



, B=





b11 · · · b1s ... ... ar1 · · · brs





(10)

1 Introduction

be two matrices of sizesm×nandr×s, respectively. The matrix

A⊗B:=







a11B a12B · · · a1nB a21B a22B · · · a2nB ... ... ... am1B am2B · · · amnB







of sizemr×nsis called thetensor productofAandB.

Proposition 1.12. Let Aand B be two 2×2 matrices that represent quantum gates on one qubit. Then, the simultaneous action ofAon the first andBon the second qubit is represented byA⊗B.

Proof. We have to check what the simultaneous action of AandBdoes to the basis vectors|00⟩,|01⟩,|10⟩and|11⟩ofH4. If

A= a00 a01 a10 a11

!

andB= b00 b01 b10 b11

! , then the basis vector|ij⟩is mapped to

A|i⟩ ⊗B|j⟩= (a0i|0⟩+a1i|1⟩)⊗(b0j|0⟩+b1j|1⟩)

=a0ib0j|00⟩+a0ib1j|01⟩+a1ib0j|10⟩+a1ib1j|11⟩ Hence, in the matrix representing this operation the column correspond- ing to|ij⟩is





 a0ib0j a0ib1j

a1ib0j a1ib1j





This is indeed the column that corresponds to|ij⟩in

1.4 Quantum gates and quantum gate arrays

A⊗B=





a00b00 a00b01 a01b00 a01b01

a00b10 a00b11 a01b10 a01b11 a10b00 a10b01 a11b00 a11b01 a10b10 a10b11 a11b10 a11b11





.

q.e.d.

This correspondence does not only hold for transformations onH2

but for transformation on any Hilbert space: IfAand Bare unitary transformation on two Hilbert spacesVandW, thenA⊗Bdefines the unitary transformation onV⊗Wthat corresponds to the simultaneous (or sequential) composition of Aand B(the order does not matter).

Moreover,A⊗Bdoes not introduce any entanglement.

Example1.13. LetA=B=H the Hadamard transformation. Then H⊗H=√1

2

1 1

1 −1

!

⊗√1 2

1 1

1 −1

!

=1 2





1 1 1 1

1 −1 1 −1

1 1 −1 −1

1 −1 −1 1





,

and

(H⊗H)|ij⟩=1

2 |00⟩+ (−1)j|01⟩+ (−1)i|01⟩+ (−1)i+j|11⟩

=1

2 |0⟩+ (−1)i|1⟩)⊗(|0⟩+ (−1)j|1⟩,

a non-entangled state, which is not a surprise given that |ij⟩ is not entangled and that H⊗H stands for the simultaneous action of H on each qubit.

On the other hand,Mcnot cannot be represented as a tensor prod- uct of two 2×2 matrices. To see this, consider the operation ofMcnot

on the non-entangled state|ψ⟩=1

2(|0⟩+|1⟩)⊗ |0⟩= 1

2(|00⟩+|10⟩). We have Mcnot|ψ⟩ = 1

2(|00⟩+|11⟩), and we know that this is an

(11)

1 Introduction

entangled state. Hence, Mcnot cannot possibly be equal to a tensor product of two 2×2 matrices.

Let us revisit the Hadamard transformation H, defined by the matrix

H= √1 2

1 1

1 −1

! , and consider the operation

Hn=H| ⊗ · · · ⊗{z H}

ntimes

onnqubits. We have:

H⊗n|0 . . . 0⟩=H|0⟩ ⊗ · · · ⊗H|0⟩

= √1

2n (|0⟩+|1⟩)⊗ · · · ⊗(|0⟩+|1⟩)

= √1 2n

x∈{0,1}n

|x⟩.

Hence, the first basis vector |0 . . . 0⟩ is transformed into a uniform superposition of all the 2nbasis vectors. Graphically, this operation is denoted as follows:

1 2 ... n

H H ... H

Definition 1.14. Let Ω be a set of quantum gates. A quantum gate array (QGA) (or a quantum circuit) on n qubits over Ω is a unitary transformation, which is composed out of quantum gates inΩ.

Note that mathematically there is no difference between a quantum gate and a QGA: both are unitary transformations. The idea is that,

1.4 Quantum gates and quantum gate arrays

while a QGA may operate on a large number of qubits, a quantum gate may only operate on a small number of qubits.

The basic step in building a quantum gate array is letting a single gateUoperate on a selected number of qubits, say the qubitsi1, . . . ,im. Mathematically, this operation (onnqubits) can be described by the unitary transformation

P−1i1...im(U⊗I2n−m)Pi1...im

where I2n−m is the identity mapping onH2n−mand Pi1...imis the transfor- mation that permutes the qubits 1, . . . ,mwith the qubitsi1, . . . ,im.

1 ... i1

... im

... n

U

Example1.15. Consider the following QGA consisting of Hadamard and cnotgates:

1

2

H H

H H

The corresponding unitary transformation isU = H2·Mcnot·H2. We claim thatU=P−121 McnotP21, the operation ofMcnoton the qubits 2 and 1 (instead of 1 and 2). LetM=Mcnot. Then:

U|ij⟩=H⊗2·M1

2 |0⟩+ (−1)i|1⟩⊗ |0⟩+ (−1)j|1⟩

=H2·M1

2 |00⟩+ (−1)j|01⟩+ (−1)i|10⟩+ (−1)i+j|11⟩

(12)

1 Introduction

=H21

2 |00⟩+ (−1)j|01⟩+ (−1)i+j|10⟩+ (−1)i|11⟩

=H⊗2H⊗2 |i⊕j⟩ ⊗ |j⟩

=|i⊕j⟩ ⊗ |j⟩

2 Universal Quantum Gates

Consider then-arycontrolled operationcn-Udefined by

cn-U|i1. . .inj⟩=|i1. . .in⟩ ⊗



U|j⟩ ifi1, . . . ,in=1,

|j⟩ otherwise.

How can we implement a complicated operation such ascn-Uusing simple gates such as Tf andc-U? The idea is to introduce a certain number ofcontrol qubits, which are initially set to 0. Then, we can implementcn-Uas follows (the right part of the array resets the work qubits to 0):

1 2 3 4 5

|0

|0

|0

|0

6 U

(13)

2 Universal Quantum Gates

In fact, we can build up the Toffoli gate Tf from the two-qubit gates c-V,c-V−1andc-M¬, where

V=√ M¬=1

2

1+i 1−i 1−i 1+i

! , as follows:

=

V V1 V

To see this, note that the gate on the right maps |ijk⟩ to |ij⟩ ⊗

|f(i,j,k)⟩, where

|f(i,j,k)⟩=













|k⟩ if|ij⟩=|00⟩, V1V|k⟩=|k⟩ if|ij⟩=|01⟩, VV−1|k⟩=|k⟩ if|ij⟩=|10⟩, VV|k⟩=|k⊕1⟩ if|ij⟩=|11⟩

=|ij⊕k⟩.

Lemma 2.1. Tf is computable by a QGA over{H,c-M¬, S, T, T−1}(see Figure 2.1).

Proof. By calculation. q.e.d.

The general question here is which gates are sufficient for building arbitrary unitary transformations. We will show that a QGA can be approximatedarbitrarily well by a QGA that consists of Hadamard,cnot and T gates only. More precisely, we will show that

(1) every unitary transformationUcan be written as a productU= Um. . .U1of unitary operatorsUithat operate nontrivially only on a two-dimensional subspace ofH2n (generated by two vectors of the standard basis).

= HT1TT1

T1 TH

T1

T S

Figure 2.1.An implementation of the Toffoli gate over{H,c-M¬, S, T, T1}.

(14)

2 Universal Quantum Gates

(2) every unitary transformation can be composed from cnot and quantum gates that operate on one qubit only;

(3) 1-qubit quantum gates can be approximated arbitrarily well using H and T.

To prove (1), consider a unitary transformationU : Hm → Hm

described by a unitary(m×m)-matrix.

Lemma 2.2. Uis a product of unitary matrices of the form













1...

1a c

1...

b 1d

1...

1













 .

Proof. Consider, for instance,m=3 and

U=



a d g b e h c f j



.

Ifb=0, setU1=I. Otherwise, set

U1=



a δ b b δ δaδ

1



,

whereδ=p|a|2+|b|2. The matrixU1is unitary, andU1·Uis of the form

U1·U=



a d g 0 e h c f j



.

Ifc=0, setU2= a′ ∗

11

. Otherwise, set

U2=p 1

|a|2+|c|2



a′∗ 0 c′∗

0 1 0

c 0 −a



.

The matrixU2U1Uis unitary and of the form

U2U1U=



1 d′′ g′′

0 e′′ h′′

c f′′ j′′



.

SinceU2U1Uis unitary, we haved′′=g′′=0. Finally, set

U3=



 1

e′′∗ f′′∗

h′′∗ j′′∗



.

We haveU3U2U1U=I, soU=U1U2U3, and eachUiis of the desired form.

In general, we are able to find matrixesU1, . . . ,Ukof the desired form such thatUk. . .U1U=I, wherek≤(m−1) + (m−2) +· · ·+1=

m(m1)

2 . q.e.d.

Corollary 2.3. A unitary transformation onnqubits is equivalent to a product of at most 2n−1(2n−1−1) unitary matrices that operate nontrivially only on a 2-dimensional subspace ofH2n (generated by two vectors of the standard basis).

Remark2.4. The exponential blowup incurred by this translation is not avoidable.

We can now turn towards proving (2).

Lemma 2.5. Let U : H2n → H2n be a unitary transformation that operates nontrivially only on the subspace ofH2n generated by|x⟩=

|x1. . .xn⟩ and |y⟩ = |y1. . .yn⟩. Then U is a product of cnot and 1-qubit gates.

(15)

2 Universal Quantum Gates

Proof (Sketch). LetVbe the nontrivial, unitary(2×2)-submatrix ofU.

Vcan be viewed as a 1-qubit gate. Recall that, for eachn, the opera- tioncn-Vcan be implemented using Tf (which can be built fromcnot and single qubit gates) andc-V. The gatec-V, on the other hand, can be implemented usingcnotand single qubit operations (see Nielsen &

Chuang,Quantum Computation and Quantum Information, Section 4.3).

Fix a sequence|z1⟩, . . . ,|zm⟩of basis vectors such that|z1⟩=|x⟩,

|zm⟩=|y⟩, and|zi⟩differs from|zi+1⟩on precisely one qubit. The idea is to implementUas a productU=P1· · ·Pm−1(c-V)Pm−1· · ·P1. The matrixPimaps|zi⟩to|zi+1⟩and vice versa, andc-Vis the operation ofVon the qubit that distinguishes|zm1⟩and|zm⟩, controlled by all other qubits. Note that Pm−1· · ·P1 maps|x⟩ to|y⟩, and P1· · ·Pm−1 maps |y⟩ back to |x⟩. As we have seen, c-V and each Pi can be implemented usingcnotand 1-qubit gates. q.e.d.

Finally, we can discuss (3), the reduction of arbitrary 1-qubit gates to H and T. Note that there exist uncountably many unitary transfor- mationsU :H2n →H2n, but from a finite (or even countably infinite) set of gates, we can only compose countably many QGAs. Hence, there is no way of representing every 1-qubit gateexactlyusing a fixed finite set of gates. However, an approximationis possible! For two unitary transformationsUandV, we define

E(U,V):= max

∥|ψ⟩∥=1∥(U−V)|ψ⟩∥.

Definition 2.6. A setΩof quantum gates isuniversalif for any QGAU and everyε>0, there is a QGAVconsisting only of gates fromΩsuch that E(U,V)≤ε.

Theorem 2.7(Solvay-Kitaev). For every QGAUconsisting ofmcnot or 1-qubit gates and for every ε > 0, there exists a QGAV of size O(m·logc mε),c≈2, consisting ofcnot, H and T gates only such that E(U,V)≤ε.

3 Quantum Algorithms

3.1 The Deutsch-Jozsa algorithm

Suppose that your task is to decide whether a function f :{0, 1}n→ {0, 1}is either constantly equal to 0 or it isbalanced, i.e. f(x) =1 for precisely half of all inputsx∈ {0, 1}n(either one of these two cases is guaranteed to hold). If you decide correctly, you are awarded 1 000€.

On the other hand, a false answer is fatal. To help you find the right answer, you can repeatedly ask for the value of f for a given inputx.

Each such query will set you back 2€.

Classically, there is a good chance to find the right answer by drawing an inputxuniformly at random. Clearly, iff(x) =1, you can be sure that f is balanced. On the other hand, if f is balanced, then the probability that f(x) =0 forkinputs, chosen uniformly at random, is 1/2k, which converges to 0 exponentially fast. However, unless you query more than 2n−1 many inputs or get the answer that f(x) =1, you cannot be sure of your answer.

Suppose now that you may query a QGA on n+1 qubits for computing the functionUf defined by1

Uf|x⟩|j⟩=|x⟩|f(x)⊕j⟩.

Clearly, QGAs are more expensive than classical circuits, so let us say that each application ofUf costs 500€. Can you get the correct answer and still make money in this case?

Surprisingly, the answer isyessince there exists a QGA that decides whether fis balanced with just one application ofUf:

1Note thatUfhas to be unitary.

(16)

3 Quantum Algorithms

|0n

|1

Hn

H

Uf

Hn

Measurement

Let us examine what the circuit does: First, the vector|0n⟩ ⊗ |1⟩is mapped by H⊗n+1to

√1

2n+1

x∈{0,1}n

|x⟩ ⊗(|0⟩ − |1⟩).

Second, the QGA forUfis applied to this vector, which yields the vector

√1

2n+1

x∈{0,1}n

|x⟩ ⊗(−1)f(x)(|0⟩ − |1⟩)

=

x∈{0,1}n

(−1√)f(x)|x⟩ 2n

⊗|0⟩ − |√ 1⟩ 2

=

x∈{0,1}n

(−1)f(x)|x⟩

√2n

| {z }

=:|ψf

⊗H|1⟩

To see what is the result of Hn|ψf⟩, note that forx∈ {0, 1}, we can write H|x⟩as follows:

H|x⟩=√1

2 |0⟩+ (−1)x|1⟩

=√1

2

z∈{0,1}

(−1)xz|z⟩.

Analogously, forx=x1· · ·xn∈ {0, 1}n, we have Hn|x⟩= √1

2n

z=z1···zn∈{0,1}n

(−1)x1z1+···+xnzn|z⟩

= √1 2n

z∈{0,1}n

(−1)x·z|z⟩.

3.2 Grover’s search algorithm

Hence,

H⊗n|ψf⟩= √1 2n

x∈{0,1}n

(−1)f(x)H⊗n|x⟩

= 1 2n

x∈{0,1}n

z∈{0,1}n

(−1)f(x)+x·z|z⟩

= 1 2n

z∈{0,1}n

x∈{0,1}n

(−1)f(x)+x·z|z⟩.

In particular, the amplitude of the basis vector |0n⟩ in Hn|ψf⟩ is

21nx∈{0,1}n(−1)f(x). If f ≡0, then this amplitude is equal to 1 and, with probability 1, the final measurement yields|0n⟩. On the other hand, if f is balanced, then the amplitude of|0n⟩is 0 and, with probability 1, the final measurement yields a basis vector different from|0n⟩.

3.2 Grover’s search algorithm

While the Deutsch-Jozsa algorithm arguably solves an artificial problem, Grover’s algorithm solves a canonical search problem: This time, the task is to find, given an arbitrary Boolean function f :{0, 1}n→ {0, 1}, an inputxwith f(x) =1 (or to determine that there is no such input).

Classically, there is no better way than to test each input, which requires 2nqueries to f in the worst case. Grover showed that if one has access to a QGA for computing the function

Uf :H2n+1 →H2n+1|x⟩ ⊗ |j⟩ 7→ |x⟩ ⊗ |f(x)⊕j⟩,

then one can build a quantum algorithm that finds anxwith f(x) =1 in time O(√

2n).

Our first approach is to apply a Hadamard transformation to|0n⟩to obtain a superposition of all inputs and then to applyUf on H⊗n|0n⟩ ⊗

|0⟩. The resulting vector is ψ:= √1

2n

x∈{0,1}n

|x⟩ ⊗ |f(x)⟩.

(17)

3 Quantum Algorithms

Can we measure|ψ⟩to find an inputxwith f(x) =1? For eachxwith f(x) =1, the amplitude of|x1⟩ in|ψ⟩is 12n. Hence, if for instance there is only one suchx, then a measurement ofψwill very likely not find this x. The idea of the algorithm is to apply a transformation on|ψ⟩that makes the amplitudes of the basis vectors|x1⟩much larger while making those of|x0⟩ smaller. After this transformation, with high probability a measurement of the last results in a basis vector of the form|x1⟩, i.e. f(x) =1. If the measurement fails and we obtain a vector|x0⟩, we just repeat the process.

It turns out that this idea can be made to work using a modified approach, where we applyUf not to H⊗n|0n⟩ ⊗ |0⟩, but to H⊗n|0n⟩ ⊗ H|1⟩. As in the Deutsch-Jozsa algorithm, the resulting vector is|ψf⟩ ⊗ H|1⟩, where

|ψf⟩=

x∈{0,1}n

(−1√)f(x)|x⟩ 2n .

LetVf the transformation on the firstnqubits defined byUf, œ Vf|x⟩= (−1)f(x)|x⟩.

For|ψ⟩=xax|x⟩, we have Vf|ψ⟩=

x:f(x)=0

ax|x⟩ −

x:f(x)=1

ax|x⟩.

For|ψ⟩=xax|x⟩, letA:=2nxaxtheaverage amplitude. Consider the transformationDthat maps|ψ⟩to the vector∑x(2A−ax)|x⟩. The corresponding matrix is

D=







22n −1 22n · · · 22n

22n 2

2n −1 22n

... ... ...

22n 2

2n · · · 22n −1





 .

To see this, consider a basis vector|y⟩ =xδxy|x⟩ (whereδxy =1 if

3.2 Grover’s search algorithm

x=yandδxy=0 otherwise). The average amplitude of|y⟩isA=21n. Hence,D|y⟩= 22n−1

|y⟩+x̸=y22n|x⟩. Lemma 3.1. D=Hn·Rn·Hnwith

Rn=



11

1

...1



.

Note thatRncan be implemented using O(n)simple gates.

Proof. Consider the matrix

R=Rn+In=

20

...0

.

We claim that

Hn·Rn·Hn= 2 2n

1 1··· 1 1 1··· 1

... ... ...

1 1··· 1

,

i.e. H⊗n·Rn·H⊗n|x⟩= 22ny|y⟩for allx∈ {0, 1}n:

|x⟩7−→H⊗n1 2n

z(−1)x·z|z⟩

Rn

7−→ √1 2n

z(−1)x·zRn|z⟩= √2 2n|0⟩

H⊗n

7−→ 22n

y |y⟩. Finally,

H⊗n·Rn·H⊗n=H⊗n(Rn−In)H⊗n

=H⊗n·RnH⊗n−H⊗n·In·H⊗n

=H⊗n·RnH⊗n−In

=D. q.e.d.

(18)

3 Quantum Algorithms

For a given functionf:{0, 1}n→ {0, 1}, Grover’s search algorithm iterates theGrover operator G:=D·Vf sufficiently oftenon input Hn|0⟩ in order to magnify the amplitudes of the basis vectors|x⟩withf(x) =1.

But what do we mean bysufficiently often?

Consider the setsT={x: f(x) =1}andF={x: f(x) =0}. Af- ter r iterations ofG, the resulting vector will be of the form|ψr⟩ = trxT|x⟩+ frxF|x⟩ with average amplitude Ar = 21n(−tr|T|+

fr(2n− |T|)). Now,

|ψr+1⟩=G|ψr

=DVf tr

xT|x⟩+fr

xF|x⟩

=D

−tr

xT|x⟩+fr

xF|x⟩

= (2Ar+tr)

x∈T|x⟩+ (2Ar−fr)

x∈F|x⟩. Hence,

tr+1=2Ar+tr=1−2|T| 2n

tr+2−2|T| 2n

fr;

fr+1=2Ar−fr=−2|T|

2n tr+1−2|T| 2n

fr.

This means that the coefficientstrand frsatisfy the following recursion:

tr+1 fr+1

!

= 1δ 2−δ

δ 1−δ

! tr

fr

!

, (3.1)

whereδ= 2|T|2n .

To compute the effect of the iterated application ofGon Hn|0n⟩, we have to solve (3.1) under the initial conditiont0= f0= 1

2n. Since G is unitary, we have ∥G|ψ⟩∥ = ∥ψ∥, i.e. |T|t2r + (2n− |T|)fr2 = 1 for all r ∈ N. Hence, there exist ϑr such that tr = √1

|T|sinϑr and fr= √ 1

2n−|T|cosϑr.

The Grover operatorGcan be interpreted geometrically as a rota-

3.2 Grover’s search algorithm

tion in the 2-dimensional space that is generated by the vectors

|φ+⟩= p1

|T|

x∈T|x⟩,

|φ⟩= p 1 2n− |T|

x∈F|x⟩. We have

|ψ0⟩= √1 2n

x |x⟩

= r|T|

2n|φ+⟩+

r2n− |T| 2n |φ

=sinϑ0|φ+⟩+cosϑ0|φ⟩.

Now, the Grover operator applied first performs a reflection across|φ⟩ followed by a reflection across|ψ0⟩. The resulting operation is a rotation by 2ϑ0towards|φ+⟩. Hence,ϑr= (2r+1)ϑ0for allr∈N.

In order for the final measurement to yield |x⟩ with x∈ T, we need thatϑrπ2 (so that|ψr⟩is close to|φ+⟩). Solving the equation (2r+1)ϑ0= π2, we obtainr= π012. Hence, forϑ0≈sinϑ0=

q|T|

2n, we can expect thatr =π4q|T|2n iterations suffice to find a solution with high probability. More precisely, we have the following theorem.

Theorem 3.2. Let f: {0, 1}n→ {0, 1}andm:=|{x: f(x) =1}|such that 0 < m ≤ 34 ·2n, and let ϑ0 < π3 such that sinϑ0 = 2mn. After π

0

iterations ofG on |ψ0⟩ = 1

2nx∈{0,1}n|x⟩, a measurement of the resulting vector yields a basis vector|x⟩such that f(x) =1 with probability≥ 14.

Proof. For|ψr⟩ = sin((2r+1)ϑ0)|φ+⟩+cos((2r+1)ϑ0)|φ⟩, we de- note by p(r) := sin2((2r+1)ϑ0) the probability of a projection onto |φ+⟩. (This is precisely the probability with which a measure- ment of |ψr⟩ results in a basis vector |x⟩ such that f(x) = 1.) Let δ∈(0,12]such that π

0

= π012+δ. Since|2δϑ0| ≤ |ϑ0| ≤ π3, we

Abbildung

Figure 2.1. An implementation of the Toffoli gate over { H, c-M ¬ , S, T, T − 1 } .

Referenzen

ÄHNLICHE DOKUMENTE

qualitative market research, models of consumer behaviour, world of meaning, world of probability, unconscious clustering method, cybernetics... Some Methodological

Perceiving a demand for a more permanent network and inspired by the successful Section on Ethics of the American Society for Public Administration (ASPA), a

Regarding the origin of the positive core level shift ob- served for the deposited Si 7 clusters with respect to the bulk value, one may argue that the deposition of magic

As was noted in the previous section, it is not always clear whether a general equilibrium system of equations has a unique solution or a solution at all. A numerical approach to

If we ask whether the normal set is a member of the category known as the super-normal set- the set of ALL individual sets which are NOT members of themselves- the answer must be

Statistical test details of differences in the average cooperation level in the prisoner’s dilemma games of the static-network treatment (STATIC) and the three

It turns out that a serious source of possible qubit er- rors using semiconductors such as GaAs is the hyperfine coupling between electron spin (qubit) and nuclear spins in the

The term Neocolonialism can combine a critique of current actual colonialism (where some states continue administrating foreign territories and their popu- lations in