• No results found

Quantum Algorithms and the Hidden Subgroup Problem

N/A
N/A
Protected

Academic year: 2021

Share "Quantum Algorithms and the Hidden Subgroup Problem"

Copied!
70
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Quantum Algorithms and the

Hidden Subgroup Problem

Catherine M. V. Vermeulen

2014

Undergraduate Dissertation BSc in Physics and Astronomy

Institute for Theoretical Physics, University of Amsterdam

Supervised by Prof. E.P. Verlinde

Assessed by Prof. E.P. Verlinde and Prof. C.J.M. Schoutens

Basiselementen | Logo

huisstijlrichtlijnen Universiteit van Amsterdam

Het beeldmerk van de UvA bestaat uit een exact vierkant waarin diapositief een 'U' met drie kruisen staat. De tekening is 100% wit en het blok is 100% zwart. Het woordmerk van de UvA is de naam 'Universiteit van Amsterdam'. In Engelstalige publicaties wordt 'University of Amsterdam' gebruikt. De combinatie van het beeld-merk en het woordbeeld-merk vormen het logo. Dit is het centrale element in de huisstijl van de UvA. Een strakke regie van het logo versterkt de herkenbaarheid van de UvA. Het beeldmerk is als het ware de handtekening van de Universiteit.

De grondvorm van het logo mag niet veranderd worden. Ten behoeve van reproductie mag een logo nooit worden ingescand of nagebouwd. U kunt gebruikmaken van de download versies van de logo's via de link onderaan deze pagina. Let daarbij op het juiste gebruik van een bepaalde variant van het logo.

Drukwerk

Het logo wordt altijd in de linker boven hoek geplaatst. De afstand van de afloop van het formaat tot aan het logo is altijd dezelfde maat als het beeldmerk.

A6: 5 mm (50%) A5: 6 mm (60%) A4: 9 mm (90%) A3: 14 mm (140%) A2: 18 mm (180%) A1: 25 mm (250%) A0: 35 mm (350%)

Bij een brochure met een rug moet de linker kantlijn worden verbreed (met een meervoud van de maat van het beeldmerk) om te voorkomen dat het beeldmerk in de kneep terecht komt.

Diapositieve versie

Op een zwarte of donkere achtergrond wordt de diapositieve versie gebruikt van het logo.

De lijndikte om het beeldmerk heeft op de A-formaten een vastgestelde dikte. A6: 0,5 pt A5: 0,5 pt A4: 0,5 pt A3: 0,7 pt A2: 1 pt A1: 1,5 pt A0: 1,5 pt Instructies LOGO BEELDMERK WOORDMERK

(2)

Abstract

With quantum computers and clever quantum algorithms, an enormous step forward can be taken in computing; Processes can be speeded up exponentially, ‘hard problems’ can be solved and revolutionary progress can be made in cryptography, the natural sciences, medicine and other fields.

In the first part of this paper, the foundation of quantum computing, and the Deutsch and Shor algorithms are discussed. This part demonstrates that the efficiency of quantum com-puters rests on the superposition principle, entanglement and quantum parallelism. Also, the exact workings of the Deutsch and Shor algorithms are described.

Many problems for which interesting quantum algorithms have been designed, can be re-duced to instances of the Hidden Subgroup Problem. In the second part of this paper, the focus lies on this Hidden Subgroup Problem. A general solution is constructed for the case where the group under consideration is Abelian. This solution is generalised further to make it applicable to the case were the group of interest is non-Abelian, which is an open problem. The efficacy of the algorithm is assessed for this open problem, as well as the reason why it does not solve the problem sometimes. Where relevant an overview of the necessary group theory is provided.

(3)

Contents

1 Introduction 3

2 The Statespace, States and Entanglement 5

2.1 General . . . 5

2.2 Composite Systems . . . 6

2.3 Bipartite Systems . . . 7

3 Primary Elements of Quantum Computing 8 3.1 Qubits . . . 8

3.2 Quantum Logic Gates . . . 9

3.3 Quantum Circuits . . . 12

4 Algorithms - Part One 17 4.1 Introduction . . . 17

4.2 Quantum Parallelism . . . 17

4.3 The Deutsch Algorithm . . . 20

4.4 The Deutsch Algorithm for n + 1 qubits . . . 22

4.5 Final Notes . . . 25

5 Algorithms - Part Two 27 5.1 The Shor Factoring Algorithm . . . 27

5.2 The Quantum Fourier Transform . . . 29

5.2.1 Definition . . . 29

5.2.2 Unitarity . . . 30

5.2.3 The Product Notation . . . 31

5.2.4 The Quantum Fourier Transform Circuit . . . 33

5.3 Phase or Eigenvalue Estimation . . . 35

5.4 Finding the Order . . . 37

5.5 Final Notes . . . 38

6 Mathematical Foundation and Generalisations 40 6.1 Introduction . . . 40

6.2 Mathematical Concepts - Group Theory (I) . . . 41

6.3 The Quantum Fourier Transform on Finite Abelian Groups . . . 43

6.3.1 The Transform . . . 43

6.3.2 Constructing the Dual Group . . . 44

6.3.3 The Fourier Basis and the Transform in Dirac Notation . . . 47

6.3.4 The Character Matrix . . . 49

(4)

6.5 The Hidden Subgroup Problem for Abelian Groups and its Solution . . . 54

7 Advancing to Algorithms for Non-Abelian Groups 58

7.1 The Hidden Subgroup Problem for Finite Non-Abelian Groups . . . 58 7.2 Mathematical Concepts - Group Theory (II) . . . 59 7.3 Generalisation of the Solution to the Abelian Hidden Subgroup Problem . . . 60 7.4 Challenges . . . 62

8 Conclusion 63

Appendix A Modular Arithmetic 65

(5)

Chapter 1

Introduction

Quantum Computing is a revolutionary field of science and technology. This is because quantum computers are exponentially faster than ordinary computers and can solve prob-lems which on an ordinary computer are practically unsolvable. The theory behind quantum computing spans three fields; physics, mathematics and theoretical computer science. With a well working quantum computer, most widely used cryptosystems can be deciphered easily. On a different note, these days a vast amount of data is produced globally everyday. This ‘big data’ can be processed efficiently using quantum computers. Furthermore, with quantum computers complex optimisation problems in business can be solved, air-traffic control can be improved and in medicine –with the analysis of DNA-sequencing data and amino acid mapping for example– more effective medication can be developed.

These are just a few examples of applications which make the research field so relevant. Indeed, parties that invest in quantum computers include Google, Lockheed Martin –the worlds largest defence company– and NASA.

All the above undoubtedly raises the question ‘What makes quantum computing so radically different from classical computing?’. The motivation for this paper is based on just that. In particular, this paper revolves around two fundamental questions:

– What makes quantum computers so much more efficient?

– What are quantum algorithms and how can problems solved with algorithms be dealt with collectively?

In light of these questions, a number of topics will be studied. The first of these are the prin-ciples quantum computing rests on, and the essential components of quantum algorithms. There are different approaches to constructing quantum algorithms. Most known efficient algorithms however, are based on so-called ‘quantum Fourier transforms’. Therefore, two algorithms of this kind will be considered. Following that, a general framework in which algorithms of this type can be unified will be introduced. There are two categories of prob-lems in the framework. For the first category, a general solution will be constructed. In the last part of the paper, the second category will be addressed. In the context of this general framework, some group theory will be presented.

(6)

In the context of computing, the term ‘efficient’ wich is used here has an explicit meaning. It says something about the so-called ‘time complexity’ of the algorithm. Any algorithm is deemed sufficiently efficient when its time complexity is ‘polynomial’. That means it runs in what is called polynomial time. An algorithm runs in polynomial time when the number of operations it consists of, is polynomial in the number of bits needed to specify the problem. Or in other words, polynomial in the size of the string of bits representing the input. This paper assumes some knowledge of quantum mechanics, Dirac notation and linear alge-bra.

(7)

Chapter 2

The Statespace, States and

Entanglement

2.1

General

To any isolated physical system a so-called state space is associated. This state space is a Hilbert space; a complex complete vector space with inner product. The system is com-pletely described by a system state, which is an element of its state space.

In general a system state is represented by a state operator, which is a positive Hermitian operator1 usually referred to as the density matrix. This density matrix ρ is defined on a

Hilbert space H and can be written in diagonal representation in terms of base states as follows:

ρ = ∑

i

∣ψi⟩pi⟨ψi∣ (2.1)

In the above sum the pi are eigenvalues which correspond to the base states ∣ψi⟩. The pi

represent probabilities hence obey0 ≤ pi≤1 and ∑ipi=1.In the position basis the eigenvalues make up the position probability density. {∣ψi⟩}is a complete orthonormal set in H. The density matrix statisfies these three conditions:

T r(ρ) = 1, ρ = ρ†, ⟨v∣ ρ ∣v⟩ ≥ 0 (for all vectors ∣v⟩)

Here T r(ρ) is the trace of ρ. The trace of an operator equals the sum of the diagonalelements of the matrix that represents it. It is given by T r(Q) = ∑ni=1(qii)for an[n × n]matrix with elements aij(i,j≤n). For a matrix with an unequal number of rows and collumns there is no

concept of trace. The trace of a linear operator defined on a finite-dimensional vector space does not depend on the choice of basis. Furthermore, the trace of an operator which can be diagonalised equals the sum of its eigenvalues (counting with multiplicity).

(8)

When there is only one summand in the sum defining the density matrix in equation (2.1), ρ is a vector and the corresponding state is called a pure state.

A pure state density matrix ρpis a one-dimensional projection operator2 with properties:

ρ2p=ρp, tr(ρ2p) =tr(ρp) =1

A state is called mixed when the sum in equation (2.1) contains two or more terms. A mixed state is not idempotent3 and can always be decomposed into pure states which do

