• No results found

Quantum Computational Risk Modeling

N/A
N/A
Protected

Academic year: 2021

Share "Quantum Computational Risk Modeling"

Copied!
71
0
0

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

Hele tekst

(1)

Master Physics and Astronomy

Research Project 2

Quantum Computational Risk Analysis

Laura E. Schleeper BSc

January, 2020

Supervisor: prof. dr. B.D. Kandhai

(2)

Abstract

In the future, quantum computers may compute tasks faster than classical computers and perform computations which are impossible on classical computers. It is expected that this new technology will have a disruptive impact in finance. An example of an algorithm having such an impact is Amplitude Estimation (AE), which is discussed in this thesis. AE is a quadratic speedup over Monte Carlo methods for computing the Value at Risk of a portfolio. Moreover, this thesis assists readers from outside the field of physics to come to grips with quantum algorithms and concepts in quantum computers. This thesis is based on literature study and the following references, i.e. chapter 1-6 of Yanofsky, N.S. and Mannucci, M. A. (2008), Woerner, S. and Egger, D.J. (2019) Egger et al. (2019) and Stamatopoulos et al. (2019).

Title: Quantum Computational Risk Analysis

Author: Laura E. Schleeper BSc, laura.schleeper@student.uva.nl UvA Student Number: 10587462

VU Student Number: 2532497 Supervisor: prof. dr. B.D. Kandhai Second examiner: dr. S. Sourabh Size: 18 EC

Submission date: January, 2020

Conducted between April 1st, 2019 and January 24th, 2020.

Research conducted at the Centrum Wiskunde & Informatica (CWI), Netherlands Or-ganisation for Scientific Research (NWO), Science Park 123, 1098 XG, Amsterdam, The Netherlands

Faculty of Science

Universiteit van Amsterdam

Science Park 904, 1098 XH Amsterdam http://www.uva.nl/fnwi/

Faculty of Science

Vrije Universiteit Amsterdam

De Boelelaan 1081, 1081 HV Amsterdam https://beta.vu.nl/

(3)

Contents

1 Introduction 4

2 Critical properties of quantum computers 5

2.1 Superposition . . . 5

2.1.1 Bloch Sphere . . . 6

2.1.2 Hadamard-gate . . . 8

2.2 Entanglement . . . 8

2.2.1 Assembling quantum systems . . . 9

2.2.2 Quantum entanglement . . . 9

3 Deutsch’s algorithm 11 3.1 Quantum circuit of Deutsch’s algorithm . . . 12

3.2 Deutsch’s algorithm in vector notation . . . 13

3.3 Deutsch’s algorithm in the Dirac-notation . . . 16

4 Value at Risk on a Quantum Computer 19 4.1 Loading Uncertainty . . . 19

4.1.1 Uncertainty in classic computers . . . 20

4.1.2 Uncertainty in quantum computers . . . 20

4.2 Portfolio Loss Valuation . . . 22

4.2.1 Expected Value . . . 22

4.2.2 Profit-Loss Distribution . . . 24

4.3 Bisection search finding VaR . . . 25

4.3.1 Compare Loss to fixed value . . . 25

4.3.2 Phase Estimation . . . 27

4.4 Quadratic Speedup . . . 30

5 Outlook 32

(4)

1 Introduction

A major breakthrough in quantum hardware was established in the summer of 2018 by researchers of Qutech at Delft University Netherlands [1]. Prof. Ronald Hanson and his group established entangled links between quantum chips on demand, which is crucial for the scalability of this technology. It is expected that quantum chips exceeding 50 qubits are to surpass what is possible on a classical computer [2]. Theoretically, quantum algorithms compute certain things faster and are able to do things that are not possible on ordinary computers, such as quantum information, true randomness and a speedup over Monte Carlo simulations [3, 4]. Unfortunately, quantum information is beyond the scope of this thesis.

Understanding quantum computing by both people in research and business is crucial for success of this technology [5]. This technology is expected to have a disruptive impact, which will put businesses and governments behind if they find themselves unfamiliar in quantum computing [6]. Nevertheless, considerable opportunities lie on the horizon at the beginning of controlled entanglement hardware era.

This thesis focuses on the quantum algorithm Amplitude Estimation (AE), which is a quadratic speedup over classical Monte Carlo methods. We selected its application to obtain the Value at Risk (VaR) of a two assets portfolio. Moreover, this algorithm has various applications in finance, such as option pricing and credit risk analysis of a multivariate random variable [7, 8]. The aim of this project is to assist readers from outside the field of physics or quantum computing to come to grips with critical concepts in quantum computing and how this is applied in quantum algorithms. In particular, we discuss Quantum bit (qubit) in superposition state and entanglement. Then we show how these properties are used in Deutsch’s quantum algorithm to solve a simple problem. Although Deutsch’s algorithm has no real applications in finance, it facilitates the reader to understand the way of thinking required for quantum computing. We then discuss AE applied to estimate the VaR of a two-assets portfolio. We identify and discuss four main aspects of this algorithm based on a review of recent literature. Finally, we give an outlook of when we expect quantum computing will be implemented in finance.

(5)

2 Critical properties of quantum

computers

Quantum computers differ from classical computers in their use of qubit instead of bits. This allows for enhanced mathematical tools that could otherwise not be applied. Qubits introduce two fundamental concepts: superposition and entanglement. The next subsections will discuss each of these concepts.

2.1 Superposition

A qubit is the quantum analogue of a bit, which is either 0, 1 or both. Mathematically a qubit is described by the so-called quantum state vector [9]. The state vectors repre-senting a qubit form a basis which span a two-dimensional complex vector space.1 Such

vectors obey three important mathematical properties of a basis namely basis vectors are normalised, orthogonal, and complete [9]. In other words, the magnitude of a vector is unity, the basis vectors are perpendicular to each other and any vector in this space can be written as a linear combination of its basis vectors [9]. The qubit state vectors are given by c0 c1  = c0 0 1  + c1 1 0  (2.1) where the coefficients c0 and c1 are complex numbers called the amplitude of the state.

Each vector represents a possible state of the qubit as follows: state 0 = c0 0 1  (2.2) state 1 = c1 1 0  (2.3) Hence, that the qubit state in eq. (2.1) is both in state 0 and state 1 simultaneously, being in both states simultaneously is called being in a superposition state [10]. The superposition state is normalised, i.e. |c0|2+ |c1|2 = 1. The squared amplitude, |ci|2, can

be interpreted as the probability of measuring state 0 or 1. It is important to note that a

(6)

superposition only exists in the quantum computer and not in a classical computer. As a consequence, outputting any information from a quantum computer to our classical world in which financial products exists will always give a classical state back. However, as long as we don’t perform measurements, quantum computations can be done.

The above vector notation of a qubit state is undesirable for quantum calculations using multiple qubits which result in high dimensional vector states. Therefore, the Dirac notation2 is introduced:

state 0 = |0i state 1 = |1i

superposition = c0|0i + c1|1i

(2.4)

The Dirac notation makes identifying the different states of which the superposition state consists easier. Nevertheless, this notation comes with difficulties as well, which we explain in next subsection when we will look at multiple qubits entangled.

2.1.1 Bloch Sphere

The qubit state vector is geometrically represented by the surface of the Bloch sphere (fig. 2.2) [11].3 In other words, every point on the surface of the Bloch sphere is a possible realisation of a qubit state. Please recall, the qubit state is given by complex state vectors. The coefficients c0 and c1 are complex numbers. Complex numbers consist

of two real numbers, i.e. z = x + iy. Fig. 2.1 represents the circle constructed by a complex number. Here, the x-axis corresponds to the real part of z and the y-axis to the imaginary part. Hence, that one complex number represents a two-dimensional circle.

Figure 2.1: Geometric representation of a complex number.

2|xi is referred to as ket 3

Steroegraphic project allows to represent the qubit state as a sphere in R3, which has a projection on a complex plane in the C2.

(7)

This circle can also be expressed in polar coordinates, as c = reiφ. The complex ampli-tudes of the qubit state vectors are represented by polar coordinates as