not need to be orthogonal. This decomposition is not uniquely defined. In fact, when ρ has a degenerate spectrum, there are infinitely many orthogonal decompositions. A mixed state statisfies T r(ρ2) <1.

The density matrix can be used to obtain the average value of an observable. The average value of observable Q equals:

⟨Q⟩ = T r(ρQ)

For a pure state density matrix (which is a vector) this reduces to ⟨Q⟩ = ⟨ψ∣ Q ∣ψ⟩.

2.2

Composite Systems

For a composite quantum system, a system state (whether pure or mixed) can be either separable or entangled.4 Entanglement is created when the subsystems the compound sys-tem consists of, interact via some (non-local) entangling Hamiltonian operator. When a compound system is in an entangled state, that state does not provide definite information about the subsystems. The subsystems of an entangled system are always in a mixed state, even when the state of the joint system is pure.

The state space of a composite physical system is the tensor product of the state spaces of the component physical systems. To describe subsystems of a compsite system the reduced density matrix is used. For a system described by density operator ρAB, consisting of two subsystems - A and B - the reduced density operators are given by:

ρA=trB(ρAB)ρB=trA(ρAB)

Here trB and trA are partial trace operators over system B and A respectively. The partial

trace is defined by:

trB( ∣a1⟩ ⟨a2∣ ⊗ ∣b1⟩ ⟨b2∣ ) = ∣a1⟩ ⟨a2∣tr( ∣b1⟩ ⟨b2∣ ) = ∣a1⟩ ⟨a2∣ ⟨b1∣b2⟩

with∣a1⟩ , ∣a2⟩ ∈ HAand∣b1⟩ , ∣b2⟩ ∈ HB

2This is an operator which leaves its image unchanged.

3Unlike a pure state. That a pure sate is idempotent is expressed in the first property.

(9)

Using the general definition above, for a compound system in the separable state ρ = (ρα⊗ρβ), the partial trace over system α is ρα=trα(ρβ⊗ρα) =ραtr(ρβ) =ρα×1 = ρα as expected.

2.3

Bipartite Systems

A bipartite system is a system consisting of two subsystems. When these subsystems are A and B, the states in which the bipartite system can be are elements of the tensored Hilbert space HAB = HA⊗ HB, where HA and HB are the state spaces of subsystems A and B

respectively.

Whether a bipartite systemstate is separable or entangled is directly related to the way in which the state can be decomposed. It is separable when it can be written in terms of tensor products of states of the subsystems as follows:

ρAB= ∑

i

ρAi ⊗ρBi = ∑

i

pi∣ai⟩ ⟨ai∣ ⊗ ∣bi⟩ ⟨bi∣

where ∣ai⟩ ∈ HA, ∣bi⟩ ∈ HB, and entangled otherwise. In general the {∣ai⟩}and {∣bi⟩} are not

orthogonal. Furthermore the pi represent probabilities as in (2.1). If the combined state

is pure, this reduces -in vector notation- to ∣ψAB⟩ = ∣ψA⟩ ⊗ ∣ψB⟩ (with ∣ψA⟩ ∈ HA, ∣ψB⟩ ∈ HB).

(10)

Chapter 3

Primary Elements of Quantum

Computing

3.1

Qubits

A qubit is quantum system with a two-dimensional state space. Qubits are the quantum analogue of classical bits and are used in quantum computers. The standard states that form a basis for the qubit state space are denoted by ∣0⟩ and ∣1⟩. This means that a qubit can be in a superposition of the states ∣0⟩ and ∣1⟩. The Bloch sphere, which is shown below, is a geometrical representation of the state space.

Points on the surface of the Bloch sphere represent pure states and points inside the Bloch sphere represent mixed states.

The state space of a compound system consisting of two qubits is a bipartite system and is four dimensional. The system states that make up the standard basis for this four dimen-sional state space are constructed as follows:

(11)

A system state ∣ψ⟩ is always a linear combination of the states in (3.1): ∣ψ⟩ = c00∣00⟩ + c01∣01⟩ + c10∣10⟩ + c11∣11⟩

In matrix form this is:

∣ψ⟩ = (c00 c01 c10 c11

)

If the matrix above has only one entry after diagonalisation, ketψ is a separable state. ∣ψ⟩ is an entangled state if the matrix has two entries when it is diagonalised.

When the two-qubit system is maximally entangled it is in a Bell state, also referred to as an EPR sate or an EPR pair (named after the Einstein-Podolsky-Rosen article from 1935 [7]). There are four Bell states for a two qubit system:

β00= 1 √ 2(∣00⟩ + ∣11⟩) β01= 1 √ 2(∣01⟩ + ∣10⟩) β00= 1 √ 2(∣00⟩ − ∣11⟩) β00= 1 √ 2(∣01⟩ − ∣10⟩) (3.2)

3.2

Quantum Logic Gates

Quantum gates are the quantum analogue of classical logic gates. They operate on a fixed number of qubits. Unitarity is the only constraint on quantum gates. This condition means that Q†Q = I must hold for a gate represented by matrix Q, that is, the inverse of the opera-tor must equal its Hermitian conjugate.1 This requirement ensures probabilitiy is conserved and other properties of quantum gates can be deduced from it. For example, quantum gates must be reversible unlike classical logic gates, as the inverse of a unitary matrix is always unitary as well. The most general mathematical description of a quantum gate is a [2n

×2n] unitary matrix that operates in H⊗n. On a bipartite qubit system one-qubit gates and

two-qubit gates can be applied. These gates are represented by [2 × 2] and [4 × 4] matrices respectively.

An example of a one-qubit gate is the binary negation operation -usually referred to as the NOT gate- which interchanges the base states. Other examples are the Hadamard and Phase gates which are denoted by H and S. These three operations are represented by the

1In some of the texts referred to at the end of this chapter, the fact that only unitary operators are valid

(12)

following matrices with respect to the computational basis (this is the basis given in (3.1)) N OT =⎛ ⎝ 0 1 1 0 ⎞ ⎠ H = √1 2 ⎛ ⎝ 1 1 1 −1 ⎞ ⎠ S =⎛ ⎝ 1 0 0 i ⎞ ⎠ (3.3)

The NOT-gate matrix is equal to the first Pauli matrix. All three Pauli matrices2 represent

fundamental single-qubit gates. They are usually denoted by σx(=N OT ), σy and σz or X,

Y and Z. The Pauli matrix gates rotate the Bloch sphere about three different axes and are given by: σx= (0 1 1 0) σy= (0 −i i 0) σz= (1 0 0 −1) (3.4)

The swapping of the base states as a result of application of the σx or NOT-gate can be

understood as a 180 degree rotation of the Bloch sphere about the x axis.

As can be seen in the matrix, the Hadamard gate transforms a basis state ∣0⟩ or ∣1⟩ to a superposition of the two as follows:

∣0⟩ → √1

2(∣0⟩ + ∣1⟩) ∣1⟩ → 1 √

2(∣0⟩ − ∣1⟩)

Since there are infinitely many unitary[2 × 2]matrices, there are infiniely many single qubit operations as well. An arbitrary one-qubit gate can however be composed by a finite set of universal gates. Single qubit gate matrices U can be decomposed into a linear combination of the three Pauli matrices and the[2 × 2]identity matirx. In addition, they can also always be written in terms of a global phase shift and a combination of rotation operators:

U = eiαRz(β)Ry(γ)Rz(δ)

2These matrices are named after physicist Wolfgang Pauli and are widely used in the study of quantum

(13)

Here U is a unitary[2 × 2]marix and Rz and Ry are these rotation operators: Rz(θ) = e −iθσz 2 = (e −iθ 2 0 0 e−iθ2 ) Ry(θ) = e −iθσy 2 = (cos θ 2 −sin θ 2 −sinθ2 cosθ2 )

An important two-qubit gate is the CNOT gate, which performs a so-called ‘controlled oper-ation’. The CNOT gate has two input qubits: a control qubit and a target qubit. It flips the target qubit when the control qubit is in state ∣1⟩, but leaves it unchanged when the control qubit is in state ∣0⟩. This mechanism is can be described as addition modulo 2, by writing ∣q1, q2⟩ → ∣q1, q2⊕q1⟩for a control and target qubit in states ∣q1⟩and ∣q2⟩respecitvely.3 Here q1.q2∈ {0, 1}. The matrix representation of the CNOT gate is:

CN OT = ⎛ ⎜ ⎜ ⎜ ⎝ 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 ⎞ ⎟ ⎟ ⎟ ⎠

Which can obviously be written in terms of σx, the Pauli-X matrix.

An extension of the two-qubit CNOT gate is the controlled-U gate. This controlled-U gate is applied to n + 1 qubits. One qubit serves as a control qubit. If it is in the state ∣0⟩, all n + 1 qubits are left alone. When the control qubit is in the state ∣1⟩ however, the U matrix -which represents an n qubit gate- is applied to the n target qubits. An example for the n = 1 case is the gate given below.

Rp= (

1 0

0 e2πi2p)

This gate occurs in the context of the Quantum Fourier Transform, which is often used in quantum algorithms and is discussed in chapter 5.

Although in this section all matrices corresponding to quantum gates are written with re-spect to the computational basis, they can be written with rere-spect to any orthonormal basis for the qubit system of interest. This can sometimes be used to describe experimental results of measurements in a more sophisticated way.

The measurement gate is a single qubit gate that converts a qubit into a classical bit. After this operation the qubit is no longer in a superposition of states, but in one of the base states. A measurement gate transforms a qubit originally in state ∣ψ⟩ = α ∣0⟩ + β ∣1⟩ into state

(14)

∣0⟩ with probability ∣α∣2 or into state ∣1⟩ with probability ∣β∣2.