c0 = r0eiφ0

c1 = r1eiφ1.

(2.5) The complex coefficients in eq.(2.5) and Dirac notation allows us to write eq. (2.1) as

|Ψi = r0eiφ0|0i + r1eiφ1|1i , (2.6)

where the qubit state |Ψi depends on four real variables r0, r1, φ0, φ1. What’s more, we

can reduce the amount of real variables by rewrite eq. (2.6) as

|Ψi = r0|0i + r1ei(φ1−φ0)|1i , (2.7)

where we define φ = φ1 − φ0. The state |Ψi now depends on only three variables.

However, we can even further reduce the amount of variables by using the normalisation property 1 = |c0|2 + |c1|2 = |r0|2+ |r1eiφ|2 = r20 + r12 = cos2(θ) + sin2(θ). (2.8)

From this follows that r0 = cos(θ) and r1 = sin(θ). This allows us to write |Ψi as the

canonical basis depending on two real variables as

|Ψi = cos(θ) |0i + sin(θ)eiφ|1i , (2.9)

which is geometrically represented by a three-dimensional sphere of R3 with radius 1

called the Bloch sphere (see fig. 2.2) [11].4

Figure 2.2: The Bloch sphere visualises the qubit state |ψi.

4

The projection of an object in R3 to a plane in C2 is referred to as stereographic projection. Stereographic projection is part of the mathematical field of topology, which is beyond the scope of this master thesis. Nevertheless, interested readers new to the field of topology are referred to the book [12]. Whereas, more advanced readers may look at [13, 14, 15].

(8)

Here, the angle φ means the rotations of the state of the qubit around the z-axis and the angle between the z-axis and the xy-plane is denoted as θ. Using these identities for the coefficients allows the qubit to be in every possible state on the surface of the sphere. Hence, that θ controls the probability to which state the qubit collapses in.

2.1.2 Hadamard-gate

The superposition state is created by applying the Hadamard-gate (H-gate) on a single qubit. The H-gate is given by the matrix,

H = √1 2 1 1 1 −1  . (2.10)

Hence, the H-gate is constructed by a rotation of π2 around the y-axis followed by rotation of π around the x-axis. If we apply the H-gate on the |0i qubit state we find,

H |0i = √1 2 1 1 1 −1  1 0  = √1 2 1 1  = √1 2( 1 0  +0 1  ) = √1 2(|0i + |1i). (2.11)

Analogously, the H-gate applied to the |1i state yields to, H |1i = √1 2 1 1 1 −1  0 1  = √1 2  1 −1  = √1 2( 1 0  −0 1  ) = √1 2(|0i − |1i). (2.12)

The H-gate applied to the superposition will result in a single qubit state, i.e. |0i or |1i.

2.2 Entanglement

Entanglement is another feature of quantum mechanics that makes it fundamentally different from classical theories. Entanglement finds its basis in assembled quantum systems. The mathematical notation of such a system will be explained first. Next, we will look at quantum entanglement again described by an example.

(9)

2.2.1 Assembling quantum systems

A single qubit represents a 0, 1 or both at the same time. An assembled qubit system that contains n qubits represents 2n possible numbers at the same time in binary. Such

an assembled qubit system is called a quantum register of size n [16]. Each of these numbers is stored in a qubit state. We assemble two qubits, for instance |1i and |0i as

|Ψi = c1|1i ⊗ c0|0i = c |10i , (2.13)

where, this tensor product creates number 3 in binary and c1, c2, c squared denote the

probabilities of each state, which follows clearly by looking at the tensor product in vector notation: |Ψi = 0 c1  ⊗c0 0  (2.14) =     0 0 c1∗ c0 0     , (2.15)

where c1 ∗ c2 equals c. Hence, the tensor product constructs the probability of each

possible outcome of the combined system. Likewise, a register of qubits assembled by tensor products represents larger numbers. Taking the tensor product of two qubits in superpositions yields to = √1 2(|0i + |1i) ⊗ 1 √ 2(|0i + |1i) (2.16) = 1

2(|00i + |01i + |10i + |11i), (2.17)

where we compute 22 different states, denoting four numbers at the same time. Denoting

all numbers of eq.(2.17), i.e. 00, 01, 10 and 11, on a classical computer requires 8 bits. This is four times as many bits than the required qubits on a quantum computer. A register of qubits is given by

|Ψi = 2n−1 X i=0 ci|iin, (2.18) where i = 2n−1i

n−1+ ... + 2i1+ i0 denote an integer in binary, each qubit in the register

is represent by ik ∈ {0, 1} with k = 0, .., n − 1. Note that the probability of the state

|iin = |i0i ⊗ |i1i .... ⊗ |ini = |i0i1...ini is given by P(i) =

Pn

i=0|ci|2. This result is

important because it allows us to load distributions directly into quantum computers based on the inherent domesticity of quantum measurements (see sec. 4.1) [17].

2.2.2 Quantum entanglement

Quantum computers would not exist without entanglement between assembled qubit systems. Quantum entanglement allows to execute a task on multiple qubits with the

(10)

same gate, i.e. qubits act as a group as a consequence of entanglement. For instance, quantum entanglement allows us to label a set of qubits in good |0i and bad |1i states. Suppose we have the assembled quantum system |αi consisting of the qubits in state |xi and |yi, such that

|αi = |x0i |y1i + |x1i |y0i ,

where the subscript denotes the state of each qubit, measuring the state of the first qubit yields to either |x0i or |x1i and determines simultaneously the state of the other

qubit. For instance, measuring |x0i determines the second qubit to be in the |y1i state.

This also holds when the second qubit is measured first. Therefore, we call the qubits entangled. However, not every quantum system is entangled by definition. For instance, the assembled system |βi consisting of |xi and |yi qubits as

|βi = |x0i |y1i + |x1i |y1i . (2.19)

Here measuring the second qubit does not provide us any information about the state of the first quibt. Therefore, we call this a separable state. Moreover, entangled states can even exist at large distances. For instance, a qubit at the moon can theoretically be entangled to a qubit located on earth [11]. In other words, regardless of where qubits are located in space they can still be entangled. This is especially important for quantum internet and information. Although far distance entanglement is theoretically possible, entanglement turns out to be hard to control in real life. Environmental perturbation can interfere with the entangled system. This interference explains why it is difficult to scale amount of qubits on a quantum chip.

(11)

3 Deutsch’s algorithm

Deutsch algorithm is the simplest quantum algorithm [11]. This algorithm determines whether a function f : {0, 1} 7→ {0, 1} is balanced or constant, i.e. f (0) 6= f (1) or f (0) = f (1). Solving this problem classically requires to evaluate the function twice (see fig. 3.1). Nevertheless, on a quantum computer it can be solved by one evaluation.

Figure 3.1: Two evaluations are needed to determine classically if a function f : {0, 1} 7→ {0, 1} is balanced or constant. Four different functions can be computed. In this section we will show that for a constant function the state 0 is measured on a quantum computer, whereas a 1 will be measured for a balanced function. We first demonstrate this for the vector notation. Then we explain Deutsch algorithm in the Dirac-notation. The Dirac-notation works more efficiently than the vector notation when we compute complex algorithms with a register of qubits, such as quantum amplitude estimation (AE). We use AE in section 4 to compute the value at risk (VaR) of a two-asset portfolio. Additionally, the corresponding quantum circuit is addressed. The quantum circuit is a schematic representation of all the qubits and gates involved.

(12)

3.1 Quantum circuit of Deutsch’s algorithm

Quantum computing uses quantum circuits to schematically represent the algorithms. Each quantum algorithms consists of four main steps:

1). Initiate input qubit in classical state1

2). Put qubits in superposition by Hadamard gate (H-gate)

3). Evaluate the function by applying Unitary function evaluation gate (Uf-gate)

4). Measure the qubit’s output.

These four steps are indicated in Deutsch’s quantum circuit in figure 3.2. The quantum

Figure 3.2: Quantum circuit for Deutsch’s algorithm indicating the four main steps of a quantum algorithm. This algorithm solves the problem if a function is constant f (0) = f (1) or balanced f (0) 6= f (1). For constant functions we obtain a |0i whereas for balanced function we find |1i.

circuit reads from left to right starting with two input qubits. Parallel lines denote en-tangled qubits by applying a tensor product. The boxes depict quantum gates operating on the states of the qubits by using unitary matrices. The quantum gates can transform qubits into a new qubit state. Not all qubits are affected by operators. For instance, if the qubit state vector is an eigenvector of the operator matrix, it will not be affected [9]. Deutsch’s algorithm applies three types of quantum gates: H-gate, Uf-gate and

Mea-surement gate. The next subsection shows how these gates work on the qubits. First, we will show this for the vector representation of qubits and gates. Then we will discuss the Deutsch’s algorithm for the Dirac notation. Both notations give the same outputs, i.e. for a constant functions we measure the 0-state while the 1-state is obtained for balanced functions.

1The state of the input qubit is determined by convention of the algorithm. This can be either |0i

(13)

3.2 Deutsch’s algorithm in vector notation

Deutsch’s algorithm is given by the following tensor product and matrix multiplications:

(H ⊗ I)Uf(H ⊗ H) |x, 1i , (3.1)

where H refers to the Hadamard-gate and Uf to the unitary matrix representing the

function of evaluation. This equation will be solved from right to left. Starting with the first expression on the right gives:

|x, 1i =x0 x1  ⊗0 1  =     0 x0 0 x1     (3.2)

The tensor product of the vectors involved becomes a vector C4. Next, the Hadamard-gate will be applied to both qubits.

H ⊗ H |x, 1i = √1 2 1 1 1 −1  ⊗ √1 2 1 1 1 −1      0 x0 0 x1     = 1 2     1 1 1 1 1 −1 1 −1 1 1 −1 −1 1 −1 −1 1         0 x0 0 x1     = 1 2     x0+ x1 −(x0+ x1) x0− x1 −(x0− x1)     (3.3)

After putting both top and bottom qubit in a superposition Uf is applied, which swaps

entries of the vector in eq.(3.3). The Uf-operator is given by

Uf =     00 01 10 11 00 u1 u2 0 0 01 u2 u4 0 0 10 0 0 u5 u7 11 0 0 u6 u8     . (3.4)

The bold numbers above the Uf-matrix indicate the four input entries of the state vector

in eq.(3.3) and the bold numbers in front of the matrix the output entries. Depending on the function, the state of the second qubit changes as |x, yi 7→ |x, y ⊕ f (x)i.2 For

(14)

instance, entry u1 has input 00, i.e. x = 0 and y=0. If 0 ⊕ f (0) = 0 is true then the

entry u1 is set to 1. Hence, the top qubit will not change value by the Uf-operator.

Therefore the top right and bottom left blocks are 0. Applying the Uf-operator to the

H ⊗ H |x, 1i yields to, Uf(H ⊗ H) |x, 1i = 1 2       00 01 10 11 00 u1 u2 0 0 01 u2 u4 0 0 10 0 0 u5 u7 11 0 0 u6 u8       .     x0 + x1 −(x0+ x1) x0− x1 −(x0− x1)     (3.5)

As an example we take one of the 4 possible function of Uf, where f(0)=1 and f(1)=0

yields to the matrix

Uf(H ⊗ H) |x, 1i = 1 2     0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1         x0+ x1 −(x0+ x1) x0− x1 −(x0− x1)     = 1 2     −(x0+ x1) x0 + x1 x0− x1 −(x0− x1)     (3.6)

Hence, the Uf-matrix swaps the first two entries of the input vector. Lastly, the H-gate

is applied to the top qubit and an identity matrix to the bottom qubit.

(H ⊗ I)Uf(H ⊗ H) |0, 1i = 1 2√2 1 1 1 −1  ⊗1 0 0 1      −(x0 + x1) x0+ x1 x0− x1 −(x0− x1)     = 1 2√2     1 0 1 0 0 1 0 1 1 0 −1 0 0 1 0 −1         −(x0+ x1) x0+ x1 x0− x1 −(x0− x1)     = 1 2√2     −(x0+ x1) + (x0− x1) (x0+ x1) − (x0− x1) −(x0+ x1) − (x0− x1) (x0+ x1) + (x0− x1)     (3.7)

(15)

(H ⊗ I)Uf(H ⊗ H) |0, 1i = (x0 − x1) 2√2       −(x0+x1) (x0−x1) + 1 (x0+x1) (x0−x1) − 1 −(x0+x1) (x0−x1) − 1 (x0+x1) (x0−x1) + 1       (3.8)

Next we multiplying the vector by 1 = (x0+x1)

(x0+x1), yielding to (x0+ x1) (x0− x1) = (x0+ x1) (x0− x1) (x0+ x1) (x0+ x1) = x 2 0+ x0x1+ x1x0+ x21 x2 0− x21

Since x0 and x1 can’t be 1 at the same time, x0x1 = x1x0 = 0. Substituting this into

the previous identity gives us

(x0+ x1) (x0− x1) = x 2 0+ x21 x2 0− x21 = 1, (3.9)

Hence, that the input state of the top qubit determines the sign. Therefore, the conven-tion is that the top qubit starts in the |0i state and the bottom qubit in the |1i state for this algorithm [18]. As a result, we compute the vector

(H ⊗ I)Uf(H ⊗ H) |0, 1i = 1 2√2     −1 + 1 1 − 1 −1 − 1 1 + 1     = √1 2     0 0 −1 1     (3.10)

From this follows that we can write the above vector as a tensor product of multiple vectors, namely (H ⊗ I)Uf(H ⊗ H) |0, 1i = 0 1  ⊗ −1 0  +0 1  √ 2 (3.11)

Finally, we rewrite this expression as

(H ⊗ I)Uf(H ⊗ H) |0, 1i = − 0 1  ⊗ 1 0  −0 1  √ 2 . (3.12)

This identity will show the resembles with the Dirac notation discussed in next sub-section. Following the same procedure for the other three possible realisations of the function yields to constant function = ±1 0  ⊗ 1 0  −0 1  √ 2 balanced function = ±0 1  ⊗ 1 0  −0 1  √ 2 (3.13)

(16)

Consequently, we find the first vector representing the state of the top qubit in the 0-state for a constant function while we measure the 1-state for a balanced function.

3.3 Deutsch’s algorithm in the Dirac-notation

In this section we show that Deutsch’s algorithm measures |0i for the top qubit if the evaluated function is constant, whereas we find |1i for a balanced function. Similarly to last section, we will evaluate the following tensor products and matrix multiplications

(H ⊗ I)Uf(H ⊗ H) |x, 1i . (3.14)

This time we will write the vectors and matrices in the Dirac notations as |ii. Before we discuss Deutsch’s algorithm we first consider a simpler version: Uf(I ⊗ H) |x, 1i. the

theorem that says that (A ⊗ B) ∗ (A0⊗ B0) = (A ∗ A0) ⊗ (B ∗ B0) [11] allows us to write

(I ⊗ H) |x, 1i = (I ⊗ H) ∗ (|xi ⊗ |1i) = (I ∗ |xi) ⊗ (H ∗ |1i) = |xi ∗ H |1i .

(3.15)

Hence, that the H-gate applied to the |1i state in the Diract notation results in |0i−|1i√ 2 .

We than substitute this identity in the previous equation as |xi ∗ H |1i = |xi [|0i − |1i√

2 ] (3.16)

Next Uf(I ⊗ H) |x, 1i will evaluated. The unitary matrix Uf in the Dirac notation

preforms the transformation |x, yi 7→ |x, y ⊕ f (x)i. Therefore, eq. (3.16) will map to the following under Uf

Uf(I ⊗ H) |x, 1i = |xi [

|0 ⊕ f (x)i − |1 ⊕ f (x)i √

2 ] (3.17)

Depending on f (x) this equation will become