All classical circuits can be simulated using a sequence of quantum gates. In doing this, Toffoli gates are often used to mimick irreversible classical logic gates. A Toffoli gate has two control input qubits and one target input qubit. The target qubit is only flipped when both control qubits are in state ∣1⟩. The Toffoli gate is its own inverse - when it is ap-plied twice the final output state equals the input state. The transform can be written as ∣q1, q2, q3⟩ → ∣q1, q2, q3⊕q1q2⟩. The matrix that corresponds to the Toffoli gate is:

T = ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ 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 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠

Furthermore, any unitary transformation in H⊗n can be decomposed into a product of

CNOT gates and unitary one-qubit transformations.

3.3

Quantum Circuits

A quantum circuit is a sequence of quantum gates, arranged to manipulate input qubits in a certain way. It can be described schematically with a diagram consisting of symbols used to indicate quantum logic gates and wires. The wires do not need to correspond to physical wires, they may correspond to the passage of time or a physical distance in space a particle needs to traverse.

The symbols used to denote certain transforms discussed in the previous section in a quan-tum circuit, are given below:

Hadamard gate: ∣q0⟩ H CNOT gate: ∣q0⟩ ● ∣q1⟩ ⊕ Meter gate: ∣q0⟩ M Toffoli gate: ∣q0⟩ ● ∣q1⟩ ● ∣q2⟩ ⊕

(15)

Certain configurations allowed in classical circuits are not allowed in a quantum circuit. To begin with, a quantum circuit must be acyclic, meaning feedback from one part of the quantum circuit to another is not permitted. Furthermore, wires cannot be joined together. In a classical circuit the joining together of lines is know as the FANIN operation. FANIN is an irreversible operation and therefore has no quantum analogue. There is no quantum analogue to the classical FANOUT operation -which produces copies of a bit- either, since such an operation would violate the no cloning theorem. Any classical circuit can be re-placed by an equivalent circuit containing only reversible elements.

Three essential elementary quantum circuits are first of all the so-called ‘swap circuit’ –a circuit used to swap the states of two input qubits–, second of all the circuit in which Bell states are created and finally the quantum teleportation circuit.

A swap circuit consists of three CNOT gates. A more compact notation which is used often is given on the right:

∣q0⟩ ● ⊕ ● ∣q1⟩ ⊕ ● ⊕

∣q0⟩ × ∣q1⟩ ×

This circuit transforms a computational basis state ∣a, b⟩ like this:4

∣q1, q2⟩ → ∣q1, q1⊕q2⟩ → ∣(q1⊕q2) ⊕q1, q1⊕q2⟩ = ∣q2, q1⊕q2⟩ → ∣q2, q2⊕ (q1⊕q2)⟩ = ∣q2, q1⟩

Bell states are created in a circuit consisting of a Hadamard gate followed by a CNOT gate, with two input qubits:

∣q0⟩ H ●

∣q1⟩ ⊕

(3.5)

After a Hadamard transform is applied to input qubit ∣q0⟩, this qubit serves as the control

qubit in the CNOT gate. This means that when ∣q0⟩and ∣q1⟩ are basis states, or in other words when q0, q1∈ {0, 1}, the qubits can be entangled because the upper qubit is put into

a superposition of states. The computational basis states given in equation (3.1) are trans-formed in this circuit as follows:

∣00⟩ β00=√1 2(∣00⟩ + ∣11⟩) ∣01⟩ β01=√1 2(∣01⟩ + ∣10⟩) ∣10⟩ β10=√1 2(∣00⟩ − ∣11⟩) ∣11⟩ β11=√1 2(∣01⟩ − ∣10⟩) (3.6)

(16)

The diagram below depicts the quantum teleportation circuit:

∣ψ0⟩ ● H M ●

∣ψ1⟩ H ● ⊕ M ●

∣ψ2⟩ ⊕ U gate

Qualitatively, this is the sequence of events: Qubits q1 and q2, are in states ∣ψ1⟩ and ∣ψ2⟩ respectively and are entangled using a Hadamard and CNOT gate as in circuit (3.5). After this, they are at different points in space; namely points 1 and 2. Subsequently, qubit q1

is entangled with qubit q0, which is also located at point 1 and is in state ∣ψ0⟩- the state

that is to be teleported. q1 and q0 are then both measured which means they are converted

into classical bits. The classical information obtained through these measurements is sent to point 2, the location of q2. With the collected information the appropriate gate can be

applied to qubit q2 to put it into state ∣ψ0⟩(the state q0 was in originally) after which the

state ∣ψ0⟩is teleported successfully.

As an example, with the quantum teleporation circuit, the state ∣ψ0⟩ =α ∣0⟩ + β ∣1⟩ can be teleported using input qubits in states ∣ψ1⟩ = ∣1⟩ and ∣ψ2⟩ = ∣1⟩. The total input system is in

this case:

∣Ψtot⟩ = (α ∣0⟩ + β ∣1⟩ ) ⊗ ∣1⟩ ⊗ ∣1⟩

When they pass through the combination of a Hadamard and CNOT gate, q1 and q2 are

entangled. Their combined state is then:

∣Ψq1q2⟩ =

1 √

2(∣01⟩ − ∣10⟩)

as can be seen in table (3.6). This leaves the total systemstate at:

∣Ψtot⟩ = ∣ψq0⟩ ⊗ ∣Ψq1q2⟩ = 1 √

2(α ∣0⟩ ( ∣01⟩ − ∣10⟩ ) + β ∣1⟩ ( ∣01⟩ − ∣10⟩ ))

Applying the CNOT gate to q0and q1, flips q1 only when q0 is in state ∣1⟩ which means the

total systemstate is transformed to:

∣Ψtot⟩ = 1 √

(17)

The application of a Hadamard gate to q0 then converts the total systemstate into:

∣Ψtot⟩ = 1

2(α( ∣0⟩ + ∣1⟩ )( ∣01⟩ − ∣10⟩ ) + β( ∣0⟩ − ∣1⟩ )( ∣11⟩ − ∣00⟩ ))

since a Hadamard gate has the following effect on the computational basis states ∣0⟩ and ∣1⟩: ∣0⟩ → √1

2(∣0⟩ + ∣1⟩) ∣1⟩ → 1 √

2(∣0⟩ − ∣1⟩)

Now q0and q1are going to be measured hence at this stage it is useful to rewrite the version

of Ψtot formulated above in terms of the combined states ∣Ψq0q1⟩ of qubits q0 and q1. To

this end the following substitution is made below: ∣a⟩ ∣bc⟩ → ∣ab⟩ ∣c⟩. This does not change anything since both expressions signify ∣a⟩ ⊗ ∣b⟩ ⊗ ∣c⟩.

∣Ψtot⟩ = 1

2(α ∣00⟩ ∣1⟩−α ∣01⟩ ∣0⟩+α ∣10⟩ ∣1⟩−α ∣11⟩ ∣0⟩−β ∣00⟩ ∣0⟩+β ∣01⟩ ∣1⟩+β ∣10⟩ ∣0⟩−β ∣11⟩ ∣1⟩ )

Assembling terms containing like ∣Ψq0q1⟩factors gives:

∣Ψtot⟩ = 1

2( ∣00⟩ (α ∣1⟩−β ∣0⟩ )+∣01⟩ (β ∣1⟩−α ∣0⟩ )+∣10⟩ (α ∣1⟩+β ∣0⟩ )+∣11⟩ (−β ∣1⟩−α ∣0⟩ )) (3.7)

By measuring qubits q0and q1 one can now determine which state q2is in. The possibilities

are given in table (3.8).

∣Ψq0q1⟩ = ∣00⟩ ∣ψ2⟩ =α ∣1⟩ − β ∣0⟩

∣Ψq0q1⟩ = ∣01⟩ ∣ψ2⟩ =β ∣1⟩ − α ∣0⟩

∣Ψq0q1⟩ = ∣10⟩ ∣ψ2⟩ =α ∣1⟩ + β ∣0⟩

∣Ψq0q1⟩ = ∣11⟩ ∣ψ2⟩ = −β ∣1⟩ − α ∣0⟩

(3.8)

The final step of the teleportation circuit is the application of a single qubit gate U to q2

to transform it into state ∣ψ2⟩ =α ∣0⟩ + β ∣1⟩. In this example the appropriate gates would be the Pauli X, Y and Z gates; σx, σy and σz. When the measurement yields ∣Ψq0q1⟩ = ∣10⟩

however, an extra transform would obviously be unnecessary.

Using the reduced density operator (which was defined in chapter 2), the fact that no faster-than-light communication happens in the quantum teleportation circuit can be quantified. All possibilities in table (3.8) have equal probability, as such they must all have probability

1

(18)

opera-tor associated to the systemstate after measurement when the outcome of the measurement is not known is:

ρ =1 4( ∣00⟩ ⟨00∣ (α ∣1⟩ − β ∣0⟩ )(α ∗ ⟨1∣ − β∗ ⟨0∣ ) + ∣01⟩ ⟨01∣ (β ∣1⟩ − α ∣0⟩ )(β∗ ⟨1∣ − α∗ ⟨0∣ ) + ∣10⟩ ⟨10∣ (α ∣1⟩ + β ∣0⟩ )(α∗⟨1∣ + β∗⟨0∣ ) + ∣11⟩ ⟨11∣ ( − β ∣1⟩ − α ∣0⟩ )( − β∗⟨1∣ − α∗⟨0∣ ))

That no faster-than-light communication occurs can be made visible in the density operator by ‘tracing out’ the first two qubits. That is, by dividing the system up into a subsystem A, consisting of qubits q0 and q1, associated to the the state ∣Ψq0q1⟩ and a subsystem B, consisting only of qubit q2and associated to state ∣ψq2⟩, and computing the reduced density