Uf(I ⊗ H) |x, 1i = ( |xi [|0i−|1i√ 2 ] if f (x) = 0 |xi [|1i−|0i√ 2 ] if f (x) = 1. (3.18)

We than rewrite |1i−|0i√

2 as −(|0i−|1i) 2 to obtain Uf(I ⊗ H) |x, 1i = (−1)f (x)|xi [ |1i − |0i √ 2 ] (3.19)

(17)

Hence, that the function f (x) decides if the coefficient will either be +1 or −1. We now go back to the original problem of Deutsch’s algorithm:(H ⊗ I)Uf(H ⊗ H) |x, 1i, which

applies a H-gate to the top qubit as well and puts it in a superposition (H ⊗ H) |x, 1i = (H ⊗ H) ∗ (|xi ⊗ |1i)

= H |xi ⊗ H |1i = H |xi ⊗ [|0i − |1i√

2 ].

(3.20)

With both top and bottom qubit in a superposition we apply Uf. Recall that this matrix

only affects the bottom qubit and does nothing with the top qubit. Uf(H ⊗ H) |x, 1i = UfH |xi ⊗ Uf[

|0i − |1i √

2 ]

= H |xi ⊗ [|0 ⊕ f (x)i − |1 ⊕ f (x)i√

2 ]

= H |xi ⊗ (−1)f (x)[|0i − |1i√

2 ]

= (−1)f (x)H |xi ⊗ [|0i − |1i√

2 ] = [(−1) f (0)|0i + (−1)f (1)|1i √ 2 ][ |0i − |1i √ 2 ] (3.21)

Taking the same function as in the previous subsection as an example for Uf we will

find: f (0) = 1 and f (1) = 0. Note that this function is balanced and we thus expect to measure a |1i for the top qubit.

Uf(I ⊗ H) |x, 1i = [ (−1)1|0i + (−1)0|1i √ 2 ][ |1i − |0i √ 2 ] = [−1 |0i + 1 |1i√ 2 ][ |1i − |0i √ 2 ] = [−|0i − |1i√ 2 ][ |1i − |0i √ 2 ] (3.22)

Finally, the Hadamard-gate is only applied to the top qubit, resulting in (H ⊗ I)Uf(H ⊗ H) |x, 1i = − |1i [

|1i − |0i √

2 ] (3.23)

Which is identical to what we found in the vector notation of eq. (3.12). Repeating the same procedure for the other functions yields to

constant function = ± |0i ⊗ |1i − |0i√ 2 balanced function = ± |1i ⊗ |1i − |0i√

2

(18)

Analogously to the vector notation, we find the top qubit in |0i if the function of eval-uation is constant whereas we measure |1i for balanced functions.

(19)

4 Value at Risk on a Quantum

Computer

The value at risk (VaR) is an important risk measure in finance. It determines the loss for a portfolio given with a probability larger than or equal to 1 − α confidence level. The output of any algorithm computing the VaR consists of a loss value with corresponding probability. Currently, Monte Carlo simulation is the preferred method for computing the VaR of a portfolio [3]. This method uses a high computational power to estimate the VaR. The quantum algorithm amplitude estimation (AE) computes the VaR with a quadratic speedup over the Monte Carlo methods [3]. To demonstrate how AE computes the VaR, a two assets portfolio consisting of 1-year US Treasury bills and 2-Year US Treasury notes is used. The only risk of these assets is the uncertainty in interest rate, which we denote by δr. To compute the VaR by using the AE algorithm on a quantum computer we identify three steps, i.e. (1) load the uncertainty distribution δr in the quantum computer, (2) obtain profit-loss distributions and (3) search for the loss with probability closest to 1-α. The next subsections will discuss how these three requirements are implementation on a quantum computer.

4.1 Loading Uncertainty

The two asset portfolio consists of 1-year US Treasury bills and 2-year US Treasury notes. These assets are assumed to be default free and therefore the loss is only dependent on the uncertainty in interest rate (δr). Distributions representing δr can be obtained from historical data by a principle component analysis 1 (see fig. 4.1) [3]. Considering quantum computing as the main topic of this master thesis, details on the principal component analysis can be found in [3]. Nevertheless, it is important to understand the difference in generating uncertainty between classical and quantum computers. There-fore, we first address uncertainty in classical computers. Then uncertainty in quantum computers is discussed as well as loading distributions in quantum computers.

1Quantum Generative Adversarial Networks (qGAN) is another method loading generic probability

distributions in a quantum computer. This generative model uses a classical discriminator, a neural network, and a quantum generator. Although qGANs are beyond the scope of this master thesis interested readers could study [19].

(20)

4.1.1 Uncertainty in classic computers

Classical computers are deterministic machines and unable to generate true random numbers. Nevertheless, random numbers are important to perform among other things simulations, obtain security and cryptographic systems and numerical analysis [20, 21]. The current method of hand is to use pseudo-random numbers. Pseudo-random numbers are generated in a deterministic way and merely appear to be a random sequence [20, 22]. In other words, it passes all statistical test2 so that it is random enough for the problem

to be solved. Sampling pseudo-random numbers require high computational powers and not always generates a long enough sequence. Therefore, certain computational tasks can not be computed on classical computers. It is on this phenomena on which current cryptography is based.

4.1.2 Uncertainty in quantum computers

Yet, quantum computers are able to generate true randomness by using the stochas-tic processes that exists in qubits. Moreover, quantum computer are able to load a probability distribution in a register of qubits.

Figure 4.1: Twist and Shift distribution obtained by a principal component analysis of historical data of the Constant Maturity Treasury rates.

This is done for the distributions of the historical data and are fitted to symmetric distributions (see fig. 4.1). Three qubits are used to represent the Shift distribution. Consequently the | i in the figure consists of three numbers 0 or 1. Analogously, the Twist distribution is loaded into two qubits. Therefore, the Twist | i consist of two numbers 0 or 1. Loading these distribution in the qubits is performed by y-rotations (fig. 4.2) [7] [3].

(21)

Figure 4.2: Y-rotations loading Twist and Shift distribution into a quantum computer.

This is expressed by decomposing the y-rotation as

|Ψ(θ)in = R(θ) |0in= N −1 X i=0 p p(θ)i|iin, (4.1)

where θ denotes the angle between the xy-plane and the z-axis of the Bloch sphere, i to classify the n-qubit state, we compute the |iin = |in−1...i0i state of which the entry i is

the integer i = 2n−1i

n−1+ ... + 2i1+ i0 ∈ {0, ..., 2n− 1}, with ik ∈ {0, 1} and k = 0, ...,

n − 1 [3]. In other words, |ii represents a sample of our distribution given by register of n qubits as |iin. Following this procedure for the Twist distribution yields to

Ry(θ3) |0i = |0i + eiπθ3|1i

Ry(θ4) |0i = |0i + eiπθ4|1i ,

(4.2)

Assembling these states by taking the tensor product results in Ry(θ3) |0i ⊗ Ry(θ4) |0i = (|0i + eiπθ3|1i) ⊗ (|0i + eiπθ4|1i)

= |00i + eiπθ3|10i + eiπθ4|01i + eiπ(θ3+θ4)|11i . (4.3)

To swap the probabilities of the |10i and |11i we can use a CNOT-gate. The CNOT-gate is the quantum analogue of the classical XOR-gate, that is

CN OT |0i |bi = |0i |bi

CN OT |1i |bi = |1i |1 − bi , (4.4)

where we call the first qubit ”control-qubit” and the second ”target-qubit” [23]. Per-forming a CNOT-operation on our state after y-rotation yields to

CN OT Ry(θ) |Ψi = |00i + eiπ(θ3+θ4)|10i + eiπθ4|01i + eiπθ3|11i . (4.5)

(22)

4.2 Portfolio Loss Valuation

The valuation function of the two assets portfolio consisting of 1-year US Treasury bills and 2-Year US Treasury notes is obtained by

V (r1, r2) = VF1 1 + r1 + 4 X i=1 rcVF2 (1 + r2)i + VF2 (1 + r2)4 , (4.6)

where VF1 and VF2 denote the face values, rc the annual compound rate and r1 and r2

are the yield to maturity rates corresponding to 1-year US Treasury bills and 2-year US Treasury notes. Please recall, the only risk of these assets is the uncertainty in interest rate, which we denote by δr. Therefore, ri can be expressed as ri = r0,i+ δri, where

r0,i is today’s yield to maturity and δri the random variable as introduced in previous

subsection based on historical data.

4.2.1 Expected Value

The expected value of this portfolio can be obtained from a quantum computer with a quadratic speedup over the classical Monte Carlo method [24]. To introduce the function from eq. (4.6) into a quantum state, we define an operator

F : |Ψin|0i 7→

N −1

X

i=0

p

1 − f (i)√pi|iin|0i + N −1

X

i=0

p

f (i)√pi|iin|1i , (4.7)

where |Ψinrepresents the distribution of previous section, f (i) the valuation function, pi

the probability of measuring sample state |iinand N the amount of samples depending on total qubits used (n) following N = 2n. Hence, the amplitude squared, i.e.|pf(i)√pi|2,

of the state |iin|1i equals f (i)p(i) = E[f(X)]. Moreover, the input distribution |Ψin is given an label, namely |0i. This algorithm only measures the state with label |1i. The F -operator construct the quantum state with label |1i such that it contains the information we like to obtain, that is the expected value of the portfolio f (i)p(i) = E[f (X)].

Multiple ways exist to implement this quantum state into a quantum computer[?]. How-ever, it is important to keep the required qubits low since the available quantum hardware consists of 5-54 controlled qubits at most. Therefore, we approximate this state by using the following operator

|iin|0i 7→ |iin(cos(f (i)) |0i + sin(f (i)) |1i), (4.8) where f (i) is a Taylor approximation of eq.(4.6) with f : {0, ...,2n − 1}, written as

f (i) = f1i + f0 [7]. This operator is effciently implemented by controlled y-rotations

(23)

this operator to approximate the state in eq. (4.7).3 Nevertheless, we have seen in Deutsch algorithm that we can only output the state of a qubit and not its coefficient, i.e. pf(i)√pi required to estimate the expected value. Nevertheless, the quantum

algorithm Phase Estimation (PE) exists, which allows us to obtain coefficients. The quantum algorithm PE is explained in section 4.3.

(24)

4.2.2 Profit-Loss Distribution

To find the VaR a profit-loss distribution is required (see fig. 4.3). This profit-loss distribution is created by the F -operator such that the following state is obtained

F : |Ψin|0i 7→ N −1 X i=l+1 √ pi|iin|0i + l X i=0 √ pi|iin|1i . (4.9)

This quantum system (eq.(4.9)) represents a distribution consisting of losses |iin with corresponding probabilities |√pi|2. Hence, the |Ψincontains a register of qubits sampling

losses for our two-asset portfolio. These losses stored in |Ψinare obtained by arithmetic operations [25, 26] applied to the loaded δr-distribution along with methods to translate classical logic into quantum circuits [27, 28]. As a consequence, the |ii contains a loss value instead of a δr value.4 Moreover, eq. (4.9) is obtained by choosing a different f(i),

i.e.

fl(i) =

(

1 i ≤ l

0 otherwise, (4.10)

where l is a given target loss. Hence, this function divides the loss register |Ψin into two groups, namely losses larger than l and losses smaller than or equal to l. These two groups are given the labels |0i and |1i respectively. Contrarily, Deutsch’s algorithm showed that labels |0i and |1i can be used to define if the function was balanced or constant. The quantum circuit to implement this sort is addressed in section 4.3.1 Compare Loss to F ixed V alue, because it is fundamental to the operating system of the bisection search. Additionally, the quantum algorithm PE to obtain the coefficients, i.e. √pi, is explained

in the next subsection, because this algorithm is applied to compute an output.

Figure 4.3: Loss distribution |Ψ(θ)in =PN −1

i=0 pp(θ)i|iin constructed by a register of n

qubits. Here, the x-axis represents the loss and the y-axis the corresponding probability.

4Please note that this statement is not entirely true. The register |ii

n consists of tensor products,

i.e. |ii1N, .... N |iin, that represent different samples of the distribution. However, to assist the reader in getting a feeling for what information |iin provides, I have chosen to write the statement like this. Nevertheless, interested readers are referred to the book [11, 18]

(25)

4.3 Bisection search finding VaR

We obtain VaR by preforming a bisection search over the computed losses to find the smallest loss (lα) such that the corresponding probability satisfies P[X ≤ lα] ≥ 1 − α

for a given confidence level α [3]. In other words, we search for the probability closest to our confidence level and obtain its corresponding loss lα. Hence, this requires that

we introduce a comparator which is applied several times for different target losses. Finally, PE applied to the state constructed by the comparator, eq. (4.11), allows us to compute the loss lα and its probability |

pi|2. Additionally, the complexity of this

search algorithm is omitted when [3] claims a quadratics speedup over classical Monte Carlo methods. Nevertheless, [3] state that PE and binary search is still faster than classical for large amount of qubits.

4.3.1 Compare Loss to fixed value

So far, we have seen that expected values of the valuation function can efficiently be obtained by AE. In order to compute the VaR we apply an additional operation, imposing two groups by comparing our computed losses to our target loss (l). This operation is defined such that it maps |iin|0i 7→ |iin|1i, if i ≤ l, while not doing anything else, where |iin contains the computed losses. The quantum circuit which implements this operator is depicted in fig. 4.4 [7]. The quantum circuit consist of a register of qubits

Figure 4.4: Quantum circuit to compare the computed loss to a fixed target loss. The target loss is stored in the array t[n], which determines the logical quantum gate applies. The computed losses are represented in the top register and the second register contains ancilla qubits. The final results is stored in the |ci state.

(26)

qubits. The |ci is the state affected by the mapping and the target loss is represented in binary by the classical array t[n]. The t[n] array determines which gate we use. If t[n] = 0 we apply the Toffoli-gate and if t[n] = 1, we use logical OR. In other words, if t[n] = 0, the ancilla qubit |ani = 1 if and only if |an−1i = 1 and |ini = 1. On the contrary,

when t[n]= 1, the ancilla qubit |ani = 1 if either |an−1i = 1 or |ini = 1 [7]. Finally,

the last qubit of the second register contains the result of the comparison. If this qubit equals 1, it sets the |ci to 1. From this, we obtain the state

N −1 X i=l+1 √ pi|iin|0i + l X i=0 √ pi|iin|1i , (4.11)

where i is the computed loss, |iin the total sum of the computed losses and l the target loss (see fig. 4.3).

(27)

4.3.2 Phase Estimation

The PE algorithm approximates the coefficients phase (φ ∈ [0, 1) ) of a unitary operator U with eigenvector |ui and eigenvalue e2πiφ, where we represent the phase as binary

fraction: φ = 0.φ1...φn, φn ∈ [0, 1]. The PE quantum circuit consists of two registers

(see fig.4.5). The first register consists of t qubits initiated in the |0i state [18]. The value of t relates to two properties of the algorithm, namely accuracy of the estimation and success probability [18]. The second register starts in the |ui state and requires as many states to store this eigenvector. In our case, this |ui represents the state of eq. (4.9).

Figure 4.5: Quantum circuit of the algorithm Phase Estimation, which obtains the ex-pected value of a portfolio. This algorithm consists of two stages. Stage I applies a Hadamard transform to Register I and then performs controlled rotations. Stage II applies the Inverse Quantum Fourier Transform and mea-sures qubits of Register I. The second register contains the state of eq. (4.7). We divided PE into two stages. Stage I puts register I in equal superposition by perform-ing a Hadamard transform, H |0i 7→ √1

2(|0i + |1i). Additional controlled U -operations

are applied to both registers. Hence, the controlled U -operator only works on Register II if the qubit of Register I is in the |1i state, as

Uc(|1i |ui) = |1i (Uc|ui)

= |1i (e2πiφ|ui) = e2πiφ|1i |ui .

(4.12)

(28)

a controlled y-rotation applied on a single qubit of Register I yields to the state, Ucj∗ (H ⊗ I) ∗ (|0i |ui) = Uj

c

1 √

2(|0i + |1i) |ui = √1 2(U j c|0i + U j c |1i) |ui = √1 2(U j c|0i |ui + U j c |1i |ui) = √1

2(|0i |ui + |1i (e

2πi(2jφ)|ui)) = √1 2(|0i + e 2πi(2jφ) |1i) |ui . (4.13)

We then apply this computation on all t qubits in Register I and obtain the state,

Uc∗ (H ⊗ I) ∗ (|0it|ui) = t O l=0 1 √ 2(|0i + e

2πi(2−lφ)|1i) |ui

= 1 2t/2 2t−1 X j=0 t Y l=0 e2πijlφ2−l|j 1...jti |ui = 1 2t/2 2t−1 X j=0 e2πi(Pnl=0jl2−l)φ|j 1...jti |ui = 1 2t/2 2t−1 X j=0

e2πijφ/2t|ji |ui ,

(4.14)

where the integer j = j1...jt with jl ∈ {0, 1}. Additionally, we us that j/2t =

Pn

l=0jl2−l.

Then in Stage II, the Inverse Quantum Fourier Transform (IQF T ) is applied to obtain the phase φ of the eigenvalue, such that

1 2t/2

2t−1

X

j=0

e2πijφ/2t|ji |ui −−−→ |φi |ui ,IQF T (4.15)

where |φi represents the phase in binary. The Quantum Fourier Transform is a quantum analogue of the classical Discrete Fourier Transform, namely

FN = ˆyk = 1 √ N N −1 X j=0 ˆ xje2πijk/N, (4.16)

where ˆx is the input vector of complex numbers x0, ..., xN −1 with N entries and ˆy is the

output vector of y0, ..., yN −1 complex numbers [18]. We denote the row number of this

(29)

1}. From this follows the quantum version of the Fourier Transform working on an orthonormal basis as |ki 7→ FN|ki = 1 √ N N −1 X j=0 e2πijk/N|ji , (4.17)

where N equals 2 to the power of the total qubits (n) involved, N= 2n. Substituting this

identity into the Quantum Fourier Transform yields to

FN|ki = 1 √ N N −1 X j=0 e2πijk/2n|ji . (4.18)

Hence, this is analogue to what we found after Stage I in eq. (4.14). Thus, by applying the IQF T we obtain the φ, which is related to the probability of measuring the corre-sponding state.5 In other words, the φ allows us to obtain the coefficient of eq. (4.9),

that is probabilitypp(i) corresponding to the given target loss l of our portfolio.

5Hence, that I discussed the ideal case here, that is the phase φ can be expressed exactly in binary by

t qubits. For the non-ideal case, the above described procedure is still a well approximation but requires an additional confidence analysis. Therefore, interested readers are referred to [18, pp. 223-226].

(30)

4.4 Quadratic Speedup

In general, the time an algorithm takes to evaluate a tasks depends on two things, namely the input size and running time of the algorithm [29]. The input size is related to the problem one wish to solve while using the algorithm. For VaR estimations we require a high accuracy and thus a larger amount of bits to represent the input, i.e. larger input size. Second, the running time is the number of primitive operations executed on the input to perform the task [29]. In particular, we look at the worst case running time. This is indicated by the big-O notation, i.e. O().

The running time of the Monte Carlo methods is O(M−1/2), where M is the input size [30]. In other words, to improve the accuracy of Monte Carlo methods 10 times the sample size has to increase by 100 times the amount of samples . The quantum algorithm AE has a running time of O(M−1) [3, 24], which is a quadratic speedup in running time over the classical Monte Carlo methods [24].6 To improve the accuracy 10

times of AE the sample size M has to increase by 101 of the total sample size.

Figure 4.6: Running time analysis of Monte Carlo methods (yellow line) and quantum al-gorithm amplitude estimation (blue) with respect to the number of Samples. This analysis is performed on real quantum hardware (solid blue line). The quantum hardware did not consist of more than 4 qubits. The blue dashed line is an indication of estimation error of quantum hardware consisting of more than 4 qubits [3].

(31)

Woerner et al. (2019) has performed running time test (see fig. 4.6) [3]. Fig. 4.6 represents the estimate error of the expected values of the portfolio as a function of input size, i.e. number of samples. The yellow line represents Monte Carlo methods and the blue line quantum algorithm AE performed on real quantum hardware. The blue dashed line shows the results convergence of the error of quantum algorithm AE obtained by quantum simulations on a classical computer. Simulations are performed for five or more evaluation qubits, because only four real qubits were available on the quantum hardware. The exact convergence analysis can be found in the supplementary information of [3]. The Monte Carlo method shows a nearly linear line, which is expected from a squared-root function for small values. Nevertheless, the estimation error of the quantum algorithm AE is less accurate than Monte Carlo methods if the number of samples are less than or equal to 23. However, if the number of samples increases

to values larger than 23 the quantum algorithm AE estimation error decreases rapidly relative to Monte Carlo estimation error. Moreover, the quantum algorithm AE is more accurate than Monte Carlo methods if the number of samples exceeds 24 [3].

(32)

5 Outlook

In this thesis we performed a careful investigation of quantum computing by discussing Deutsch’s algorithm and AE. This thesis is based on a liteature study and the following books and articles [3, 7, 8, 11]. We have seen that AE is a quadratic speedup over classical Monte Carlo simulations in computing the VaR. Moreover, this thesis showed that true random numbers are generated and distributions are loaded in quantum computes due to the stochastic fundament of quantum mechanics. Both concepts are very exciting and erase the question ’When can we implement this on real quantum hardware?’.

In order to perform computation that is not possible on classical computers, two things need to be improved: the amount of and the quality of qubits on a quantum chip. At the core of these properties is the entanglement of qubits [2]. We theoretically discussed entanglement in section 2.2. However, we should not forget that we are talking about real quantum processes happening in quantum chips. The mathematics used is merely a tool in our attempt to describe what happens in nature. Fortunately, this mostly results in a successful prediction. Nevertheless, one should not forget that reality is more com-plicated and that risk exist in the assumptions we make in our attempt to predict and describe nature. The assumption we made of a space consisting only of two entangled qubits does not exist in reality. Externalities such as environmental electric fields or even cosmic rays may affect the entanglement of qubits, causing errors in our computations. Currently, we enter the Noisy Intermediate-Scale Quantum (NISQ), where noisy quan-tum hardware is used for computations [4]. During this era experimental physicist work on quantum error-corrections and the theorist focus on improving current algorithms. In the far future, scientist hope to achieve fault-tolerance quantum computer devices [4, 31]. It is in this fault-tolerance time that we will apply algorithms discussed above in the real world [3]. Although this seems a long-term goal businesses would be wise to invest in quantum computing today [6]. After all, most concepts require a novel way of thinking. Moreover, most literature on quantum computing is still largely based on profound physics and unknown for people from outside of the field of physics [6].

(33)

Bibliography

[1] P. C. Humphreys, N. Kalb, J. P. Morits, R. N. Schouten, R. F. Vermeulen, D. J. Twitchen, M. Markham, and R. Hanson, “Deterministic delivery of remote entan-glement on a quantum network,” Nature, vol. 558, no. 7709, p. 268, 2018.

[2] J. Preskill, “Quantum computing and the entanglement frontier,” arXiv preprint arXiv:1203.5813, 2012.

[3] S. Woerner and D. J. Egger, “Quantum risk analysis,” Nature Partner Journals Quantum Information, vol. 5, no. 1, p. 15, 2019.

[4] J. Preskill, “Quantum computing in the nisq era and beyond,” Quantum, vol. 2, p. 79, 2018.

[5] A. K. V. T. M. Langione, C. Tillemann-Dick, “Where will quantum computers create value - and when?” Boston Consulting Group, 2019.

[6] R. P. Gerbert, “The next decade in quantum computing - and how to play,” Boston Consulting Group, 2018.

[7] N. Stamatopoulos, D. J. Egger, Y. Sun, C. Zoufal, R. Iten, N. Shen, and S. Woerner, “Option pricing using quantum computers,” arXiv preprint arXiv:1905.02666, 2019. [8] D. J. Egger, R. G. Guti´errez, J. C. Mestre, and S. Woerner, “Credit risk analysis

using quantum computers,” arXiv preprint arXiv:1907.03044, 2019.

[9] D. McIntyre, C. A. Manogue, and J. Tate, Quantum Mechanics: Pearson New International Edition. Pearson Higher Ed, 2013.

[10] D. J. Griffiths and D. F. Schroeter, Introduction to quantum mechanics. Cambridge University Press, 2018.

[11] N. S. Yanofsky and M. A. Mannucci, Quantum computing for computer scientists. Cambridge University Press, 2008.

[12] J. R. Weeks, The shape of space. CRC press, 2001.

[13] M. Nakahara, Geometry, topology and physics. CRC Press, 2003.

[14] C. Nash and S. Sen, Topology and geometry for physicists. Dover Publications, 1988.

[15] B. F. Schutz and D. B. F. Schutz, Geometrical methods of mathematical physics. Cambridge university press, 1980.

(34)

[16] A. Ekert, P. Hayden, and H. Inamori, “Basic concepts in quantum computation,” in Coherent atomic matter waves. Springer, 2001, pp. 661–701.

[17] C. Zoufal, A. Lucchi, and S. Woerner, “Quantum generative adversarial networks for learning and loading random distributions,” arXiv preprint arXiv:1904.00043, 2019.

[18] M. A. Nielsen and I. L. Chuang, “Quantum computation and quantum informa-tion,” Phys. Today, vol. 54, pp. 216–247, 2001.

[19] C. Zoufal, A. Lucchi, and S. Woerner, “Quantum generative adversarial networks for learning and loading random distributions,” Nature Partners Journal Quantum Information, 2019, November.

[20] D. E. Knuth, “The art of computer programming, volume 2: Seminumerical algo-rithms,” 1981.

[21] P. Bierhorst, E. Knill, S. Glancy, Y. Zhang, A. Mink, S. Jordan, A. Rommal, Y.-K. Liu, B. Christensen, S. W. Nam et al., “Experimentally generated randomness certified by the impossibility of superluminal signals,” Nature, vol. 556, no. 7700, p. 223, 2018.

[22] W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, Numerical recipes in C 2nd edition: The art of scientific computing. Cambridge university press, 2002.

[23] R. de Wolf, Quantum Computing: Lecture Notes. QuSoft, CWI and University of Amsterdam, 2018.

[24] G. Brassard, P. Hoyer, M. Mosca, and A. Tapp, “Quantum amplitude amplification and estimation,” Contemporary Mathematics, vol. 305, pp. 53–74, 2002.

[25] V. Vedral, A. Barenco, and A. Ekert, “Quantum networks for elementary arithmetic operations,” Physical Review A, vol. 54, no. 1, p. 147, 1996.

[26] M. K. Bhaskar, S. Hadfield, A. Papageorgiou, and I. Petras, “Quantum algorithms and circuits for scientific computing,” Quantum inf. Comput., 2015.

[27] A. S. Green, P. L. Lumsdaine, N. J. Ross, P. Selinger, and B. Valiron, “Quipper: a scalable quantum programming language,” in ACM SIGPLAN Notices, vol. 48, no. 6. ACM, 2013, pp. 333–342.

[28] A. S. Green, P. L. Lumsdaine, N. J. Ross, P. Selinger, and Valiron, “An introduction to quantum programming in quipper,” in International Conference on Reversible Computation. Springer, 2013, pp. 110–124.

[29] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction to algo-rithms. MIT press, 2009.

(35)

H. Mueller-Krumbhaar, D. Stauffer, and J.-J. Weis, Monte Carlo methods in sta-tistical physics. Springer Science & Business Media, 2012, vol. 7.

[31] A. Paler and S. J. Devitt, “An introduction to fault-tolerant quantum computing,” arXiv preprint arXiv:1508.03695, 2015.

(36)

1/24/2020

Quantum Risk Analysis

Part I Introduction to quantum computing 23/08/2019

Why do we care?

Faster 

• Quadratic speedup Monte Carlo

New tasks 

• Encryptography • True randomness 

(37)

1/24/2020

How do quantum computers differ?

Bits 

Bits exist in isolation

Quantum computer

Quantum bits (qubits) 

Entangled qubits act as a group

Computer  3

Critical properties of quantum computers

I.

Qubit 

II. Entanglement

III. Measurement

(38)

1/24/2020

Is either 0, 1 or in a superposition of both:

• Mathematically a qubit is represented as a linear combination of the canonical basis  vectors of     , i.e. a superposition • c0  and c1are complex numbers with radius 1 

I. Qubit

Dirac notation Vector notation Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 5

I. Qubit 

• Hence, only 2 real numbers (θ, φ) identify a qubit • Measuring results in either |0⟩ or|1⟩ • Therefore the latitude θ controls the probability 

(39)

1/24/2020

II. Entanglement 

Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. Two quantum states are assembled by a tensor product 7

II. Entanglement

Assembling quantum systems • Entangled state: unbreakable • Separable state: 

(40)

1/24/2020

III. Measurement

9

Quantum algorithms

Qubits in particular classical state

Put system in superposition of many states

Acting on this superposition with unitary operations

Measure

(41)

1/24/2020

Deutsch algorithm

Given a function 𝑓 ∶ 0,1 → 0,1 as black box, where one can evaluate an input, but can’t ‘’look inside’’ and  ‘’see’’ how the function is defined, determine if the function is balanced or constant.  4 different functions Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 11

Deutsch algorithm

i.  ii. iii. iv.

Important!

Classically 2 evaluations of f(x)  are needed to determine if f(x)  is constant or balanced

(42)

1/24/2020

Deutsch algorithm

Solve from right to left Quantum circuit Quantum gates Measure: , f(x) constant , f(x) balanced  Parallel circuit: ‐> Tensor product Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 13

Deutsch algorithm

Top qubit Bottom qubit Superposition Execution  function  Back to classical state Measure: , f(x) constant , f(x) balanced 

(43)

1/24/2020

Deutsch algorithm

Top qubit Bottom qubit Superposition Execution  function  Back to classical state Tensor product Solve from right to left Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 15

Deutsch algorithm

Top qubit Bottom qubit Superposition Execution  function  Back to classical state Tensor product Solve from right to left

(44)

1/24/2020

Deutsch algorithm

Hadamard-gate:

Top qubit

Bottom qubit Execution function 

Back to classical state Superposition Solve from right to left Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 17

Deutsch algorithm

Hadamard-gate: Top qubit

Bottom qubit Execution function 

Back to classical state

(45)

1/24/2020

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Back to classical state

Superposition

i. ii. iii. iv.

x f(x) Solving the unitary matrix 𝑈 : • 4 different function Example of function iii.  𝑈 of function iii. Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 19

Deutsch algorithm

i. ii. iii. iv.

x f(x)

Example of function iii. 

(46)

1/24/2020

Deutsch algorithm

i. ii. iii. iv.

x f(x) Example of function iii.  𝑈 of function iii. Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 21

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Superposition

Solve from right to left

Don’t workout the brackets yet!

(47)

1/24/2020

Convention  Start with 

• Multiply by

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Superposition Solve from right to left • Divide everything by  Back to classical state Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 23

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Superposition Solve from right to left • Write as a tensor product For the balanced function iii).       is measured for the top qubit! Back to classical state iii.