operator ρB: ρB= 1 4((α ∣1⟩ − β ∣0⟩ )(α ∗⟨1∣ − β⟨0∣ ) + (β ∣1⟩ − α ∣0⟩ )(β⟨1∣ − α⟨0∣ ) + (α ∣1⟩ + β ∣0⟩ )(α∗⟨1∣ + β∗⟨0∣ ) + ( − β ∣1⟩ − α ∣0⟩ )( − β∗⟨1∣ − α∗⟨0∣ ))

This equation can be rewritten to show that the state qubit q2is in when the measurement

re-sult is not known, contains no information about the state ∣ψ0⟩which needs to be teleported:

ρB= 1 4( (∣α∣ 2∣1⟩ ⟨1∣ + ∣β∣2∣0⟩ ⟨0∣ ) − (αβ∗ ∣1⟩ ⟨0∣ + βα∗ ∣0⟩ ⟨1∣ ) + (∣β∣2∣1⟩ ⟨1∣ + ∣α∣2∣0⟩ ⟨0∣ ) − (βα∗∣1⟩ ⟨0∣ + αβ∣0⟩ ⟨1∣ ) + (∣α∣2∣1⟩ ⟨1∣ + ∣β∣2∣0⟩ ⟨0∣ ) + (αβ∗∣1⟩ ⟨0∣ + βα∣0⟩ ⟨1∣ ) + (∣β∣2∣1⟩ ⟨1∣ + ∣α∣2∣0⟩ ⟨0∣ ) + (βα∗ ∣1⟩ ⟨0∣ + αβ∗ ∣0⟩ ⟨1∣ ) ) = 1 4(2(∣α∣ 2+ ∣β∣2) ∣1⟩ ⟨1∣ + 2(∣α∣2+ ∣β∣2) ∣0⟩ ⟨0∣ ) = 1 2I

Where I denotes the identity matrix.

The definitions in this chapter, and the general line of thought followed in the description of the quantum teleportation circuit, originate from a study of [21], [18], [23] and [3].

(19)

Chapter 4

Algorithms - Part One

4.1

Introduction

The focal points of this chapter are the two most elementary efficient quantum algorithms, namely the Deutsch algorithm and the generalised Deutsch algorithm. These algorithms rest on the fundamental concept of quantum paralellism, which is an important concept in quantum computing in general since it exploits the quantum properties of qubits for the benefit of efficiency. Therefore, quantum parallelism will be described before the algorithms are studied in detail.

The original version of the Deutsch algorithm is an algorithm for two qubits, and the gen-eralised version of the Deutsch algorithm is the extension of this to an algorithm for n qubits. What these algorithms do is efficiently determine whether a function is constant or balanced. There are restrictions to the type of functions they can be applied to.

The general idea of this chapter and some definitions are drawn from [3] and [23].

4.2

Quantum Parallelism

Quantum parallelism is a concept utilised for ’quantum parallel processing’. It facilitates the evaluation of functions for multiple values simultaneously using a single circuit. In the case of classical parallel computation, multiple circuits each constructed to evaluate the same function, are executed at the same time with distinct input values. An exponential decrease in the time the computation takes is therefore only possible when the amount of processors is increased exponentially. In the case of quantum parallel processing there is no need for extra processors to decrease the time it takes to evaluate a function for more than one value. However, the problem with parallel quatum computations is that getting access to the results of a computation is a challange. The reason for this is that measurement alters a quantum system. This being the case, quantum parallel processing is only useful when multiple val-ues can be extracted from one entangled output state, or the individual valval-ues are not of interest, that is, when the objective is to find some general property of the function under conseration. In the Deutsch algorithms, the latter is the case.

(20)

To gain understanding of the quantum parallelism concept, one should first consider a circuit that evaluates a function for a single value:

∣x⟩

Uf (x)

∣x⟩

∣y⟩ ∣y ⊕ f (x)⟩

This circuit transforms the state ∣x, y⟩ to ∣y ⊕ f (x)⟩ –where ⊕ is addition modulo 2 as before– through a sequence of gates collectively signified by unitary transformation Uf (x).

The transformation is unitary since it is its own inverse. When applied twice the original state is recovered. That is, U2

f (x)=I:

∣x, y⟩ →U ∣y ⊕ f (x)⟩ →U ∣x, (y ⊕ f (x)) ⊕ f (x)⟩ = ∣x, y⟩

Since addition modulo 2 does not change the systemstate when the control qubit is in state ∣0⟩, the circuit above has f (x) as output value when ∣y⟩ is set to zero: ∣0 ⊕ f (x)⟩ = ∣f (x)⟩. This is shown in the circuit below:

∣x⟩

Uf (x)

∣x⟩

∣0⟩ ∣f (x)⟩

When the first input qubit is in a superposition of states, for example because it passed through a Hadamard gate before entering the Uf (x) gate, the output state is also in

super-position. Choosing for this first input qubit the state ∣x⟩ =√1

2( ∣0⟩ − ∣1⟩ ), the bottom output

state equals: ∣ψ⟩ = f (√1 2( ∣0⟩ − ∣1⟩ )) = 1 √ 2(f (∣0⟩) − f (∣1⟩))

Clearly, f (x) can in this way be evaluated for both x = 0 and x = 1 simultaneously. Evaluat-ing f (x) for both input values as described above requires the same number of operations as evaluating the same function for only one value. Importantly, this results means that with an input qubit which is put into a superposition state, the function is evaluated for more than one value at the same time and an entangled output state is created.

(21)

The circuit below represents the process in which the entangled output described here is created. ∣1⟩ H Uf (x) 1 √ 2( ∣0⟩ − ∣1⟩ ) ∣0⟩ √1 2(f (∣0⟩) − f (∣1⟩))

More explicitely, the transformation of the input systemstate in this circuit can be written as:

∣Ψtot⟩1= ∣1 ⊗ 0⟩ → ∣Ψtot⟩2=Uf (x)∣H1 ⊗ 0⟩

Using H ∣1⟩ = √1

2( ∣0⟩ − ∣1⟩ ), the output systemstate can be rewritten to:

∣Ψtot⟩2= 1 √ 2Uf (x)( ∣0 ⊗ 0⟩ − ∣0 ⊗ 1⟩ ) which equals: ∣Ψtot⟩2= 1 √ 2( ∣0 ⊗ f (x)⟩ − ∣1 ⊗ f (x)⟩ )

With n Hadamard gates acting in parallel on n qubits, all this can be generalised to functions which work on an arbitrary number of qubits. Performing the Hadamard transforms on n qubits initially all in state ∣0⟩ yields √1

2n∑x∣x⟩. The combined output state of the Uf (x)

transform is in this case:

∣Ψtot⟩ = 1 √ 2n ∑ x ∣x⟩ ∣f (x)⟩

So again, a linear superosition of basis states is created, and the function is evalated for multiple input values at the same time.The diagram of this generalised version of the pro-cedure is completely analogous to the two qubit diagram:

∣0⟩⊗n / H⊗n

Uf (x)

∣0⟩

Measuring the output state would give only one of the terms in the final sum, since mea-surement of a superposed state always returns the eigenvalue corresponding to one of the compound base states. A measurement operation after Uf (x) would therefore project ∣ψ⟩

(22)

is clear that quantum parallelism can only be exploited either when some mechanism is constructed to distill more information from the final output state, or when the values of f are not needed explicitely.

4.3

The Deutsch Algorithm

The Deutsch algorithm is the simplest useful application of quantum parallelism. Using this algorithm, for any function f (x) with as its codomain the set {0, 1}, the global property f (0) ⊕ f (1) can be determined using one evaluation of f (x).

Application of the Deutsch algorithm provides information about the nature of the unknown function f (x) because from the value of f (0) ⊕ f (1), one can determine whether f (0) = f (1) or f (0) ≠ f (1) is true for the function of interest. If the first equation holds f (x) is a con-stant function. If f (x) obeys the latter it is a balanced function1. If a classical algorithm was used to uncover the same information about f (x), f (0) and f (1) would need to be computed seperately and then compared. To illustrate this, consider the example of a coin which may have a head and a tail, or two of either. Le Bellac also mentions this example in [3]. When this information is presented in the form of a function, the Deutsch algorithm would determine which of the two cases is at hand with only one function evaulation.

Schematically, this diagram represents the Deutsch algorithm:

∣x⟩ H

Uf (x)

H

∣y⟩ H

As can be seen in the diagram, both input qubits are prepared as superpositions of states using Hadamard gates before entering the Uf (x) gate. When for example the input system

state is ∣Ψtot⟩1= ∣x ⊗ y⟩ = ∣1 ⊗ 1⟩ –which is sometimes abbreviated to ∣1, 1⟩ or ∣11⟩– the algo-rithm has as its output state ∣Ψtot⟩4= ±√1

2∣f (0) ⊕ f (1)⟩ ⊗ ( ∣0⟩ − ∣1⟩ ). This transformation

is described in detail below:

∣Ψtot⟩1= ∣1 ⊗ 1⟩ f irsttwoHgates ÐÐÐÐÐÐÐÐÐ→ ∣Ψtot⟩2= ∣H1 ⊗ H1⟩ = 1 2((∣0⟩ − ∣1⟩) ⊗ (∣0⟩ − ∣1⟩)) = 1 2( ∣0, 0⟩ − ∣0, 1⟩ − ∣1, 0⟩ + ∣1, 1⟩ ) ∣Ψtot⟩2 Uf(x)gate ÐÐÐÐÐ→ ∣Ψtot⟩3= 1 2Uf (x)( ∣0, 0⟩ − ∣0, 1⟩ − ∣1, 0⟩ + ∣1, 1⟩ )

1In this context, a balanced function is a (Boolean) function which outputs as many zero’s as one’s over

(23)

When the Uf (x) transform is written out, and then the that by definition f (0) = ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ 0 1 and f (1) = ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ 0

1 is used to perform the addition mod 2, ∣Ψtot⟩3can be rewritten as follows:

∣Ψtot⟩3= 1 2( ∣0, 0 ⊕ f (0)⟩ − ∣0, 1 ⊕ f (0)⟩ − ∣1, 0 ⊕ f (1)⟩ + ∣1, 1 ⊕ f (1)⟩ ) = ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ 1 2( ∣0, 0⟩ − ∣0, 1⟩ − ∣1, 0⟩ + ∣1, 1⟩ ), if f (0) = 0, f (1) = 0 1 2( ∣0, 0⟩ − ∣0, 1⟩ − ∣1, 1⟩ + ∣1, 0⟩ ), if f (0) = 0, f (1) = 1 1 2( ∣0, 1⟩ − ∣0, 0⟩ − ∣1, 0⟩ + ∣1, 1⟩ ), if f (0) = 1, f (1) = 0 1 2( ∣0, 1⟩ − ∣0, 0⟩ − ∣1, 1⟩ + ∣1, 0⟩ ), if f (0) = 1, f (1) = 1

Regrouping terms gives for f (0) = f (1):

∣Ψtot⟩3= ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ 1 2( ∣0, 0⟩ − ∣0, 1⟩ − ∣1, 0⟩ + ∣1, 1⟩ ) 1 2( − ∣0, 0⟩ + ∣0, 1⟩ + ∣1, 0⟩ − ∣1, 1⟩ ) = ± 1 2( ∣0, 0⟩ − ∣0, 1⟩ − ∣1, 0⟩ + ∣1, 1⟩ ) And for f (0) ≠ f (1): ∣Ψtot,3⟩ = ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ 1 2( ∣0, 0⟩ − ∣0, 1⟩ + ∣1, 0⟩ − ∣1, 1⟩ ) 1 2( − ∣0, 0⟩ + ∣0, 1⟩ − ∣1, 0⟩ + ∣1, 1⟩ ) = ± 1 2( ∣0, 0⟩ − ∣0, 1⟩ + ∣1, 0⟩ − ∣1, 1⟩ )

Combining the two states above yields a total system state of:

∣Ψtot⟩3= ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ ±12( ∣0, 0⟩ − ∣0, 1⟩ − ∣1, 0⟩ + ∣1, 1⟩ ), if f (0) = f (1) ±12( ∣0, 0⟩ − ∣0, 1⟩ + ∣1, 0⟩ − ∣1, 1⟩ ), if f (0) ≠ f (1)

In the last phase of the algorithm the top qubit (denoted by x in ∣x, y⟩) passes trough another Hadamard gate while the bottom qubit (y in ∣x, y⟩) is left unchanged. The compound system is transformed into its final state like this:

∣Ψtot⟩3 lastHgate ÐÐÐÐÐ→ ∣Ψtot,4⟩ = ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ ±12( ∣H0, 0⟩ − ∣H0, 1⟩ − ∣H1, 0⟩ + ∣H1, 1⟩ ), if f (0) = f (1) ±12( ∣H0, 0⟩ − ∣H0, 1⟩ + ∣H1, 0⟩ − ∣H1, 1⟩ ), if f (0) ≠ f (1) Since ∣H0, 0⟩ =√1 2( ∣00⟩ + ∣10⟩ ), ∣H0, 1⟩ = 1 √

(24)

∣Ψtot⟩4= ⎧ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎩ ±12√1 2(( ∣00⟩ + ∣10⟩ ) − ( ∣01⟩ + ∣11⟩ ) − ( ∣00⟩ − ∣10⟩ ) + ( ∣01⟩ − ∣11⟩ )), if f (0) = f (1) ±12√1 2(( ∣00⟩ + ∣10⟩ ) − ( ∣01⟩ + ∣11⟩ ) + ( ∣00⟩ − ∣10⟩ ) − ( ∣01⟩ − ∣11⟩ )), if f (0) ≠ f (1) Or ∣Ψtot⟩4= ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ ±12√1 2(2 ∣10⟩ − 2 ∣11⟩ ), if f (0) = f (1) ±12√1 2(2 ∣00⟩ − 2 ∣01⟩ ), if f (0) ≠ f (1) = ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ ±√1 2( ∣10⟩ − ∣11⟩ ) if f (0) = f (1) ±√1 2( ∣00⟩ − ∣01⟩ ), if f (0) ≠ f (1) = ± 1 √ 2 ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ ∣0⟩ ⊗ ( ∣0⟩ − ∣1⟩ ) if f (0) = f (1) ∣1⟩ ⊗ ( ∣0⟩ − ∣1⟩ ), if f (0) ≠ f (1)= ± 1 √ 2∣f (0) ⊕ f (1)⟩ ⊗ ( ∣0⟩ − ∣1⟩ )

In the last step the fact that ∣f (0) ⊕ f (1)⟩ = 0 when f (0) = f (1) and ∣f (0) ⊕ f (1)⟩ = 1 when f (0) ≠ f (1) is used. That this is true can easily be shown by writing out all the possible combinations: f(0) f(1) f (0) ⊕ f (1) 0 0 0 0 1 1 1 0 1 1 1 0

Now one can determine whether the function under consideration is balanced or constant. When the function is balanced,which means it is equal to 1 for exacly half of all possible x, (f (0) ≠ f (1)) holds. When it is constant for all values of x, (f (0) = f (1)) holds. Which one of these statements is true can be determined by performing one measurement: When the outcome of the measurement is 1 the function is balanced, when it is 0 the function is constant. The necessary information is obtained without the explicit evaluation of the function f (x) which makes this algorithm more efficient than its classical counterpart.

4.4

The Deutsch Algorithm for n + 1 qubits

The extended version of the Deutsch algorithm, sometimes referred to as the Deutsch-Josza algorithm, allows evaluation of a function f with codomain {0, 1}, for values from the set {0, ..., 2n − 1} rather than just the set {0, 1}. The input x is now a collection of n qubits together representing the number in binary notation. Whether the function considered is constant or balanced can in this case be discovered by looking at the array of zero’s and one’s produced by measuring the n qubits in the last phase of the algorithm.

For large n, the improvement -with respect to a classical algorithm- of the time required to learn whether the function of interest is constant or balanced is much more significant than for the n = 1 case (the original Deutsch algorithm): To accquire the desired information, a classical algorithm needs to be executed up to 22n+1 times while a single execution of the extended Deutsch algorithm provides the same result.

(25)

The circuit for the extended Deutsch algorithm is given below:

∣x⟩ / H⊗n

Uf (x)

H⊗n

∣y⟩ H

An example of an input state for the Deutsch algorithm for n + 1 qubits is ∣Φtot⟩1= ∣1⟩⊗n∣1⟩. To clarify how this extended algorithm works exactly, the evolution of this input state while it passes different stages of this algorithm, will now be compared to a condensed version of the example of the transformation of the state ∣Ψtot⟩1= ∣1 ⊗ 1⟩ which was discussed in the previous section: ∣Ψtot⟩1= ∣1 ⊗ 1⟩ ∣Ψtot⟩2= ∣H1 ⊗ H2⟩ = ( 1 √ 2(∣0⟩ − ∣1⟩) ⊗ 1 √ 2(∣0⟩ − ∣1⟩)) ∣Ψtot⟩3=Uf[ 1 √ 2(∣0⟩ − ∣1⟩) ⊗ ∣0⟩ − ∣1⟩ √ 2 ] ∣Φtot⟩1= ∣1⟩⊗n∣1⟩ ∣Φtot⟩2=H⊗n[∣1⟩⊗n] H[∣1⟩] = ( 1 √ 2) n ( ∣0⟩ − ∣1⟩ )⊗n ∣0⟩ − ∣1⟩ 2 ∣Φtot⟩3=Uf[( 1 √ 2) n ( ∣0⟩ − ∣1⟩ )⊗n ∣0⟩ − ∣1⟩√ 2 ]

To write out the unitary transformation Uf in ∣Ψtot⟩3 and ∣Φtot⟩3 concicely it is useful to first consider a more general case. The transofrmation Uf maps the state ∣x, y⟩ onto the

state ∣x, y ⊕ f (x)⟩. When the given state is of the form ∣x, y⟩ = ∣x⟩ ⊗ (∣0⟩−∣1⟩√

2 )this conversion

can be described as follows:

∣a⟩ ⊗ (∣0⟩ − ∣1⟩√ 2 ) = 1 √ 2( ∣a, 0⟩ − ∣a, 1⟩ ) Ð→ Uf[ ∣a⟩ ⊗ ( ∣0⟩ − ∣1⟩ √ 2 )] = 1 √

2( ∣a, 0 ⊕ f (a)⟩ − ∣a, 1 ⊕ f (a)⟩ ) = 1 √ 2∣a⟩ ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ ∣0⟩ − ∣1⟩ whenf (a) = 0 ∣1⟩ − ∣0⟩ whenf (a) = 1 =√1 2∣a⟩ ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ ∣0⟩ − ∣1⟩ whenf (a) = 0 −( ∣0⟩ − ∣1⟩ )whenf (a) = 1 = (−1)f (a)∣a⟩ ⊗( ∣0⟩ − ∣1⟩ )√ 2

(26)

The ∣a⟩ mentioned above is in ∣Ψtot⟩3 equal to (∣0⟩−∣1⟩√

2 ). With this, ∣Ψtot⟩3 can be rewritten

to: ∣Ψtot⟩3= ((−1)f (x) ( ∣0⟩ − ∣1⟩ ) √ 2 ) ⊗ ( ∣0⟩ − ∣1⟩ ) √ 2 = ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ (∣0⟩−∣1⟩) √ 2 when f (0) = f (1) = 0 − (∣0⟩−∣1⟩) √ 2 when f (0) = f (1) = 1 (∣0⟩+∣1⟩) √ 2 when f (0) = 0, f (1) = 1 (−∣0⟩−∣1⟩) √ 2 when f (0) = 1, f (1) = 1 ⊗ ( ∣0⟩ − ∣1⟩ ) √ 2 = ⎧ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎩ ± (∣0⟩−∣1⟩) √ 2 ⊗ (∣0⟩−∣1⟩) √ 2 when f (0) = f (1) ± (∣0⟩+∣1⟩) √ 2 ⊗ (∣0⟩−∣1⟩) √ 2 when f (0) ≠ f (1)