(48)

1/24/2020

i). ii).  iii). iv).

Deutsch algorithm

x f(x)i. ii. iii. iv.

Measuring the top qubit tells if function is  constant or balanced: Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 25

Deutsch algorithm: Dirac‐notation

Top qubit Bottom qubit Superposition Execution  function  Back to classical state Solve from right to left

(49)

1/24/2020

Hadamard-gate:

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Back to classical state Superposition Solve from right to left Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 27

Deutsch algorithm

Hadamard-gate: Top qubit

Bottom qubit Execution function 

Back to classical state

Superposition

Solve from right to left

(50)

1/24/2020

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Back to classical state

Depending on the f(x) it becomes: Input  output

0 1 1 0 Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 29

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Back to classical state

(51)

1/24/2020

Deutsch algorithm

Hadamard-gate:

Top qubit

Bottom qubit Execution function 

Back to classical state Superposition Solve from right to left Back to the original problem Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 31 • is a scalar

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Back to classical state

Back to the original problem

Ufonly works on bottom qubit

(52)

1/24/2020

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Back to classical state

x f(x)

i. ii. iii. iv.

Depending on f(x) it becomes:

Function iii.

Identical to example vector notation 33

Deutsch algorithm

Top qubit

Bottom qubit Execution function 

Back to classical state

x f(x)i. ii. iii. iv.