In ∣Φtot⟩3, ∣a⟩ is given by (√1

2)

n

( ∣0⟩−∣1⟩ )⊗n. This can also be written as (√1

2)

n

∑x∈{0,1}n(−1)x∣x⟩,

Where the term (−1)x ensures that the Hadamard gate transforms on the ∣1⟩ input states are depicted properly (as +∣0⟩−∣1⟩√

2 ). To write out the Uf transform the latter expression for

∣a⟩ can be combined with the (−1)f (x)∣x⟩ ⊗ (∣0⟩−∣1⟩√ )

2 term in the general case example, to

obtain for ∣Φtot⟩3:

∣Φtot⟩3= ( 1 √ 2) n [ ∑ x∈{0,1}n (−1)f (x)(−1)x∣x⟩ ] ⊗( ∣0⟩ − ∣1⟩ )√ 2

In the last step before measurement, Hadamard gates are applied to the n qubits that make up ∣a⟩: ∣Φtot⟩4= ( 1 √ 2) n H⊗n[ ∑ x∈{0,1}n (−1)f (x)(−1)x∣x⟩ ] ⊗( ∣0⟩ − ∣1⟩ )√ 2

A single Hadamard gate transforms a state ∣s⟩ -where s is either 0 or 1- into: H ∣s⟩ =(−1) 0×s∣0⟩ + (−1)1×s∣1⟩ √ 2 = 1 √ 2i∈{0,1}∑ (−1) i×s∣i⟩

(27)

H⊗n∣s⟩⊗n= ( 1 √ 2) n ∑ i∈{0,1}n (−1)i×sj∣i⟩

Using these two results, equation (4.7) can be written as:

∣Φtot⟩4= ( 1 √ 2) n (√1 2) n [ ∑ x∈{0,1}n (−1)f (x)(−1)x[ ∑ i∈{0,1} (−1)i×x∣i⟩ ]] ⊗( ∣0⟩ − ∣1⟩ )√ 2 (4.1)

Only one measurement needs to be carried out to determine whether the function f (x) is constant or balanced -which is the object when using this algorithm-. To understand how the outcome of this single measurement needs to be interpreted to uncover the necessary information about f (x), the probabilities embedded in the state ∣Φtot⟩4should be analysed. As mentioned in chapter 2, a state such as ∣Ψtot⟩4is associated to a probability density.

The probability for the measurement to procude the state ∣0⟩⊗n equals

P (∣0⟩⊗n) = ( ∑x∈{0,1}(−1)f (x)+x+i×x 2n ) 2 = (∑x=0 (−1)f (0)+0+i×0 2n ) 2 = (∑x=0 (−1)f (0) 2n ) 2 If f (x) is constant, P (∣0⟩⊗n) = (±1)2

=1. It equals (+1)2when f (x) = 0 ∀x and (−1)2when f (x) = 1 ∀x. ∣Φtot⟩4is a normalised state which means that the sum of all probabilities must equal 1. (All qubit operations preserve the norm α2

+β2=1 for qubit vector ψ = α ∣0⟩ + β ∣1⟩ since they are described by unitary matrices) Consequently, measurement must return all zero’s –the state ∣0⟩⊗n– when the function under consideration is constant.

If the function is balanced however, the probabilityP (∣0⟩⊗n) equals zero. This is because the positive and negative contributions in the sum in ∑x=0(−1)f(0)

2n exactly cancel when half

the values of x give f (x) = 0 and the other half give f (x) = 1, which is always the case for a balanced function with codomain {0, 1}. Hence, if the function is balanced measurement must return an array of values containing at least one 1.

In conclusion: The extended Deutsch algoritm for n+1 input qubits, delivers for an unknown constant or balanced function with codomain {0, 1}, n zero’s when the unknow function is constant and at most n − 1 zero’s when it is balanced.

4.5

Final Notes

The efficiency of the Deutsch algorithms, can to a great extent be attributed to the Hadamard gates. Indeed it is essential to the conecpt of quantum parallelism in general. As will become

(28)

clear in later chapters, the transform H⊗nis actually a simple example of a quantum fourier transform. The quantum fourier transform is important in quantum computing, since the efficiency of many quantum algorithms stems from the use of this transform. One such algorithm will be discussed in the next chapter.

The origins of the quantum fourier transform, and its role in a general class of quantum algorithms, will be discussed in detail in chapter 6.

(29)

Chapter 5

Algorithms - Part Two

5.1

The Shor Factoring Algorithm

The Shor algorithm is an algorithm designed to factorise numbers efficiently — to resolve them into primes in polynomial time. One of the reasons why this algorithm is so important is that the security of widely used public key cryptographic protocols relies on the conjec-tured difficulty of factoring large numbers.1 At its foundation is an order-finding algorithm. An order-finding problem cannot be solved in polynomial time using known classical algo-rithms; That is, none of the classical algorithms that have been constructed for this problem, can solve it using resources polynomial in the bits needed to specify the number which is to be factored. This is exactly why the Shor Algorithm is much more effective than its classical counterparts;

This ‘order finding’ is the determination of the order k of a random whole number q. k is defined as the smallest positive whole number that satisfies the relation

qk=1 mod N

That this k exists and is thus defined is a result from number theory. The order-finding algorithm that is made use of in the Shor algorithm can be described in different ways. First of all, an order-finding problem can be addressed in the context of finding the period of a function. Second of all, it can be addressed in te context of estimating the eigenvalue of a certain operator. The first requires a more rigorous approach, and will receive ample treatment in the next chapter. The latter involves the reduction of the problem to a so-called ‘phase estimation‘ problem and will be discussed in this chapter. Phase estimation is the process by which a phase φ, which is a term in the exponent of the eigenvalues of a certain operaror, is estimated. The quantum Fourier transform is an essential element of both order-finding algorithms.

Ahead of all further discussion of order finding, its place in the Shor factoring algorithm should be understood. The algorithm is, with the exception of the part where the order of a number needs to be determined, entirely based on number theory and some well known and efficient classical algorithms.

1As a reasonable number of authors has discussed. Examples of a works that were studied for this paper

(30)

Qualitatively, finding a factor of the number N using the Shor algorithm, means carrying out the following sequence of actions.

●Test if N is even or a power of a prime. If yes, factor with the relevant classical algorithm. Otherwise continue

●Randomly choose a number q which satisfies 0 < q < N .

● Test if gcd(q, N ) > 1 . If yes, this gcd is the factor. Otherwise, q is coprime to N , so continue.

●Determine the order k of this number using the order finding algorithm. ●Only accept k when it is even, and define k = 2l. (otherwise return to step 2). ●Substitute k into the relation qk=1 mod N : q2l= (ql)2=1 mod N .

●Observe that this means that ql is a square root of 1 mod N

● Only accept ql when it is a non-trivial square root of 1 mod N — that is when ql ≠ ±1 mod N . (otherwise return to step 2).

→ Now ql can be used to find a factor of N.

●Observe that since (ql)2=1 mod N , (ql)2−1 must be divisible by N.

●Observe that as (ql)2−1 = (ql−1)(ql+1), N must share a factor with at least one of the terms (ql−1) and (ql+1). In particular, the gcd of this term and N , is such a factor. → This is the desired factor of N .

●Work out gcd(N, ql+1) and gcd(N, ql−1) using the Euclidian Algorithm (classical). This yields at least one factor of N.

●Repeat from step 2 until N is factored completely

The reason the cases where N is even or a power of a prime are excluded in the first step of this algorithm, is that a non-trivial square root of 1 mod N might not exist for these cases. Having to exclude them does not impose a limitation: in both cases the problem can be solved effectively using known classical algorithms.

To keep the powers of q from getting too large to work with, all calculations are done modulo N .2

The factoring algorithm for an odd number N that is not a power of a prime is sufficiently efficient because a randomly chosen q yields a factor of N with sufficiently large probability. This follows from analysis of the group of numbers that satisfy gcd(q,n)=1. Proof that the probability the algorithm finds a factor is sufficiently high is given in [5] and [23].

In [24], Patel summarises the efficiency of the Shor Factoring algorithms as follows: “A Fourier transform requires multiplication of an [n × n] matrix with an n-component vector, which is an O(n2) problem. The FFT (Fast Fourier Transfom) factorisation reduces the operations to O(n log2n). Furthermore, in case of period finding, the QFT superposition

cuts down the operations to O((log2n)2).”

At the beginning of this paragraph was suggested that the quantum Fourier transform is an essential element in the process of order finding and consequently of factoring as well.

(31)

Therefore, this transform will be discussed before details of the process of order finding by the estimation of eigenvalues are studied.

The works that were considered for this chapter (for certain ideas or definitions) are [16], [23], [24], [18] and [6].

5.2

The Quantum Fourier Transform

5.2.1

Definition

The Quantum Fourier Transform is the quantum analogue of the discrete classical Fourier transform. It can be applied to a so-called ‘register’ of qubits and is essentially a basis transformation: ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ x.0 . . . . . . . xN −1 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ QF T ÐÐÐÐ→ ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ y0 . . . . . . . yN −1 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠

When the qubit register is denoted by {∣j⟩}, an orthonormal basis, the transform can be written as: M −1 ∑ j=0 xj∣j⟩ QF T ÐÐÐÐÐ→ M −1 ∑ k=0 yk∣k⟩

Here the yk are the Fourier transforms of the original amplitudes xj. For an orthonormal