(53)

1/24/2020

i). ii).  iii). iv).

Deutsch algorithm

x f(x)i. ii. iii. iv.

Measuring the top qubit tells if function is  constant or balanced: Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 35

Quantum Risk Analysis

Part II The follow‐up 13/09/2019

(54)

1/24/2020

Is either 0, 1 or in a superposition of both:

• Mathematically a qubit is represented as a linear combination of the canonical basis  vectors of     , i.e. a superposition • c0  and c1are complex numbers with radius 1 

Recap: Qubit

Dirac notation Vector notation Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 37

Recap: Qubit 

• Measuring results in either |0⟩ or|1⟩ • Therefore the latitude θ controls the probability 

(55)

1/24/2020

Recap: Qubit 

• Measuring results in either |0⟩ or|1⟩ • Therefore the latitude θ controls the probability  Yanofsky, N. S., & Mannucci, M. A. (2008). Quantum computing for computer scientists. Cambridge University Press. 39

Recap: II. Entanglement 

16 4 2 1 1  0 1 1

(56)

1/24/2020

Value at Risk on a Quantum Computer

Risk 𝑟, 𝛿𝑟 Portfolio • 1‐year US Treasury bills • 2‐year US Treasury notes 41 Woerner, S., & Egger, D. J. (2019). Quantum risk analysis. npj Quantum Information, 5(1), 15. Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR

VaR on Quantum computer

(57)

1/24/2020

Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR

VaR on Quantum computer

43 Woerner, S., & Egger, D. J. (2019). Quantum risk analysis. npj Quantum Information, 5(1), 15.

Loading uncertainty 𝛿𝑟

Load  Uncertainty Compare   to  Bisection  search VaR Principal component analysis • Historical data  • Shift & Twist • Load in QC by rotation matrices 

(58)

1/24/2020

Loading uncertainty 𝛿𝑟

Load  Uncertainty Compare   to  Target Loss (l) Bisection  search VaR Implementation Quantum computer 45

Loss Valuation 

Load 

Uncertainty Loss Valuation 

Compare   to  Bisection  search VaR Implementation Quantum computer • Realizes each loss for every 𝛿𝑟 • Uses the F‐operator  • Takes sum of the loss’s of both assets

(59)

1/24/2020

Implementation F‐operator  • Valuation function V(r1,r2) is piecewise linear • First order approx. of V(r1, r2) 

Loss Valuation 

Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR 47 Woerner, S., & Egger, D. J. (2019). Quantum risk analysis. npj Quantum Information, 5(1), 15.

Loss Valuation

Load 

Uncertainty Loss Valuation 

Compare  

to  Bisection 

search VaR

(60)

1/24/2020