basis {∣j⟩} consisting of the states ∣0⟩ , ..., ∣M − 1⟩, the Quantum Fourier Transform maps an individual basis state onto the Fourier basis as follows:

∣j⟩ → √1 M M −1 ∑ k=0 e2πijkM∣k⟩ (5.1)

With this the discrete Quantum Fourier Transform (QFT) for an arbitrary state ψ (which can be decomposed into the basis states ∣j⟩ and coefficients as always) can be written as:

∣ψ⟩ = ∑ j cj∣j⟩ → ∑ k ( 1 √ M ∑j e2πijkMcj) ∣k⟩ (5.2)

(32)

M in (5.1) and (5.2), which is essentially the ’size’ of the QFT, is usually chosen as M = 2n. This is because all numbers up to 2n in binary notation can easily be represented by a register of n qubits. A number a in binary notation is denoted by a = a1a2...anwhich stands

for a = a12n−1+a22n−2+... + an20. Qubits are one or zero thus lend themselves perfectly for

the binary representation of a number.

In chapter 6 the actual meaning of this M is clarified.

5.2.2

Unitarity

The Quantum Fourier Transform is a unitary operation because the quantum gates it is composed of are unitary: A circuit representing this transformation consists only of the Hadamard, CNOT and controlled-U gates that were introduced in chapter 3. That the transformation is unitary can also be shown by writing out the requirement for unitarity, Q†Q = I, explicitely. Indeed, below (in (5.3)) this requirement is written out for an arbitrary element of the matrix Q†Q. The result of this shows that Q†Q = I holds for the Quantum Fourier Transform in (5.1); it peserves inner product and is unitary.

In (5.3) the fact that ⟨k∣k⟩ = 1 (which is true since the {∣k⟩} form an orthonormal basis) was used. ⟨l∣ QF T†QF T ∣m⟩ =√1 M M −1 ∑ k=0 e−2πiMlk⟨k∣1 M M −1 ∑ k=0 e2πimkM ∣k⟩ = ( 1 √ M) 2M −1 ∑ k=0 e2πi(−l+m)kM ⟨k∣k⟩ = M −1 ∑ k=0 1 Me 2πi(−l+m)kM = δl,m (5.3)

When l = m the sum equals 1, and when l ≠ m it equals zero. This is because

1. When l = m; All terms e2πi(−l+m)kM equal e0=1. They add up to M , which cancels the 1 M

factor.

→the sum equals 1.

2. When l ≠ m; e2πil−mM does not equal 0 or 1, but multiplication by e2πil−mM does not alter

the sum, rather it only rearranges the terms. Therefore, the e2πi(−l+m)kM terms must add up

to zero.

→the sum equals 0.

The entries of matrix QF T†QF T equal δl,m, therefore this matrixc must be equal to the

(33)

5.2.3

The Product Notation

To understand the connection between the Quantum Fourier Tranfsorm in (5.1) and the circuit that represents the transform, it is useful to write (5.1), the action on an individual basis state, in in the so-called ‘product representation’. To this end, it should be observed that a basis state ∣k⟩ represents a number of qubits (k1, ..., kn for an n-qubit quantum

computer) and can be written in different ways:

∣k⟩ = ∣k1...kn⟩ = ∣k1⟩ ⊗... ⊗ ∣kn⟩ =

n

g=1

∣kg⟩ (5.4)

Using that the relation between the M in (5.1) and n the number of qubits is set to M = 2n, that each kltakes values 0 and 1 (like all qubits) and (5.4), the sum in (5.1) can be rewritten

like this: 2n−1 ∑ k=0 ∣k⟩ = 1 ∑ k1=0 ⋯ 1 ∑ kn=0 ∣k1...kn⟩ = 1 ∑ k1=0 ⋯ 1 ∑ kn=0 n ⊗ g=1 ∣kg⟩ = n ⊗ g=1 ( 1 ∑ kg=0 ∣kg⟩ ) (5.5)

In the first term, the number of states is 2n=M . When combinatorics is taken into account, it is clear that this is preserved when the notation of n individual sums is introduced. Another thing to note is that the decimal number k is equivalent to the binary number k1, ..., kn; The individual qubits represent k in binary notation. The standard procedure to

convert a binary number to a decimal one is to multiply the gth value in the binary number –here this would be kg– with 2n−g (n − g rather than g because the last digit in a binary

number corresponds to the first power of 2). As such the relation between the kg and k can

be written as the following sum:

k =

n

g=1

kg2n−g (5.6)

With k in this sum notation, the fraction in the exponent in (5.1) can be rewritten to:

jk M = jk 2n =j n ∑ g=1 kg2n−g 2n =j n ∑ g=1 kg 2g

(34)

This result can be incoporated in the product sign ⊗ng=1 introduced to rewrite ∣k⟩. Using

that, (5.1) can be rewritten in product notation.3:

∣j⟩ →√1 M M −1 ∑ k=0 e2πijkM ∣k⟩ = 1 √ 2n 2n−1 ∑ k=0 e2πij ∑nl=1kl2l ∣k⟩ = 1 √ 2n 2n−1 ∑ k=0 (e2πijk121e2πij k2 22⋯e2πij kn 2n) ∣k⟩ = 1 √ 2n n ⊗ α=1 ( 1 ∑ kl=0 e2πijkl2l ∣kl⟩ ) = 1 √ 2n n ⊗ α=1 (e2πij⋅02l ∣0⟩ + e2πi j⋅1 2l ∣1⟩ ) = 1 √ 2n n ⊗ α=1 ( ∣0⟩ + e2πi2lj ∣1⟩ ) (5.7)

Analogous to the different representations of k presented earlier (in (5.6)), j can be written as the binary number

j1j2....jn=

n

g=1

jg2n−g

So in each term in the ⊗ product, the exponent becomes:

2πi n ∑ g=1 jg2n−g2−α=2πi n ∑ g=1 jg2n−g−α

The transform of a basis state ∣j⟩ in product notation can be written more explicitely like this: ∣j⟩ →√1 2n n ⊗ α=1 ( ∣0⟩ + e2πi ∑ng=1jg2n−g−α∣1⟩ ) (5.8)

3In the step from the second to the third line, was used that(abc)( ∣x

1⟩⊗∣x2⟩⊗∣x3⟩ ) = (a ∣x1⟩ )⊗(b ∣x2⟩ )⊗

(35)

5.2.4

The Quantum Fourier Transform Circuit

The circuit below corresponds to the Quantum Fourier Transform:

∣j1⟩ H R2 ⋯ Rn−1 Rn ⋯ ⋯ × ∣j2⟩ ● ⋯ H ⋯ Rn−2 Rn−1 ⋯ × .. . ⋯ ∣jn−1⟩ ⋯ ● ⋯ ● ⋯ H R2 × ∣jn⟩ ⋯ ● ⋯ ● ⋯ ● H ×

In this circuit, H and Rp are defined as in chapter 3:

H = √1 2( 1 1 −1 1) Rp= ( 1 0 0 e2πi2p)

The Rp gate is in a controlled-U gate construction in this circuit. That means it is applied

to the target qubit only when the control qubit is in state ∣1⟩. When the control qubit is in state ∣0⟩ the systemstate remains the same.

The action of the Hadamard gate H and the phase-gate Rp on the states ∣0⟩ and ∣1⟩ is:

H ∣0⟩ = √1 2( ∣0⟩ + ∣1⟩ ), H ∣1⟩ = 1 √ 2( ∣0⟩ − ∣1⟩ ) Rp∣0⟩ = ( 1 0 0 e2πi2p) ( 1 0) = ( 1 0), Rp∣1⟩ = ( 1 0 0 e2πi2p) ( 0 1) = ( 0 e2πi2p) (5.9)

With this information one can describe how the QFT circuit transforms input state ∣j⟩. When this is done, it will be obvious that the circuit given above indeed represents the Quantum Fourier Transform. This is because the output of the circuit exaclty equals the output of the QFT as given in equation (5.8). To distinguish between systemstates at dif-ferent steps of the circuit, the notation ∣X⟩iis used to denote the system state at the ithstep. The input state is:

● ∣X⟩1= ∣j1⟩ ⊗ ⋯ ⊗ ∣jn⟩

(36)

(+ and − in (5.9)) must be accounted for in the new systemstate ∣X⟩2. This can be done by using the factor e2πi21j1 ∶ H ∣j1⟩ = ( ∣0⟩ + e2πi

j1

21 ∣1⟩ ). This is a good helpcontruction because

e2πi210 =e0=1 and e2πi

1

21 =eπi=cos π + i sin π = −1 so the above matches what is given in (5.9) ● ∣X⟩2= 1 √ 2( ∣0⟩ + e 2πij1 21 ∣1⟩ ) ⊗ ∣j2⟩ ⊗ ⋯ ⊗ ∣jn

The R2 gate is applied if ∣j2⟩ = ∣1⟩, but not if ∣j2⟩ = ∣0⟩. The same helpconstruction as the

one used in the previous step can be utilised to account for this. Adding a factor j2 to

the exponent given in (5.9) ensures that when j2=1 the gate regains its original form but when j2=0 the gate turns into the identity matrix which leaves the systemstate unchanged. Consequently the transformation of the state of the first qubit can be written as

R2( ∣0⟩ + e2πi j1 21∣1⟩ ) = ( ∣0⟩ + e2πi j1 21e2πi j2 22 ∣1⟩ ) = ( ∣0⟩ + e2πi( j1 21+ j2 22)∣1⟩ )

Which gives system state:

● ∣X⟩3= 1 √ 2( ∣0⟩ + e 2πi(j1 21+ j2 22)∣1⟩ ) ⊗ ∣j2⟩ ⊗ ⋯ ⊗ ∣jn

The rest of the Rp gates applied to the first qubit, give a similar result:

● ∣X⟩4= 1 √ 2( ∣0⟩ + e 2πi(j1 21+ j2 22+...+ jn 2n)∣1⟩ ) ⊗ ∣j2⟩ ⊗ ⋯ ⊗ ∣jn

Now a H gate is applied to the second qubit. Again the factor introduced for the first Hadamard gate can be used, the only difference being that of course j2 is in the exponent

rather than j1: ● ∣X⟩5= 1 √ 2 1 √ 2( ∣0⟩ + e 2πi(j1 21+ j2 22+...+ jn 2n)∣1⟩ ) ⊗ ( ∣0⟩ + e2πi j2 21 ∣1⟩ ) ⊗ ∣j3⟩ ⊗ ⋯ ⊗ ∣jn

The n − 1 controlled phase gates that follow this Hadamard gate yield the state:

● ∣X⟩6= 1 √ 2 1 √ 2( ∣0⟩ + e 2πi(j1 21+ j2 22+...+ jn 2n)∣1⟩ ) ⊗ ( ∣0⟩ + e2πi(21j2+ j3 22+...+ jn 2n)∣1⟩ ) ⊗ ∣j 3⟩ ⊗ ⋯ ⊗ ∣jn⟩

(37)

Continuing in like manner (now with j3 for the Hadamard gate, j4 as the control qubit for

the first controlled phase gate, etc) gives:

● ∣X⟩7= 1 √ 2n( ∣0⟩ + e 2πi(j1 21+ j2 22+...+ jn 2n)∣1⟩ ) ⊗ ⋯ ⊗ ( ∣0⟩ + e2πi jn 21 ∣1⟩ )

In the final step, the CNOT gates reverse the order of the individual qubit states, which gives the output state:

● ∣X⟩8= 1 √ 2n( ∣0⟩ + e 2πijn 21 ∣1⟩ ) ⊗ ⋯ ⊗ ( ∣0⟩ + e2πi( j1 21+ j2 22+...+ jn 2n)∣1⟩ )

This result corresponds exactly to (5.8), and therefore also to (5.1).

5.3

Phase or Eigenvalue Estimation

With phase estimation the eigenvalues of certain unitary operators can be approximated; The phase φu in eigenvalue equation (5.12), where U is unitary, can be approximated.

U ∣u⟩ = e2πiφu∣u⟩ (5.10)

The following diagram describes this process scematically:

∣0⟩ H ⋯ ● QF T† M .. . ... . .. ... ∣0⟩ H ● ⋯ M ∣u0⟩ U20 ⋯ U2n−1 .. . ... ... ∣ux−1⟩ ⋯

There are two qubit registers in this diagram: The first consists of n qubits in state ∣0⟩. The second of x qubits that together make up the state ∣u⟩ = ∣u0. . . un−1⟩. n, the number

of qubits in the first register, depends on accuracy required (for φu). In the second register

there are as many qubits as are necessary to create state ∣u⟩. The circuit consists of:

1. n H operators (H⊗n)

(38)

3. An inverse quantum fourier transform on n qubits 4. n measurement gates

The controlled-U gates affect the ∣u⟩ state, but because of eigenvalue equation (5.12), the factors that the transforms yield can be taken up in the states in the first register. Because they are controlled, the factor (of e2πiφu) is only given to the ∣1⟩ part of the Hadamard states.

The systemstate of the first register that emerges from applying the controlled-U gates is exactly equal the output of the QFT presented in the previous section. Therefore applying the inverse QFT yields a state which includes the φu

Measurement then yields φu. The value of φu this yields is exactly correct when it can be

written in a n bit binary expansion but gives a good approximation when this is not the case.

It is insightful to write out the transformation of the input state in different steps of the circuit, as was done in previous sections. Systemstate ∣X⟩ in step i of the phase estimation process is explicitely: ∣X⟩1= ∣0⟩⊗n∣u⟩ ∣X⟩2=H⊗n[ ∣0⟩⊗n] ∣u⟩ = ( 1 √ 2) n ( ∣0⟩ + ∣1⟩ )⊗n∣u⟩ ∣X⟩3= ( 1 √ 2) n n ⊗ α=1 U2n−α[( ∣0⟩ + ∣1⟩ )α∣u⟩ ] = ( 1 √ 2) n n ⊗ α=1 ( ∣0⟩ + e2πiφu⋅2n−α∣1⟩ ) ∣u⟩ (5.11)

In ∣X⟩3, α describes which qubit the transform is applied to. The construction ensures the gate U2n−α=U2

0

is applied to the last qubit, which is the one for which α = n. In the second line, the exponent of the phase-factor becomes apparent. For the last qubit, and gate U20,

this is of course (e2πiφu)20=e2πiφu⋅20.

When φu can be expressed in n bits, it can be written as in (5.6); as the binary fraction: n

g=1

φug

2g

this means the exponent in each term in the ⊗ product in (5.11) can be written as

t ∑ g=1 φug2 −g 2t−α= n ∑ g=1 φug2 n−g−α

(39)

With this exponent, the systemstate at step 3 of the circuit is equal to: X3= 1 √ 2n n ⊗ α=1 ( ∣0⟩ + e2πi ∑ng=1φg2n−g−α∣1⟩ ) ∣u⟩

which corresponds exactly to the output of the quantum Fourier transform as described in the previous section. Here, φg has taken the place of jg. Because a Fourier tranformation

of ∣j⟩ gives (5.8), an inverse Fourier transform on X3 gives ∣φ⟩. The final output state is

therefore:

∣X⟩4= ∣φ⟩ ∣u⟩

The last step is to measure the n qubits that make up φ(= φ1...φn)

As was noted before, in general φ cannot exactly be written with n qubits. The above is the exact solution when φ can be represented by an n qubit register. In the general case, th above gives a good approximation of φ.4

5.4

Finding the Order

As observed in the previous sections of this chapter, an essential part of the factoring algoritm is finding k the order of q, where:

qk=1 mod N

This can be done by estimating the phase φ = sk, using phase estimation as described in the previous section, for eigenvalue equation

U ∣us⟩ =e2πi

s

k∣us (5.12)

And extracting k from this phase using ‘continued fraction expansion’, a process for which an efficient classical algorithm exists. The operator U in the eigenvalue equation above transforms an arbitrary state ∣a⟩ as follows:

U ∶ ∣a⟩ → ∣qa mod N ⟩

(40)

This operation is only non-trivial when a is between 0 and N − 1. The eigenstates ∣us⟩in eigenvalue equation (5.12) are:

∣us⟩ = 1 √ k k−1 ∑ c=0 e−2πiksc∣qcmod N ⟩

That these ∣us⟩satisfy the eigenvalue equation is obvious when they are substituted into it:

U ∣us⟩ = ∣q ⋅ us⟩ = 1 √ k∑c e−2πiksc∣qc+1mod N ⟩ e2πisk∣us⟩ =1 k∑c e−2πiks(c−1)∣qcmod N ⟩ =1 k∑l e−2πiksl∣ql+1mod N ⟩ (5.13)

In the last step the index was redefined using c = l + 1, c − 1 = l

Certain details ensure this process works, but will not be elaborated on in this paper. These are:

- The controlled U operations can be performed efficiently

- The eigenstates can be prepared because of the normalisation condition; √1

r∑l∣ul⟩ = ∣1⟩

which means a register of ∣1⟩ ’s is a superposition of eigenstates.

- The order k can be extracted from the phase φ = ks using ‘continued fraction expansion algorithm’ which is a classical algorithm

The order finding circuit is exactly the same as the phase estimation circuit, but with oper-ator U specified.

5.5

Final Notes

This chapter demonstrated how numbers can be factored efficiently with number theory, some classical algorithms and an efficient quantum circuit for order-finding. The order of a number can be extracted from a phase, obtained with the ‘phase estimation’ circuit which makes use of the quantum Fourier transform; The two main things that were established in this chapter are; first of all that N can be factorised efficiently when the order of a random number (0-N-1) can be determined efficiently, and second of all that this order finding can be done efficiently by estimating eigenvalues, a process which requires an efficient quantum Fourier tansform circuit.

In chapter 6 the quantum Fourier transform will be elaborated on further, and a different approach to order finding will be presented.

(41)

Something which is important but was not discussed in detail in this chapter, is that a randomly chosen q is likely enough to have even order and yield a non-trivial root of unity (modulo N ), and thus a nontrivial factor. The relevant probabilities are computed for ex-ample in [23].

In [5], Charenza calculates that when the order of a uniformly chosen element is determined, the probability to find a non-trivial factor is at least 12. He also discusses how likely it is that the order is indeed found. One of his results is that explicitely, the overall probability that the factoring algorithm finds non trivial factors of N ≤ 100 is at least 20 log log N1 .

Referenties

GERELATEERDE DOCUMENTEN

For example, for dense matrices of size n = 1000 and low number of distinct values, the average time of spectral it is 663,46 milliseconds, for SFS it is 642,58 milliseconds and

oude!banmolen!van!de!hertogen!van!Brabant,!ook!gekend!als!het!Spaans!huis.!In!de!periode!1625U

Empiricism is here revealed to be the antidote to the transcendental image of thought precisely on the basis of the priorities assigned to the subject – in transcendental

Ten eerste moest er een mogelijkheid komen om door middel van post-globale commando's er voor te zorgen dat stukken tekst alleen op het computerscherm worden

Next we extended the concept of past and future data from 1D to 2D systems, and introduced the concept of left, right, top and bottom data, resulting in 4 recursive Hankel

In a second step we focus on the response time and try to predict future response times of composite services based on the simulated response times using a kernel-based

The pilgrims or tourists who visited the shrine 15 or 20 years ago still remember that it was a simple underground chamber where the devotees – Hindus and Muslims – came

In order to reduce the probability of combinatorial background events from residual muons entering the detector decay volume and to respect the limits on the instantaneous beam