Phase estimation

Register I. Register II. Stage I • t: number of digits of accuracyt: probability in which Phase  Estimation procedure to be successful t Stage II • Initial state is eigenvector of U • As many qubits needed to store this  vector Nielsen, M. A., & Chuang, I. (2002). Quantum computation and quantum information. 49 Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR

Phase estimation

Controlled rotations Load  Loss Valuation  Compare  

to  Bisection  VaR

(61)

1/24/2020

Phase estimation

Stage I in detail Controlled rotation: Nielsen, M. A., & Chuang, I. (2002). Quantum computation and quantum information. 51 Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR

Phase estimation

Stage I in detail Controlled‐U2j: Load 

Uncertainty Loss Valuation 

Compare  

to  Bisection 

(62)

1/24/2020

Phase estimation

Stage II t Stage II in detail Inverse Fourier Transform: • Ideal case:  ..  Can be written exactly  with t qubit binary expansion • Non‐ideal case:  ..  Can not be  written exactly with t qubit binary  expansion. Next time! Nielsen, M. A., & Chuang, I. (2002). Quantum computation and quantum information. 53 Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR

Phase estimation

Stage I in detail

(63)

1/24/2020

Phase estimation

Stage II t Stage II in detail Inverse Fourier Transform: • Ideal case:  ..  Can be written exactly  with t qubit binary expansion • Non‐ideal case:  ..  Can not be  written exactly with t qubit binary  expansion. Next time! Nielsen, M. A., & Chuang, I. (2002). Quantum computation and quantum information. 55 Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR

Quantum Fourier transform

Load 

Uncertainty Loss Valuation 

Compare  

to  Bisection search VaR

• Quantum analogue of Discrete Fourier Transform Stage II in detail

(64)

1/24/2020

Quantum Fourier transform

Nielsen, M. A., & Chuang, I. (2002). Quantum computation and quantum information.

57

Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR • Quantum analogue of Discrete Fourier Transform Stage II in detail • Inverse Quantum Fourier Transform yields to

Phase estimation

Stage II t Stage II in detail Inverse Fourier Transform: • Ideal case:  ..  Can be written exactly  with t qubit binary expansion Load 

Uncertainty Loss Valuation 

Compare  

to  Bisection 

(65)

1/24/2020

Loss Valuation

59

Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR Phase Estimation 

Compare Loss to target Loss 

Load 

Uncertainty Loss Valuation 

Compare  

to  Bisection 

(66)

1/24/2020

Compare Loss to target Loss 

Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR Implementation Quantum computer: • Input classical target loss l • Compare with computed losses • Divide them in 2 groups, 0 or 1 Loss 61

Compare Loss to target Loss 

Load 

Uncertainty Loss Valuation 

Compare  

to  Bisection 

search VaR

(67)

1/24/2020

Bisection Search 

Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR Implementation Quantum computer • VaR equals smallest level l Such that • Confidence level   Probability given i 63

Value at Risk

Load 

Uncertainty Loss Valuation 

Compare  

(68)

1/24/2020

Load 

Uncertainty Loss Valuation 

Compare   to  Target Loss (l) Bisection  search VaR

VaR on Quantum computer

65

Outlook 

Amplitude Estimation 

• More qubits to achieve quantum advantage • Longer circuits

(69)

1/24/2020

Questions?

Referenties

GERELATEERDE DOCUMENTEN

De relatieve bijdrage % van de vijf bladniveaus bij paprika aan de netto fotosynthese en verdamping van het hele gewas medio juli, augustus, september en oktober, gevolgd door

In the classical regime (thermal energy kT much greater than the level spacing Δ£), the thermopower oscillates around zero in a sawtooth fashion äs a function of Fermi energy (äs

Density of states for the Andreev kicked rotator with M 131 072, dwell 5, and K 14 solid line, compared with the Bohr-Sommerfeld calculation histogram, and the RMT prediction

We intioduce quantum maps with paiticle hole conversion (Andieev leflection) and paiticle hole symmetry, which exhibit the same excitation gap äs quantum dots in ihe pioximity to

It can mainly show that certain correlations can be simulated with quantum entangled bananas, but not with classical local resources (Bub, 2016, p...

De onderzoekers bleken echt met praktijkresultaten te kunnen komen en niet alleen maar hun eigen hobby’s na te streven, wat maakte dat de sector ook het Wat heeft

Om het herstel van uw kind te bevorderen en te voorkomen dat de klachten toenemen, is het noodzakelijk de eerste dagen na het ongeval uw kind te laten rusten en:..  Niet te

In 2006, we audited our FISH-positive 22qDS results and found a clinical recognition rate of 1.7% (18 FISH-positive tests in 1 048 patients that had been newly diagnosed with