0% found this document useful (0 votes)
270 views79 pages

Quantum Computing For Finance, Oswaldo Zapata PHD

This book explores the transformative impact of quantum computing on the finance industry, providing insights for finance professionals and students on how to prepare for this technological revolution. It covers key concepts of quantum computing, its advantages over classical methods, and practical applications in finance, including portfolio optimization and machine learning. The guide also outlines steps for financial institutions to adopt quantum technologies and remain competitive in the evolving landscape.

Uploaded by

tg4645753
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
270 views79 pages

Quantum Computing For Finance, Oswaldo Zapata PHD

This book explores the transformative impact of quantum computing on the finance industry, providing insights for finance professionals and students on how to prepare for this technological revolution. It covers key concepts of quantum computing, its advantages over classical methods, and practical applications in finance, including portfolio optimization and machine learning. The guide also outlines steps for financial institutions to adopt quantum technologies and remain competitive in the evolving landscape.

Uploaded by

tg4645753
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 79

Quantum Computing for Finance

An Introductory Guide

Oswaldo Zapata, PhD

The purpose of this short book is to illustrate how quantum computing is transform-
ing the future of finance and to outline the actions that professionals and financial
institutions can—and must—take to prepare for the upcoming revolution. It is
specifically intended for finance students and professionals who are interested in
learning how quantum computing is transforming their industry. Quantum comput-
ing experts with an interest in finance may also find it valuable.
1 Introduction 5

2 Review of Quantum Computing 7


2.1 Quantum Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Computational Errors and Fault Tolerance . . . . . . . . . . . . . . . 12
2.3 Hybrid Quantum-Classical Algorithms . . . . . . . . . . . . . . . . . 14

3 Non-Quantum Approaches 15
3.1 Optimization Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.1 Portfolio Optimization . . . . . . . . . . . . . . . . . . . . . . 18
3.2 Monte Carlo Simulation . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.1 Stochastic Processes . . . . . . . . . . . . . . . . . . . . . . . 21
3.2.2 Monte Carlo and the Greeks . . . . . . . . . . . . . . . . . . . 24
3.3 Machine Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.3.1 ML Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3.2 ML in Finance . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.4 Computational Finance . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.4.1 Historical Background . . . . . . . . . . . . . . . . . . . . . . 40
3.4.2 Python’s Dominance . . . . . . . . . . . . . . . . . . . . . . . 40

4 Quantum-Enhanced Solutions 45
4.1 Quantum Portfolio Optimization . . . . . . . . . . . . . . . . . . . . 46
4.1.1 The VQE Algorithm . . . . . . . . . . . . . . . . . . . . . . . 46
4.1.2 The QAO Algorithm . . . . . . . . . . . . . . . . . . . . . . . 49
4.2 Quantum Machine Learning . . . . . . . . . . . . . . . . . . . . . . . 52
4.2.1 QML Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.2.2 QML in Finance . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.3 Programming Quantum Computers . . . . . . . . . . . . . . . . . . . 58

5 How to Get Quantum-Ready 61


5.1 Adopting Technological Innovations . . . . . . . . . . . . . . . . . . . 62
5.1.1 Consequences of Delaying Technology Adoption . . . . . . . . 62
5.1.2 The Big-Data Revolution in Fintech . . . . . . . . . . . . . . . 64
5.2 The Race for the First Quantum Computer . . . . . . . . . . . . . . . 65
5.3 Financial Industry Leaders . . . . . . . . . . . . . . . . . . . . . . . . 69
5.4 The Startup Landscape . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.5 A Safe Roadmap to the Quantum Future . . . . . . . . . . . . . . . . 73

6 Conclusion 75

3
Chapter 1

Introduction

The purpose of this short book is to illustrate how quantum computing is transform-
ing the future of finance and to outline the actions that professionals and financial
institutions can—and must—take to prepare for the upcoming revolution.
It is specifically intended for finance students and professionals who are interested
in learning how quantum computing is transforming their industry. Quantum com-
puting experts with an interest in finance may also find it valuable.
Chapter 2 provides a brief overview of quantum computing. Since I have already
explained the basics of quantum computing in detail in previous notes,1 this chapter
focuses only on the key concepts most relevant to the upcoming chapters.
In Chapter 3, I discuss some of the most pressing challenges currently faced by the
financial industry and how experts are addressing them. Specifically, I highlight ar-
eas where quantum computing shows promise in offering significant advantages. Key
topics include portfolio optimization, Monte Carlo simulations, and various prob-
lems involving artificial intelligence models, particularly machine learning. Without
delving too deeply into technical details, I also touch on the programming skills
necessary to tackle these problems.
Chapter 4 discusses how quantum computing can help address the challenges men-
tioned in the previous chapter, particularly in portfolio optimization and the inte-
gration of quantum computing with machine learning. It concludes with a survey of
the most popular frameworks used to program several quantum hardware available
today in the market.
Chapter 5 provides an overview of the quantum computing landscape specifically
for finance. I discuss the maturity of quantum hardware, concrete examples of major
firms and startups driving the adoption of quantum technology, as well as practical
advice on what professionals and financial institutions can begin doing now to avoid
falling behind and gain a competitive advantage.
A final note on how to approach this guide: I suggest focusing on the chapters and
sections that align with your interests and background. For instance, if you are a
chief innovation officer at a bank and find the chapter on quantum computing too
challenging, feel free to skip ahead to the parts most relevant to you. Conversely,
if you are a quantum computing physicist and find this chapter too basic, move
on to the material that captures your interest. That said, for a comprehensive
understanding of the subject, I recommend reading and digesting the entire book.
1
See “An Introduction to Quantum Computing for Physicists” and “A Second Course on Quan-
tum Computing for Physicists.” You can find them on my LinkedIn. In the following, I will refer
to them as QC1 and QC2.

5
6 CHAPTER 1. INTRODUCTION

Feel free to connect with me on LinkedIn and let me know if you have any feedback:
https://www.linkedin.com/in/oswaldo-zapata-phd-quantum-finance.
Chapter 2

Review of Quantum Computing

Quantum computers are expected to solve some problems significantly faster and
more accurately than classical devices. This chapter provides a brief summary of
their key features.
Quantum computation is a quantum mechanical approach to solving computa-
tional problems. It uses the principles and mathematical formalism of quantum
mechanics—such as state vectors, unitary operators, and measurements—to arrive
at logical solutions to given computational problems. A quantum computer , on the
other hand, is the physical device that implements the quantum computational pro-
cesses of interest. For decades, it was believed that quantum computations could
only be performed on quantum computers built entirely from quantum components.
In this chapter, we will see that this is no longer the case. Today, experts are con-
vinced that the first machines to surpass classical supercomputers will be hybrid
devices, composed of both quantum and classical components working together in
tandem.
This chapter is organized as follows. Sections 2.1 and 2.2 review fundamental
concepts of quantum computing, with a focus on the circuit model of quantum
computation and error correction. Section 2.3 offers a preliminary introduction to
the hybrid quantum-classical computational models just mentioned.

2.1 Quantum Circuits

Let us begin with the most fundamental concepts. A model of computation, broadly
speaking, is a logical framework that defines how to proceed given a set of basic
elements and instructions. More precisely, a model of computation is characterized
by a set of abstract objects and a collection of elementary operations on these
objects. An algorithm is a sequence of precise instructions defined within a model
of computation, designed specifically to solve a computational problem.
For example, the Boolean or binary model of computation is based on the so-called
Boolean algebra. In Boolean algebra, there are only two elements, conventionally
denoted by 0 and 1, and three elementary operations, referred to as NOT, AND,
and OR. If we denote any two arbitrary elements as i, j = 0, 1, and use the standard

7
8 CHAPTER 2. REVIEW OF QUANTUM COMPUTING

notation of the arithmetic system, the elementary operations are defined as follows:

NOT (i) = NOT i = ī = 1 − i , (2.1.1)


AND (i, j) = i AND j = ij , (2.1.2)
OR (i, j) = i OR j = i + j − ij . (2.1.3)

In the context of computer science, an element i of Boolean algebra is known as a


binary digit, or bit for short. The elementary operations are called Boolean logical
gates.

NOT OR AND

Fig. 2.1. The three fundamental Boolean gates.

A Boolean circuit is a sequence of Boolean gates. As is typically the case with


electric circuits, Boolean circuits are often represented visually by circuit diagrams.
Since every Boolean circuit is a deterministic process (because the action of each
individual gate is deterministic), it follows that for every string of bits entering a
Boolean circuit (the input), there is a unique string of bits that exits it (the output).
Thus, any Boolean circuit defines a unique Boolean function. The reverse problem is
also of interest: given a Boolean function, what is the Boolean circuit that realizes
it? In this case, however, it can be proven that the circuit is not unique. For
example, some circuits may contain more logical gates than others. A circuit that
solves a problem using fewer logical gates is said to be more efficient.
The analysis of the depth (size) and complexity of a circuit, that is, the number of
gates employed to perform a computation, is called circuit complexity. For example,
it determines whether a problem can or cannot be solved by a certain model of
computation. In addition to studying theoretical problems, circuit complexity is
also of major practical importance. Suppose, for instance, that the NOT gate we
have built sometimes gives the wrong result. That is, when the bit i enters our
NOT gate, on the other side, we sometimes read the same bit i instead of ī. This
is known as a computational error . If we use many of these faulty NOT gates in a
circuit, the risk is that the error propagates through the circuit, potentially leading
to an incorrect computational result. Obviously, the deeper the circuit, the greater
the probability that the final computational result will be incorrect. It is, therefore,
crucial to understand the level of error an algorithm can tolerate. Since errors are
practically unavoidable, it is clear that this posed a serious concern in the earlier
stages of our modern digital era.
Fortunately, by the mid-20th century, physicists had already discovered the elec-
tronic components needed to build reliable machines based on the binary circuit
model of computation. These are what we call today digital computers or, simply,
computers. The solution to any computational problem was thus reduced to the
following steps: 1. translate the computational problem into an equivalent Boolean
function, 2. find the instructions, that is, the algorithm, that solves it, and 3. wait
2.1. QUANTUM CIRCUITS 9

for the machine to do its job. It was believed that, thanks to digital computers, the
solution to any solvable problem was merely a matter of time. The goal of com-
puter science was then to discover more efficient algorithms and build more powerful
computers.

The quantum model of computation is a completely different logical system. In


contrast to the binary model of computation, the fundamental ideas of this model
are based, as its name suggests, on the principles of quantum mechanics. Essen-
tially, in quantum computation, we do not work with two distinct sets of objects,
such as ones and zeros, but with their linear superposition. Instead of bits, we now
use qubits (quantum binary digits). Moreover, the quantum logical gates are uni-
tary transformations on qubits. A quantum circuit is a sequence of quantum gates
connected by quantum channels, through which the qubits are transferred. As in
any quantum experiment, a measurement is performed at the end of the quantum
circuit. According to the postulates of quantum mechanics, when a qubit passes
through a quantum gate or circuit, there is, in general, no certainty about the result
of the measurement. In other words, the result is probabilistic, rather than deter-
ministic, as in the binary (classical) case. A quantum algorithm is a specific set of
instructions, including the initial qubit, the arrangement of gates, and the appro-
priate measurements at the end, intended to solve a computational problem. All
these concepts form the foundation of a contemporary scientific paradigm known as
the quantum circuit model of computation. The purpose of this model, particularly
for scientists interested in the physical applications of the theory, is the develop-
ment of machines that will implement it. These devices are the so-called quantum
computers.

Let us examine in more detail some of the basic components of the quantum circuit
model of computation.

A single qubit is the simplest element of this model. If we denote by |0⟩ and |1⟩
the two measurable states, any single qubit |q⟩ will be a linear superposition of these
states,

1
X
|q⟩ = α0 |0⟩ + α1 |1⟩ = αi |i⟩ , (2.1.4)
i=0

where α0 and α1 are complex numbers. The states |0⟩ and |1⟩ are called the compu-
tational basis states. Quantum mechanics affirms that the probability of measuring
the single qubit |q⟩ in state |i⟩ is |αi |2 . Instead of using complex numbers to specify
the single qubit, two real numbers associated with angles in spherical coordinates
can be used. The general expression for the single-qubit state vector in these new
variables is:

|q(ϑ, ϕ)⟩ = cos(ϑ/2)|0⟩ + eiϕ sin(ϑ/2)|1⟩ . (2.1.5)


10 CHAPTER 2. REVIEW OF QUANTUM COMPUTING

z
|0⟩

|q⟩
ϑ

y
ϕ

x |1⟩

Fig. 2.2. Image representation of a single qubit in the Bloch sphere.

An n-qubit state is, in general, an entangled state of n single qubits. It is expressed


as follows, X
|Q⟩ = αi1 ...in |i1 . . . in ⟩ , (2.1.6)
i1 ,...,in

where each bit i1 , . . . , in in the string i1 . . . in can take the values 0 and 1, and the
coefficients αi1 ...in are complex numbers. Note that some states of the n-qubit system
are not entangled. For example, the following product states are non-entangled
states:
|i . . . i⟩ = |i⟩⊗n . (2.1.7)
A quantum gate is a unitary transformation applied to an input qubit. For instance,
a single-qubit gate is a unitary transformation applied to a single qubit,
1
X
|q⟩ 7−→ U |q⟩ = αi U |i⟩ , (2.1.8)
i=0

where, by the definition of unitary operator, ⟨q ′ |U † U |q⟩ = ⟨q ′ |q⟩. The circuit element
corresponding to the gate U is shown below:

|q⟩ U U |q⟩

Fig. 2.3. Circuit diagram of a single-qubit gate.

Examples of such single-qubit gates are the Pauli gates,

X |0⟩ = |1⟩ , X |1⟩ = |0⟩ , (2.1.9)


Y |0⟩ = i |1⟩ , Y |1⟩ = −i |0⟩ , (2.1.10)
Z |0⟩ = |0⟩ , Z |1⟩ = − |1⟩ = eiπ |1⟩ . (2.1.11)

The Pauli gate Z is a special case, when ϕ = π, of the relative phase gate (phase
shift gate),
P (ϕ) |0⟩ = |0⟩ , P (ϕ) |1⟩ = eiϕ |1⟩ . (2.1.12)
2.1. QUANTUM CIRCUITS 11

Each of the following operators, known as rotation gates, is a single-qubit rotation


of θa radians about the a axis,
Ra (θa ) = cos(θa /2)I − i sin(θa /2)σa , (2.1.13)
where I is the identity operator and σa , with a = x, y, z, is another notation for the
Pauli gates (σx = X, σy = Y and σz = Z).
In general, for an n-qubit gate acting on an n qubit,
X
|Q⟩ 7−→ U |Q⟩ = αi1 ...in U |i1 . . . in ⟩ . (2.1.14)
i1 ,...,in

For instance, the CNOT gate is an example of a two-qubit gate,


CNOT |i j⟩ = |i j ⊕ i⟩ , (2.1.15)
where the symbol ⊕ denotes the binary sum, j ⊕ i = (j + i) mod 2.

L =
X

Fig. 2.4. Circuit representation of the CNOT gate.

Any unitary transformation, as can be shown, can be approximated by a finite


quantum circuit (that is, a circuit made of a finite number of quantum gates),
|Q⟩ 7−→ U |Q⟩ ≈ UN . . . U1 |Q⟩ . (2.1.16)
Furthermore, just as any classical circuit can be decomposed into a sequence of
NOT, AND, and OR gates, any quantum circuit can be thought of as a composition
of a finite number of elementary quantum gates. Any such finite set of gates is called
a set of universal quantum gates. For example, the rotation gates, the phase shift
gate, and the CNOT gate together form a universal set of quantum gates.
In quantum mechanics, any physical measurement is associated with a Hermitian
operator called an observable, M = M † . Since the Pauli operators, as well as their
tensor products, are Hermitian, we have
σa = σa† (2.1.17)
σa1 . . . σaN = (σa1 . . . σaN )† . (2.1.18)
For this reason, they are often used to express any measurement performed at the
end of a quantum circuit. Unlike classical systems, though, where the effects of a
measurement are negligible, a measurement in quantum mechanics generally has an
unpredictable effect on the physical system. This makes measurement an integral
part of the quantum computational process. Therefore, we must always specify the
measurements to be performed at the end of a quantum circuit! The outcomes are
probabilistic rather than deterministic.

|q⟩ |i⟩

Fig. 2.5. A single-qubit measurement gate.


12 CHAPTER 2. REVIEW OF QUANTUM COMPUTING

After this brief survey of both the binary and quantum models of computation,
you may be asking yourself: why do we need quantum computers if we already have
classical (digital) computers, which have proven to be highly reliable for solving most
practical computational problems? There are two main reasons to believe that, in
some cases, quantum computers will surpass classical computers. The first reason is
that quantum computers may solve certain problems much faster than classical com-
puters. This is what is meant when it is said that quantum computers will be more
“efficient” or “powerful” than classical computers. In practical terms, this means
that, in the future, quantum computers could be much smaller (and less complex)
than classical computers designed for the same computational tasks. The second
reason for the growing interest in quantum computing is that quantum computers
will likely (though there is no formal proof yet) be able to solve computational prob-
lems that classical computers cannot solve. In other words, scientists expect them
to tackle problems that even the most powerful digital computers imaginable may
never be able to solve.

2.2 Computational Errors and Fault Tolerance


It is expected that future quantum computers, at least in the early stages of de-
velopment, will not function exactly as described above. In other words, they will
be prone to computational errors. Managing the propagation of these errors is a
critical task in the progress toward a reliable quantum computer.
At the beginning of the modern digital era, digital components were also far from
perfect, and there was a need for error correction—methods to detect and correct
errors in the computational process. Nowadays, however, electronic components are
so accurate that the probability of a computational error is negligible, and there is
no longer a need for error correction.
One of the reasons quantum circuit components are so unreliable is that it is ex-
tremely difficult to isolate them from their environments. In fact, these interactions
are so significant that they destroy the quantum mechanical behavior of the circuit
elements. This phenomenon, well-known in quantum mechanics, is referred to as
decoherence. The destructive influence of the environment has driven physicists and
engineers to develop new techniques to mitigate the impact of external factors on
circuit components. Meanwhile, theoretical physicists and computer scientists have
devised procedures to detect and correct the various types of errors that may occur
in these “noisy” quantum computers.
As an example of how experts cope with decoherence, consider the bit-flip error
that may occur in the propagation of a qubit between two gates.
In the classical case, a bit flip is the only possible error, i → ī. To protect it, we
create multiple identical copies and send them. That is, instead of sending just i,
we send i i i. If one of the bits is flipped—say, we receive i ī i instead of i i i—we can
measure the three bits, detect that the second bit has been flipped, and then correct
it. The entire process can be schematically summarized as follows,

encode send (error occurs) detect correct decode


i −−−−−→ i i i −−−−−−−−−−−−→ i ī i −−−−→−−−−−→ i i i −−−−−→ i (2.2.1)

Note that this method would not work if several errors could occur simultaneously.
In fact, the majority voting strategy we just used will only correct a single wrong
2.2. COMPUTATIONAL ERRORS AND FAULT TOLERANCE 13

bit. For example,


encode send (errors occur) detect correct decode
i −−−−−→ i i i −−−−−−−−−−−−→ i ī ī −−−−→−−−−−→ ī ī ī −−−−−→ ī (2.2.2)

By repeating the initial bit many more times and assuming that the probability
of an error occurring is very small, this correction procedure becomes completely
reliable.
The bit-flip quantum repetition code is similar. However, there are some funda-
mental differences. Like in the classical case, instead of sending a single qubit |q⟩,
we send a three-qubit state |q⟩L ,
2 2
encode send
X X
|q⟩ = αi |i⟩ −−−−−→ |q⟩L = αi |i i i⟩ −−−→ (2.2.3)
i=1 i=1

To distinguish |q⟩L from the initial qubit |q⟩, the former is called the logical qubit,
and each of the state vectors in |i⟩ |i⟩ |i⟩ is referred to as the physical qubit. Now,
during the process of transmitting the qubit, errors may occur. In our example,
suppose a bit flip occurs. For the initial single qubit |q⟩, this would have meant
2
X 2
X
|q⟩ = αi |i⟩ −→ αi |ī⟩ ; (2.2.4)
i=1 i=1

however, since we are sending a logical three-qubit state, the error can now occur in
any of the three physical qubits. Suppose that it is the second physical qubit that
gets flipped,
2 2 2
X encode
X send (error occurs) X
|q⟩ = αi |i⟩ −−−−−→ |q⟩L = αi |i i i⟩ −−−−−−−−−−−−→ αi |i ī i⟩ (2.2.5)
i=1 i=1 i=1

The detection and correction of an error in a qubit is not as simple as in the clas-
sical case. In fact, we can measure a classical bit and leave it almost undisturbed.
However, according to the principles of quantum mechanics, the measurement of a
qubit will project it onto one of the observable states. To avoid this, we perform
a parity check (see QC1, Subsection 5.2). After identifying the error, we correct it
and recover the initial qubit. The entire process can be summed up as follows,
2 2 2
X encode
X send (error occurs) X
|q⟩ = αi |i⟩ −−−−−→ |q⟩L = αi |i i i⟩ −−−−−−−−−−−−→ αi |i ī i⟩
i=1 i=1 i=1

2 2
parity check correct decode
X X
−−−−−−−−→−−−−−→ |q⟩L = αi |i i i⟩ −−−−−→ αi |i⟩ = |q⟩
i=1 i=1

Other types of errors can occur, and similar procedures have been developed to
detect and correct them. In addition to errors related to the transmission of qubits,
gates can also produce errors. For example, imagine you expect a qubit |i⟩ to exit
a gate, but instead, the qubit |ī⟩ exits. Worse yet, a qubit transferred through a
noisy channel might enter a faulty gate. If the two errors combine, the final qubit
could become unrecognizable. Therefore, if we are not careful, errors can propagate
throughout the circuit, making the final computation unreliable.
14 CHAPTER 2. REVIEW OF QUANTUM COMPUTING

Finally, since the error correction process—namely, the encoding, detection, and
correction of errors—is performed by quantum devices, these devices will inevitably
introduce additional errors. As a result, error correction requires larger quantum
computers, which increases the probability that the final computational result will be
incorrect. The good news is that it has been proven that, under certain conditions,
error correction codes can reduce computational errors to arbitrarily small levels.
A fault-tolerant quantum computer is a quantum computer designed such that the
errors occurring in the logical qubits at each stage of the process are corrected along
the way, ensuring the final computational result is reliable. However, this technology
remains far from being realized.

2.3 Hybrid Quantum-Classical Algorithms


For years, it was thought that quantum computers had to be built exclusively with
quantum components. This seemed obvious: given that we wanted to demonstrate
the superiority of quantum over classical computation, the quantum device had
to be purely quantum. The main obstacles to this ideal goal were, and still are,
the development of new hardware (less noisy) and the invention of appropriate
quantum error-correcting codes. This future situation is known as the fault-tolerant
quantum era. However, in recent years, scientists have come to accept that fault-
tolerant quantum computers will not be available anytime soon. As a result, they
began looking for more realistic algorithms that could be implemented on near-term
quantum computers, which are characterized by a moderate amount of noise and a
relatively small number of qubits and gates. This is the stage we are currently in,
known as the Noisy-Intermediate Scale Quantum (NISQ) era. According to experts,
we will likely remain in this phase for several years (even decades) before achieving
fault tolerance.
The algorithms expected to be implemented in the near term are known as hy-
brid quantum-classical algorithms. These combine quantum and classical com-
ponents: the quantum subroutines address problems that are hard for classical
computers, while the classical computer handles tasks where its efficiency is well-
established. For example, the variational quantum algorithms (VQAs) discussed
below are NISQ algorithms designed to demonstrate quantum advantage (practical
quantum supremacy) in the near future. Since many problems—not only in physics
and chemistry but also in finance—share a common basic structure, the techniques
used in VQAs can be applied to a wide variety of situations. It is common to
hear that some variational quantum algorithms, particularly the quantum approx-
imate optimization algorithm (QAOA) we will present below, are heuristic. This
means that, while there is currently no rigorous proof they are more efficient than
known classical algorithms, there are strong theoretical reasons to be optimistic.
The promise is that future results may demonstrate their advantage.
Chapter 3

Non-Quantum Approaches

With the basic understanding of quantum computing gained in the previous chapter,
we are now ready to explore some of the most complex computational problems
in finance. In the following chapter, we will examine how quantum computers can
enhance these methods. We begin with a brief overview of some elementary financial
concepts.
In finance, a portfolio refers to a collection of assets that an investor owns, such
as stocks, bonds, or real estate.1 For simplicity, let us assume that these assets are
held for a fixed period. At the end of this period, some assets will have increased in
value, while others will have decreased. This means that the investor will profit from
some assets and experience losses on others. The objective of a portfolio manager
is to maximize overall returns while managing risk. Balancing assets to achieve
the optimal tradeoff between risk and return is a mathematical challenge known as
portfolio optimization. This is far from trivial, as it requires analyzing large volumes
of data, including historical performance, correlations among assets, and risk factors.
When investments span multiple successive periods, the problem becomes even more
complex, as it requires predicting future market conditions and adjusting strategies
accordingly.
Derivatives are financial instruments whose values are derived from the price of
one or more underlying assets. These underlying assets can be stocks, bonds, com-
modities, currencies, or interest rates. For example, the value of a derivative tied
to a car manufacturing company’s stock could depend on factors such as the prices
of raw materials, the cost of production components, market demand for vehicles,
and broader economic, geopolitical, and environmental influences. The pricing of
derivatives is particularly complex because it involves predicting the value of the
underlying assets, which are influenced by multiple interconnected variables. This
makes derivative pricing one of the most intricate problems in finance. Sophisti-
cated mathematical models and powerful computational techniques, such as numer-
ical methods and simulations, have been developed to estimate prices and manage
the risks associated with derivatives.
An option is a special type of derivative. In simple terms, an option gives its
owner the right, but not the obligation, to buy or sell an underlying asset at a
predetermined price within a specified time frame. A call option gives the holder
the right to buy the asset at a fixed price, known as the strike price, before the
option’s expiration date. If the market price of the asset rises above the strike price,
1
For most of the financial concepts, I have relied on J. C. Hull’s classic book, Options, Futures,
and Other Derivatives.

15
16 CHAPTER 3. NON-QUANTUM APPROACHES

the option holder can exercise the option, purchase the asset at the lower fixed price,
and then sell it at the higher market price to make a profit. A put option, on the
other hand, gives the holder the right to sell the asset at a fixed price before the
expiration date. If the market price of the asset falls below the strike price, the
option holder can sell the asset at the higher fixed price, thereby avoiding losses
that would occur by selling it at the lower market price. While the basic concept
of options is relatively straightforward, predicting their future prices is extremely
challenging. The price of an option is influenced by several factors, such as its
volatility, the time remaining until expiration, and prevailing interest rates. These
interdependencies make option pricing a complex mathematical and computational
problem that requires advanced modeling techniques.
Financial services refer to the various offerings provided by financial institutions
to their clients. It is essential for these institutions to thoroughly assess the potential
consequences and risks associated with delivering these services. For example, when
individuals or businesses apply for loans from a bank, the bank must evaluate their
creditworthiness and ability to repay. This process involves analyzing factors such
as income, outstanding debts, repayment history, and credit behavior. The outcome
of this evaluation is a numerical score, known as the credit score, which quantifies
the risk that the borrower might default. This area of financial theory is referred
to as credit risk assessment. Optimizing the loan evaluation process is critical for
banks, as they need to minimize financial losses while providing fair and timely
services to customers. The goal is to identify and reject high-risk loan applicants,
while avoiding the denial of loans to eligible borrowers who genuinely need financial
support.
Another area of concern for financial institutions is credit card fraud . Prevent-
ing fraudulent transactions is essential, but unnecessary interruptions in legitimate
transactions can frustrate customers. For example, if someone takes a flight and uses
their credit card in two geographically distant locations within a short period, the
bank may flag the activity as suspicious. To reduce fraud while ensuring a smooth
customer experience, banks rely on advanced techniques to identify suspicious be-
haviors and anomalies.
In addition to satisfying the ever-growing demands imposed by customers, banks
must also comply with governments and regulatory bodies. One of the critical con-
cerns in this context is anti-money laundering. Financial institutions are responsible
for ensuring that the money they manage does not originate from illegal activities
such as tax evasion, corruption, or trafficking. To meet this requirement, banks
employ systems to monitor and flag suspicious transactions. Alongside anti-money
laundering, risk management is another crucial responsibility for banks. Financial
organizations are subject to regulations that limit the level of risk they can assume
when investing customer funds. To ensure compliance, they use sophisticated models
to evaluate and mitigate risks, ensuring that investments remain within acceptable
thresholds.
To sum up, financial institutions can enhance both their internal operations and
client services by adopting innovative technologies. As we will explore in the next
chapter, quantum computers have the potential to significantly advance classical
methods—an ambitious pursuit in today’s increasingly complex and competitive
environment.
3.1. OPTIMIZATION THEORY 17

3.1 Optimization Theory


Optimization theory is a vast mathematical field with numerous applications in pure
science, engineering, industry, and finance. In this section, we focus solely on key
concepts and techniques relevant to financial portfolio optimization.2
From a mathematical perspective, optimization is a straightforward concept. Given
a real-valued function of a set of independent variables, the goal is to determine the
values of these variables that minimize (or maximize) the function. In some cases,
the independent variables are subject to constraints, which can make the problem
extremely complex. The specific form of the function relative to the independent
variables, as well as the constraints imposed on those variables, depends on the
particular problem being considered. Due to the diversity and complexity of such
problems, a variety of methods have been developed to address different types of
optimization problems.
Suppose a real-valued function f is defined on an n-dimensional space of binary
variables; that is, they can only take the values 0 or 1. If f is linear, we have that
n
X
f (b1 , b2 , . . . , bn ) = c1 b1 + c2 b2 + . . . + cn bn = c i bi , (3.1.1)
i=1

where the ci ’s are real constants and bi ∈ {0, 1}, for i = 1, 2, . . . , n. For a quadratic
function f , quadratic terms must also be included:

b1 Q11 b1 + b1 Q12 b2 + . . . + b1 Q1n bn + b2 Q21 b1 + b2 Q22 b2 + . . . + bn Qnn bn =


= b1 Q11 + b1 Q12 b2 + . . . + b1 Q1n bn + b2 Q21 b1 + b2 Q22 + . . . + bn Qnn , (3.1.2)

where the Qij ’s are constants. In the second line, we have used that b2i = bi . Using
index notation, this sum can be written as
n
X
bi Qij bj . (3.1.3)
i,j=1

A quadratic function f then takes the following form


n
X n
X
f (b1 . . . bn ) = α bi Qij bj + β c i bi , (3.1.4)
i,j=1 i=1

where the constants α and β have been included for greater generality. We will
assume that, as is the case in most practical situations, Qij = Qji .
It is common practice to arrange the n independent variables b1 , b2 , . . ., bn into
a column vector b = [b1 b2 . . . bn ]T . Similarly, we define the column vector c =
[c1 c2 . . . cn ]T and the n × n symmetric matrix Q = [Qij ], allowing the quadratic
function to be expressed as

f (b) = α bT Q b + β cT b . (3.1.5)
2
For more details, see my notes, “An Introduction to Portfolio Optimization with Quantum
Computers,” hereafter referred to as QC3. You can find it on my LinkedIn.
18 CHAPTER 3. NON-QUANTUM APPROACHES

The purpose of a quadratic unconstrained binary optimization problem (QUBO prob-


lem) is to minimize (or maximize) a function of this form
 
min α bT Q b + β cT b or max α bT Q b + β cT b . (3.1.6)
b b

Let us now briefly explore how this relates to the optimization of financial portfo-
lios.

3.1.1 Portfolio Optimization


Imagine the following scenario: You have a certain amount of money—cash for that
matter—and you wish to invest it in the stock market, with the expectation, of
course, of making a profit over a given period of time. The problem you face is this:
What is the best selection of stocks, and what is the optimal amount of money to
invest in each, so that, at the end of the period, you maximize the return on your
investment? In simple terms, this is the portfolio optimization problem.
If you begin with a portfolio of S stocks, the initial value of the portfolio is given
by
S
X
pP (0) = ps (0) , (3.1.7)
s=1

where s = 1, 2, . . . , S, and ps (0) is the initial amount of money invested in the sth
stock. After a time T , the value of the investment in the sth stock becomes ps (T ),
and the total value of your portfolio at that time is given by
S
X
pP (T ) = ps (T ) . (3.1.8)
s=1

The portfolio return rate is defined as follows:


PS 
pP (T ) − pP (0) s=1 ps (T ) − ps (0)
RP (T ) = =
pP (0) pP (0)
S S
X ps (0) X
= Rs (T ) = ws (0)Rs (T ) , (3.1.9)
s=1
p P (0) s=1

where
ps (T ) − ps (0)
Rs (T ) = , (3.1.10)
ps (0)
is the sth stock return rate, and

ps (0)
ws (0) = . (3.1.11)
pP (0)

Note that ws (0) represents the proportion of the initial capital invested in the sth
stock; it is known as the sth stock weight.
The portfolio return rate (3.1.9) can be written in vector notation as follows:

RP (T ) = wT (0)R(T ) . (3.1.12)
3.1. OPTIMIZATION THEORY 19

Your challenge as an investor is that, due to unknown and unpredictable factors,


the future values of the stocks in your portfolio are uncertain. They may increase
as you expect, but they could also decrease, resulting in a loss. There are so many
variables at play that even predicting the short-term future value of a single stock
seems impossible.
The belief that future prices are unpredictable traces back to the pioneering ob-
servations made by Louis Bachelier at the beginning of the 20th century. More than
a century of historical records has confirmed (though, it is fair to say, not conclu-
sively) that stock price movements do not follow any recognizable pattern. In fact,
stock price movements are often described by a random walk (the same phenomenon
studied in many areas of physics). Because of this, we should focus on the expected
portfolio return rate,
S
 X 
E RP (T ) = ws (0) E Rs (T ) , (3.1.13)
s=1

where E Rs (T ) denotes the expected return rate of the sth stock. A more concise
notation is
S
X
µP (T ) = ws (0) µs (T ) , (3.1.14)
s=1

where the Greek letter µ stands for mean in probability theory. In vector notation,

µP (T ) = wT (0)µ(T ) = µT (T )w(0) . (3.1.15)

Associated with the uncertainty of a portfolio’s return rate is the concept of risk.
Risk , simply put, is the possibility of losing money on an investment. In mod-
ern portfolio theory, also known as the mean-variance model (developed by Harry
Markowitz in the 1950s), risk is assumed to be directly proportional to the uncer-
tainty of the portfolio’s return rate. In other words, the higher the uncertainty of
the portfolio return rate, the greater the risk. Note that, according to this defini-
tion, risk also encompasses the possibility of earning more than expected. However,
risk is generally understood with a negative connotation, often interpreted as the
likelihood of earning less than expected or even incurring a loss.
Since the price movements of two or more stocks in a portfolio can be corre-
lated, the risk of an investment portfolio must account for these correlations. The
mathematical
 object that incorporates these correlations is the covariance matrix
Σ R(T ) . Modern portfolio theory defines the variance of the portfolio return rate
as
σP2 (T ) = wT (0) Σ R(T ) w(0) ,

(3.1.16)
and the risk is directly proportional to it.
Given an expected portfolio return rate M, the goal of a portfolio manager is to
minimize the risk. That is,

min α wT (0) Σ R(T ) w(0) ,



(3.1.17)
w(0)

given the expected return


µT (T )w(0) = M , (3.1.18)
20 CHAPTER 3. NON-QUANTUM APPROACHES

and, of course,
1T w(0) = 1 . (3.1.19)

The positive number α is called the risk aversion coefficient and measures the in-
vestor’s tolerance for risk.
Suppose that, for instance, we are interested in constructing a portfolio where
each stock is either included or excluded. In this case, we are dealing with a binary
portfolio optimization problem. The goal is to minimize the risk,

min α bT (0) Σ R(T ) b(0) ,



(3.1.20)
b(0)

given the expected return


µT (T )b(0) = M . (3.1.21)

Using the Lagrange multipliers method, we can restate the problem as

min α bT (0) Σ R(T ) b(0) − λ (µT (T )b(0) − M) ,



(3.1.22)
b(0)

or, equivalently,

min α bT (0) Σ R(T ) b(0) − λ µT (T )b(0) .



(3.1.23)
b(0)

Recall that the cost function of a QUBO problem is given by (3.1.5),

f (b) = α bT Q b + β cT b . (3.1.24)

Comparing these two functions, we note that



α = α, b(0) = b , Σ R(T ) = Q, , −λ = β , µ(T ) = c . (3.1.25)

We conclude that the binary portfolio optimization problem is a QUBO problem.


QUBO problems are known to be extremely difficult to solve (“NP-hard”), and
various computational techniques have been developed to approximate solutions. In
the following chapter, we will explore how quantum computers, specifically hybrid
classical-quantum systems, can assist in solving them.

3.2 Monte Carlo Simulation


Monte Carlo simulation (MCS) has a fascinating history that dates back to one of
the most remarkable periods in the history of science and technology: the discovery
of nuclear energy’s potential and the invention of the first electronic computers.
This era, marked by groundbreaking innovation during and after World War II, saw
the emergence of computational techniques that would revolutionize not only science
and technology but also society as a whole. Before delving into how finance connects
to this, let us take a moment to explore the origins of Monte Carlo simulation.
3.2. MONTE CARLO SIMULATION 21

3.2.1 Stochastic Processes


Simulating physical phenomena with the help of computers began with the advent of
the first electronic programmable computers.3 The essential idea is to reproduce the
behavior of phenomena that, either due to their complexity (as with many processes
in hydrodynamics and atomic physics) or because they cannot be reproduced in the
laboratory (such as nuclear processes inside stars or the collision of two black holes),
would otherwise be inaccessible. By simulating these phenomena, predictions can
be made that theoretical or experimental physicists can later test or prove. Thanks
to this method, computer scientists themselves can gain access to knowledge that
would otherwise be impossible to obtain.
Suppose that a neutron is injected into a fissile material (for example, Uranium-
235 or Plutonium-239). Due to the probabilistic nature of quantum phenomena, the
neutron will interact with its environment in different ways, each event occurring
with a certain probability. Being electrically neutral, the primary force at play is
the strong nuclear force. The neutron can, for instance, be scattered or absorbed by
a nucleus of the fissile material. Scattering can be of two types: elastic, where the
neutron is deflected by the nucleus without transferring energy to it, or inelastic,
where the neutron transfers some energy to the nucleus. Each of these scenarios
has an associated probability. Similarly, the absorption process can occur in one of
two ways: the neutron can be absorbed, producing an isotope of uranium, or it can
induce fission. Finally, the neutron may also escape the fissile material and collide
with the walls of the containing vessel. Each of these outcomes has its own prob-
ability. After analyzing these initial possibilities, we then proceed to examine the
subsequent reactions. As you can see, as we account for more and more interactions,
the process becomes increasingly complex to study. In principle, only by tracking
each neutron through all possible timelines can we establish a statistical picture of
the fate of the initial neutron.
To address the complexity of the task, nuclear physicists in the late 1930s and 1940s
developed precise differential equations to describe the interaction of large numbers
of neutrons within fission material, whether in nuclear reactors or weapons. These
equations, considered by many to be the pinnacle of theoretical nuclear physics,
are the neutron diffusion equation and the transport equation. They are solvable in
simple cases, such as those involving basic geometries and materials. However, for
more complex situations, analytical solutions are extremely difficult or impossible
to find with current techniques. This is where Monte Carlo simulation comes to the
rescue.
When applied to nuclear fission, Monte Carlo simulation does not rely on the be-
havior of a large number of neutrons. Instead, the method simulates the timelines of
many individual neutrons, with each simulation randomly determining the outcome
based on defined probabilities. By aggregating the results of these simulations, an-
alysts can accurately estimate the likelihood of various outcomes, particularly the
likelihood of a nuclear explosion.
3
A brief history of the Monte Carlo method, written by one of its participants, can be found
in N. Metropolis, “The Beginning of the Monte Carlo Method”. The article by the historian and
philosopher of physics P. Galison, “Computer Simulations and the Trading Zones”, is an excellent
account of the many factors that fostered the propagation of Monte Carlo simulation during the
postwar period. For its many uses in contemporary research, see D. P. Kroese, “Why the Monte
Carlo Method is So Important Today”.
22 CHAPTER 3. NON-QUANTUM APPROACHES

Conceptually, the application of MCS in finance stems from its origins in nuclear
physics. Suppose you have a portfolio of options. For simplicity, assume that the
options depend on a single stock.4 Let us use the nuclear fission analogy to under-
stand how MCS naturally applies to this case. The goal is to follow the history of the
stock. Initially, the stock has several possibilities: it can either remain unchanged,
go up in price, or go down, each with a certain probability. After the first outcome,
for each of the previous possibilities, the stock can again remain unchanged, go up,
or go down, with probabilities depending on the new market conditions. As time
passes, the stock price has more and more possible histories. At every moment, the
MCS estimates the probability associated with the different prices of the underlying
stock. Note that this is similar to the diffusion of neutrons in fissile material. MCS
does not attempt to solve a differential equation, such as the Black-Scholes equation
(1973) for options, but instead provides a probabilistic description of the option’s
behavior, considering the multiple price paths of a statistical sample.
These are examples of Monte Carlo simulation applied to stochastic processes.
The canonical example of a stochastic process is the random walk . Suppose you
are standing on a straight line, which we associate with the axis x, and you can
only step in the positive (+) or negative (−) direction with a fixed length L. For
mathematical simplicity, let L be the unit length, that is, L = 1. To decide whether
you move to the right (+) or to the left (−), you toss a fair coin. If the result is
heads (H), you move to the right, and if it is tails (T ), you move to the left. Since
the coin is fair, the probability of moving to the right or to the left is pH = 1/2
and pT = 1/2, respectively. The probability distribution is thus given by {H, pH =
1/2; T, pT = 1/2}. After tossing the coin K times, your distance from the origin will
be
DK = (δH1 − δT 1 ) + (δH2 − δT 2 ) + . . . + (δHK − δT K )
K
X K
X
= δHk − δT k . (3.2.1)
k=1 k=1

In other words, it is the difference between the number of steps taken to the right
and the number of steps taken to the left.
In probability language, if {H, T } is the sample space, that is, the set of possible
outcomes of a coin toss, then the step taken is a random variable,
X : {H, T } → {1, −1} , (3.2.2)
with X(H) = 1 and X(T ) = −1. A random walk is defined as a sequence of random
steps,
{X1 , . . . , Xk , . . . , XK } , (3.2.3)
where Xk is the value of the kth step, taking the value 1 if the coin shows H and
−1 if it shows T . A set of random variables like this is called a stochastic process.
In general, the distance from the origin after K steps is given by
K
X K−1
X
DK = Xk = Xk + XK = DK−1 + XK . (3.2.4)
k=1 k=1
4
Refer to the seminal paper by P. Boyle, “Options: A Monte Carlo Approach” (1977). The
following textbooks provide a technical introduction to MCM in finance: P. Glasserman, Monte
Carlo Methods in Financial Engineering, and P. Jäckel, Monte Carlo Methods in Finance.
3.2. MONTE CARLO SIMULATION 23

This simple random walk can be generalized in several ways, such as by extending
it to two or more dimensions.
Brownian motion, discovered by botanist Robert Brown in the late 19th century
while observing pollen grains suspended in a liquid, is a two-dimensional example
of a random walk. In this case, we need a tetrahedron to decide whether to move
right, left, up, or down. The resulting position of the suspended particle evolves as
a combination of these independent motions, creating a trajectory that reflects its
random nature.
We can also generalize the simple random walk by rolling a die instead of tossing a
coin. For instance, we could roll a fair die and define the following random variable:

X(1) = 1 , X(2) = 2 , X(3) = 3 , (3.2.5)

X(4) = −1 , X(5) = −2 , X(6) = −3 . (3.2.6)


Returning to finance, since the pioneering work of Bachelier, stock price move-
ments have been regarded as stochastic processes. Suppose we want to analyze the
movement of a stock. Let ps (0) denote the initial price. Since the price at time T is
a random variable, there are several possible prices at that time,
1
ps (T ), . . . ,i ps (T ), . . . ,N ps (T ). (3.2.7)

The index i, ranging from 1 to N , represents the ith possible price. Each of the
prices i ps (T ) occurs with some probability. More generally, at any time kT , where
k = 1, . . . , K, we have 1 ps (kT ), . . . ,i ps (kT ), . . . ,N ps (kT ), where i ps (kT ) represents
the ith possible price of stock s at time kT . The stochastic movement of the stock
price will be described by a set of random variables representing the price at different
time points,
{i ps (kT )} , (3.2.8)
where k = 1, . . . , K and i = 1, . . . , N . This set of potential prices can be conveniently
represented by an N × K matrix,
 
1
ps (T ) 1 ps (2T ) · · · 1 ps (KT )
 .. .. ... ..
. (3.2.9)

 . . .
N N N
ps (T ) ps (2T ) · · · ps (KT )

Suppose that i ps ((k − 1)T ) represents the price of the stock at time step (k − 1)T ,
and j ps (kT ) denotes the price at time kT , where i, j = 1, . . . , N . With a slight
modification to definition (3.1.10), the stock return rate during this time period is
given by,
j
ps (kT ) − i ps ((k − 1)T )
Rsij ((k − 1)T, kT ) = i p ((k − 1)T )
s
j
ps (kT )
= ip
− 1. (3.2.10)
s ((k − 1)T )

Simplifying the notation by introducing Rsij (∆Tk ) = Rsij ((k − 1)T, kT ),


j
ps (kT )
Rsij (∆Tk ) = ip
− 1. (3.2.11)
s ((k − 1)T )
24 CHAPTER 3. NON-QUANTUM APPROACHES

More generally, given two moments in time, mT and nT , where m < n, the stock
return rate during this period is
in
ps (nT )
Rsim in (mT, nT ) = im p (mT )
−1
s
in in−1 im+1
ps (nT ) ps ((n − 1)T ) ps ((m + 1)T )
= in−1 p ((n − 1)T ) in−2 p ((n − 2)T )
· · · im p (mT )
− 1.
s s s

n−m
Y
= Rsin−k in−k+1 (∆Tn−k+1 ) − 1 . (3.2.12)
k=1

In order to make this equation more manageable, the log stock return rate is defined:
n−m
X
Rsim in (mT, nT ) log Rsin−k in−k+1 (∆Tn−k+1 ) .

log +1 = (3.2.13)
k=1

Let us pause the mathematical presentation here and shift focus to how Monte
Carlo simulation extracts useful statistical information from the random walk. The
application to stock prices is analogous.
Suppose you are playing the random walk game, but you are unaware that the
coin is biased. After tossing the coin K times, suppose you have followed a certain
stochastic path,
{D1 , . . . , Dk , . . . , DK } , (3.2.14)
P P
where Dk = δHk − δT k , for every k = 1, . . . , K. The question is: by analyzing
this stochastic path, how much can you learn about the probability distribution
{H, pH ̸= 1/2; T, pT = 1 − pH ̸= 1/2} underlying it? Once you have discovered
the probability distribution, you can make statistical predictions about the future
behavior of the path.
MCS proceeds as follows: It selects a probability distribution, say {H, pH ; T, pT }1 ,
and generates many possible stochastic paths. At each time step, the simulation
computes the corresponding value of the random walk and averages these values
across all generated paths to obtain an estimate of the expected behavior for the
given probability distribution. This procedure is repeated for different probability
distributions, {H, pH ; T, pT }2 , . . ., {H, pH ; T, pT }G . All these statistical models are
compared with the observed behavior (as described in (3.2.14)). The one that most
closely replicates the observed behavior is chosen as the underlying probability dis-
tribution that governs the random walk. Future predictions are then based on this
selected probability distribution.

3.2.2 Monte Carlo and the Greeks


When a business or financial organization acquires or sells an option, it assumes the
risk of potential financial loss. The so-called Greeks (or Greek letters) are various
measures of the risks involved. Proper evaluation and management of the Greeks
enable businesses to eliminate or reduce risk to a tolerable level. In most cases, the
objective is not to generate profit but to minimize potential losses. This approach
is referred to as hedging.
The most elementary of the Greeks is delta (∆). It measures how the price of an
option, C, varies in response to changes in the price of the underlying asset, s (in
3.2. MONTE CARLO SIMULATION 25

previous sections denoted by ps ). In mathematical terms, delta is the derivative of


the option price with respect to the price of the underlying asset:
∂C(s)
∆C = . (3.2.15)
∂s
We use a partial derivative because the option price, in practice, depends on multiple
parameters. The delta of a call option ranges from 0 to 1, reflecting the fact that
when the price of the underlying asset is below the strike price, the probability
of the option expiring “in-the-money” is close to zero. On the other hand, as the
underlying asset’s price rises above the strike price, the probability of expiring in-
the-money increases, causing the delta to steadily approach 1. For a put option, the
behavior is the opposite of that of a call option. Its delta ranges from −1 to 0. In
fact, when the price of the underlying asset is below the strike price, the probability
of the option expiring in-the-money is close to 1, resulting in a delta near −1. As
the underlying asset’s price approaches or exceeds the strike price, the probability of
expiring in-the-money decreases, and the delta moves toward 0. The negative sign
is a convention indicating the inverse relationship between the put option’s price
and the underlying asset’s price. Let us illustrate this with a simple example of a
portfolio of options.
Suppose you own a portfolio of n options, all based on the same underlying asset,
s. The price of your portfolio is expressed as:
n
X
pP (s) = wi Ci (s) . (3.2.16)
i=1

Using the definition, delta is then given by,


n n n
∂pP (s) ∂ X X ∂Ci (s) X
∆P (s) = = wi Ci (s) = wi = wi ∆i (s) . (3.2.17)
∂s ∂s i=1 i=1
∂s i=1

Here, ∆i represents the delta of the ith option. If the goal of your portfolio is to
hedge the investment by minimizing exposure to price movements of the underlying
asset, you need an appropriate combination of put and call options, with some ∆i ’s
being positive and others negative. This creates a delta-neutral portfolio, where the
total delta is close to zero.
The next Greek is gamma (Γ). Using a physical analogy, if ∆ represents velocity,
then, Γ represents acceleration,

∂ 2 C(s) ∂∆C (s)


ΓC (s) = 2
= . (3.2.18)
∂s ∂s
For a portfolio of options,
n
∂ 2 pP (t, s) X
ΓP (s) = = wi Γi (s) , (3.2.19)
∂s2 i=1

where Γi denotes the gamma of the ith option. Note that when the gammas of
all the options in a portfolio are approximately zero, the gamma of the portfolio
is also nearly zero. This implies that the portfolio’s delta remains nearly constant.
Consequently, the portfolio’s price changes at a constant rate with respect to the
26 CHAPTER 3. NON-QUANTUM APPROACHES

price of the underlying asset. In contrast, when the gammas of the individual options
are significantly greater than zero, the portfolio’s delta becomes highly sensitive
to changes in the underlying asset’s price. This increased sensitivity makes the
portfolio’s price less predictable, introducing greater risk when forecasting its value.
Suppose now that the value of the portfolio of options, pP , depends not only on
the price of the underlying asset, s, but also explicitly on time, t. We thus have
that,
n
X
pP (t, s) = wi Ci (t, s) . (3.2.20)
i=1

The Black-Scholes equation states that the value of the portfolio satisfies the follow-
ing partial differential equation:

∂pP (t, s) ∂pP (t, s) 1 2 2 ∂ 2 pP (t, s)


+ rs + σ s = r pP (t, s) , (3.2.21)
∂t ∂s 2 ∂s2
where r is the (risk-free) interest rate and σ is the volatility (in statistical jargon,
the standard deviation over a certain period of time). Using that ∆P = ∂pP /∂s and
ΓP = ∂ 2 pP /∂s2 , we can rewrite the Black-Scholes equation as,

∂pP (t, s) 1
+ rs ∆P (t, s) + σ 2 s2 ΓP (t, s) = r pP (t, s) . (3.2.22)
∂t 2
The first term defines the Greek theta (Θ),

∂pP (t, s)
Θ(t, s) = . (3.2.23)
∂t
Using this definition and simplifying the notation by omitting the dependence on
time and the asset price, the Black-Scholes equation simplifies to:
1 2 2
Θ + rs ∆P + σ s ΓP = r pP . (3.2.24)
2
For a delta-neutral portfolio (∆P = 0), that is, a portfolio constructed to be in-
sensitive to small changes in the price of the underlying stock, the Black-Scholes
equation reduces to:
1
Θ + σ 2 s2 ΓP = r pP . (3.2.25)
2
There are other Greeks, and all of them are necessary in one way or another
to appropriately manage a portfolio of options. The discussion above, though, is
enough to highlight the complex mathematical nature of option pricing.
Let us finally see how Monte Carlo simulation can be applied to the evaluation
of Greeks, focusing specifically on delta. Each MCS generates a possible trajectory
for the asset price over time, and this process is repeated many times to form a
statistical sample. At each point in time, from the purchase of the option to its
expiration, the average asset price across all simulations is calculated. To do this,
assumptions are typically made about market conditions, such as constant volatility,
a fixed risk-free rate, and using models like geometric Brownian motion to describe
price movements.
The resulting information can be visualized on a two-dimensional graph with the
asset price on the x-axis and the option price on the y-axis. Since delta represents
3.3. MACHINE LEARNING 27

the rate of change of the option price with respect to the underlying asset price, we
can approximate it by evaluating the price change over small increments in the asset
price. Assuming a linear relationship for small changes, we can express the option
price as:
b 1 ) = ∆C (s1 − s0 ) + C(s0 ) ,
C(s (3.2.26)
where C(s0 ) is the historical price of the option at the initial asset price s0 , ∆C is
the delta of the option, and C(s b 1 ) is the estimated option price at the new asset
price s1 . For every asset price si , with i = 1, . . . , n, the estimated value of the option
is given by:
b i ) = ∆C (si − si−1 ) + C(si−1 ) ,
C(s (3.2.27)
where C(si−1 ) is the option price at the previous asset price si−1 . Using the least
squares error (LSE ) method, the best fit is determined by minimizing the error, E,
between the observed option prices and the predicted values:
n
X
min E= min Ei , (3.2.28)
∆C , C(s0 ) ∆C , C(s0 )
i=1

where
b i ) − C(si ) 2 .

Ei = C(s (3.2.29)
The slope of the best fit line is the delta ∆C we are seeking.

3.3 Machine Learning


As you may be aware, artificial intelligence (AI) has taken our technological societies
by storm.5 Countless industries have seen their productivity and services completely
revolutionized by the new capabilities of AI models. Some of these sectors include
the automotive industry, energy production, and, of course, finance. Many banks
today use AI models to identify investment opportunities, detect fraud, spot money
laundering activities, assess credit risk, and more. In this section, we will touch upon
several of these aspects. To be more precise, we will focus on machine learning, which
is a subfield of AI. While AI is a broad field encompassing various domains such as
natural language processing, robotics, and computer vision, ML specifically deals
with algorithms that enable computers to learn from data and improve over time
without further programming. After reviewing the basic principles of ML, we will
explore how some of these models are applied to financial problems.
As we just said, the primary goal of machine learning (ML) is to identify patterns
within data in order to make predictions or decisions. The data is used to both
discover underlying patterns and to test and refine these patterns through training
and validation processes. In the financial industry, data—such as stock movements
and customer information—are regularly collected, and standard ML algorithms are
commonly used to analyze this data and make predictions. Note that in ML, there
is an implicit assumption that the collected data follows certain underlying laws
or functions, and that the algorithm’s task is to uncover them. The parameters of
the multivariable functions modeling these underlying patterns are adjusted by the
5
A few accessible books on the subject include A. Agrawal et al., Prediction Machines,
N. Bostrom, Superintelligence, and S. Gerrish, How Smart Machines Think.
28 CHAPTER 3. NON-QUANTUM APPROACHES

algorithm until the best fit to the data is achieved. It is important to note that,
however, the goal of ML is not to derive an exact function, but to extract practical
and actionable insights from the data. In this section, we will review in some detail
several ML algorithms currently used in finance that have been identified as potential
candidates for enhancement by quantum computational methods.6 .
If, as stated above, ML aims at discovering patterns in data, it is crucial to begin
clarifying what we mean by data. Data refers to information associated with physical
objects or abstract concepts. The data collected comes in various forms: text, audio,
video, images, and more. It is generally categorized into two main types: structured
and unstructured.
Structured data is highly organized and typically stored in formats such as matri-
ces for numerical data or tables for more general datasets. For instance, numerical
data can be represented in matrix format, where rows correspond to samples (e.g.,
individual records), the first I columns represent features (also referred to as in-
puts), and the last O columns correspond to labels (outputs). For N samples, the
corresponding matrix is:
 (1) (1) (1) (1)

x1 · · · xI y1 · · · yO
 .. .. .. .. .. ..  .
 . . . . . .  (3.3.1)
(N ) (N ) (N ) (N )
x1 ··· xI y1 ··· yO

This format is essential for many ML tasks, especially in supervised learning, as we


will discuss shortly. Often, we refer to the column vector
 (1) (N ) T
xi = xi . . . xi , (3.3.2)

where i ranges from 1 to I, as the ith feature vector , and to


 (n) (n) T
x(n) = x1 . . . xI , (3.3.3)

as the nth sample feature vector. It is straightforward to verify that the submatrix
of inputs can be written as:
 1 T
(x )
 ..   
 .  = x 1 . . . xI . (3.3.4)
(xN )T

Unstructured data, on the other hand, refers to information that lacks a prede-
fined structure, such as raw text, audio, or video files. This type of data is often the
most common form of collected data. Before it can be used in ML algorithms, un-
structured data must be cleaned, organized, and converted into a structured format.
Data scientists, or more specifically, data engineers, are responsible for addressing
issues such as duplicates, missing values, and inconsistent formatting. These errors
must be corrected or removed to ensure the integrity of the dataset. Given the
vast amounts of data involved—often millions or even billions of data points—this
6
Andrew Ng’s CS229 course on machine learning at Stanford is a classic. The videos and
lecture notes are available online. A. Burkov’s The Hundred-Page Machine Learning Book is an
excellent complement to Ng’s course. The well-known quant Paul Wilmott also offers a concise
and instructive introduction to the subject in his book Machine Learning.
3.3. MACHINE LEARNING 29

process requires powerful programming tools such as Python, along with specialized
libraries like Pandas, NumPy, or TensorFlow (see below). Techniques like Natural
Language Processing (NLP) for text or feature extraction for images play a crucial
role in transforming unstructured data into a usable form.
Data science is a vast and varied field. For now, the key takeaway is that the
data used in ML algorithms is not the raw, noisy, unprocessed data that is initially
collected. Instead, it must be carefully preprocessed to ensure it is suitable for
analysis. Poor data selection or inadequate preprocessing can lead to inaccurate
descriptions of the data or faulty predictions and decisions based on it.

3.3.1 ML Algorithms
Supervised Learning
Supervised Learning (SL) is by far the most widely used ML method. It assumes
that labeled data—comprising features and labels—has already been organized into
a tabular format. For instance, when there is a single feature and a single label, the
data can be visualized as points on a two-dimensional plane. For two samples, this
data is represented in the matrix:
" (1) (1) #
x1 y 1
(2) (2)
, (3.3.5)
x2 y 2
(1) (1) (2) (2)
which simply represents the points (x1 , y1 ) and (x2 , y2 ) in a more manageable
form. This structured approach enables supervised learning algorithms to effectively
identify patterns and relationships between features and their corresponding labels.
Given a labeled dataset with feature vectors x1 , . . ., xI and label vectors y1 , . . .,
yO , here is how these algorithms work: the complete dataset is first divided into
two groups; the first group, known as the training data, is used to train the model,
 (1) (1) (1) (1)

x1 · · · xI y1 · · · yO
 .. .. .. .. .. ..  ,
 . . . . . .  (3.3.6)
(n) (n) (n) (n)
x1 ··· xI y1 ··· yO

and the other, the test data, is used to evaluate the model’s performance after
training,  (n+1) (n+1) (n+1) (n+1)

x1 · · · xI y1 · · · yO
 .. .. .. .. .. ..  .
 . . . . . .  (3.3.7)
(N ) (N ) (N ) (N )
x1 · · · xI y1 · · · yO
(k)
During the training phase, the algorithm learns to predict the labels yj based on
(k)
the inputs xi by minimizing a loss function that measures the difference between
(k) (k) (k) (k)
the predicted labels (ŷ1 , . . . , ŷO ) and the actual labels (y1 , . . . , yO ) for every k =
1, . . . , n. The model is iteratively refined by adjusting its parameters to minimize
this error, thereby improving accuracy over time. After training, whenever a new set
(n+1) (n+1)
of features (x1 , . . . , xI ) is introduced, the algorithm uses the learned model
(n+1) (n+1)
to predict the corresponding labels (ŷ1 , . . . , ŷO ). The test phase evaluates
the model’s ability to generalize to unseen data. This is done by comparing its
30 CHAPTER 3. NON-QUANTUM APPROACHES

predictions to the true labels, without making further adjustments to the already
trained model. It is important to note that the training and testing phases serve
distinct purposes: the training phase focuses on learning and optimizing the model,
while the testing phase assesses its generalization performance on new, unseen data.
What we have just seen is an example of regression. The simplest form of regres-
sion you may be familiar with is linear regression. While it shares similarities with
the classical statistical approach (refer to equation (3.2.28)), there are key differ-
ences. In brief, the standard statistical approach is more theoretical and focused
on understanding the relationship between variables, whereas linear regression in
ML is more data-driven and aimed at minimizing prediction error. Furthermore,
in ML, regularization techniques such as Lasso and Ridge regression are commonly
applied to linear regression models to prevent overfitting and enhance their ability
to generalize to unseen data.
Let us now consider the second major area of supervised learning: classification.
In classification, unlike regression, the labels are discrete rather than continuous.
The goal of a classification algorithm is to assign one of a finite number of possible
(n) (n) (n) (n)
labels, (y1 , . . . , yO ), to a given set of features, (x1 , . . . , xI ). For simplicity, let
us assume that we are dealing with a single-label dataset. This means that each
(n) (n)
sample, characterized by its feature set, (x1 , . . . , xI ), is associated with exactly
one label, y (n) . In matrix form,
 (1) (1)

x1 · · · xI y (1)
 .. .. .. ..  ,
 . . . .  (3.3.8)
(N ) (N )
x1 ··· xI y (N )

where y (1) , . . . , y (N ) are elements of a discrete set. If there are more than two classes,
we refer to this as multiclass classification. This means that each feature point
(n) (n)
(x1 , . . . , xI ), where n = 1, . . . , N , is associated with one of the C categories,
y1 , y2 , . . . , yC , where C > 2. In other words, y (1) , . . . , y (N ) ∈ {y1 , y2 , . . . , yC }. If
there are only two categories, C = 2, it is a binary classification. In this case, each
(n) (n)
point (x1 , . . . , xI ) is associated with one of the two labels, y1 or y2 , which are
often expressed as − and +, or 0 and 1. In symbols, y (1) , . . . , y (N ) ∈ {+, −}.

k-Nearest Neighbors
The first classification algorithm we want to introduce is the k-Nearest Neighbors
(kNN) algorithm. Due to its simplicity and effectiveness, it is one of the most
widely used algorithms in classification tasks. The kNN algorithm groups feature
data points based on their proximity and uses this grouping to make predictions for
(n) (n)
new data points. Intuitively, if a point in (x1 , . . . , xI ) corresponds to a certain
class, such as − or +, it is because it is surrounded by points in the same class.
However, ambiguity arises when the point lies in a region where the surrounding
points belong to multiple classes. The kNN algorithm resolves this ambiguity by
assigning the label of a point based on the majority class among its k-nearest neigh-
bors. Specifically, if there are N+ neighboring points with the label + and N− points
with the label −, with N+ + N− = k, the classification is determined by the sign of
N+ − N− . If N+ > N− , the new point is classified as +. If N− > N+ , it is classified
as −. This process captures the essence of the kNN algorithm. To train and test
the kNN algorithm for data classification, we follow the same general steps outlined
3.3. MACHINE LEARNING 31

above for supervised learning.

Neural Networks
Let us examine in detail Neural Networks, one of the most powerful methods in
machine learning. While they can be applied to both supervised and unsupervised
learning, we will focus on the supervised case here.
For over a century, biologists have understood that neurons in the human brain
communicate with each other to process information. Inspired by this biological
mechanism, computer scientists in the mid-20th century proposed the concept of
artificial neural networks—now commonly referred to as Neural Networks. These
computational models mimic certain aspects of how biological neurons function and
are used not only to simulate brain activity, as was originally intended, but also for
a wide range of applications in science and industry.
In these models, biological neurons are replaced by interconnected nodes, typically
organized into layers. Each layer of nodes serves a specific purpose: some nodes
receive input data (the input layer , analogous to sensory neurons), others process
this data through intermediate layers (the hidden layers), and some nodes produce
the final output or prediction (the output layer , akin to the response of a biological
organism). The network’s behavior is determined by a set of parameters, the number
of which depends on the number of layers and the nodes within each layer. If
the network’s prediction does not match the actual outcome, the model learns by
adjusting these parameters. This adjustment is guided by a cost or loss function,
which quantifies the discrepancy between the predicted and actual outcomes. To
minimize this loss during training, the network iteratively updates its parameters
using optimization techniques such as backpropagation and gradient descent. These
are the fundamental ideas behind neural networks.
Let us begin with the most elementary model. If there is a single input and a
unique output, linear regression proposes a linear equation to fit the data: ŷ =
wx + b, where the parameters w and b are adjusted through minimization of the
loss function, ensuring the line is the best fit for the data in the two-dimensional
x-y plane. When there are multiple inputs, x1 , . . . , xI , the geometry of the model
becomes a hyperplane: ŷ = wT x + b, where the vector x = [x1 . . . xI ]T collects
the input features and w = [w1 . . . wI ]T represents the vector of weights. The
parameters w1 , . . . , wI , which determine the contribution of each input to the next
node, and b, the bias term, are adjusted to minimize the loss function, ensuring the
hyperplane best fits the data. If the relationship between the inputs and the output
is non-linear (i.e., not a hyperplane), the model can be enhanced with the inclusion of
an activation function f . This introduces non-linearity into the predictions, enabling
the model to capture more complex patterns in the data. Thus, instead of
I
X
ŷ = w i xi + b , (3.3.9)
i=1

we use
I
X 
ŷ = f w i xi + b . (3.3.10)
i=1

This simple model, known as the perceptron, consists of only two layers: the input
layer and the output layer (with only one node). We now introduce a hidden layer
32 CHAPTER 3. NON-QUANTUM APPROACHES

with N1 nodes. The value associated with the n1 th node, where n1 = 1, . . . , N1 , is


given by
I
X 
1
hn1 = f wn1 ,i xi + bn1 . (3.3.11)
i=1

Considering the contribution from all the nodes in the hidden layer,
N1
X 
o
ŷ = f wo,n1 hn1 + b . (3.3.12)
n1 =1

By combining these two results, we arrive at the prediction,


N1
X I
X  
o 1
ŷ = f wo,n1 f wn1 ,i xi + bn1 + b . (3.3.13)
n1 =1 i=1

If there are two hidden layers, the first with N1 nodes and the second with N2 nodes,
a straightforward extension of what we just did gives,
N2
X N1
X I
X   
o 2 1
ŷ = f wo,n2 f wn2 ,n1 f wn1 ,i xi + bn1 + bn2 + b . (3.3.14)
n2 =1 n1 =1 i=1

In general, if there are H hidden layers and O possible outputs, denoted by j =


1, . . . , O, the predicted value for each of them is
NH
X  NX
H−1  I
X   
o H H−1 1
ŷj = f wj,nH f wnH ,nH−1 f ...f wn1 ,i xi +bn1 . . .+ bnH +bj .
nH =1 nH−1 =1 i=1
(3.3.15)
The crucial role of activation functions in neural networks dates back to the late
1980s. By that time, researchers began to understand that, under certain condi-
tions, neural networks could approximate most practical functions. This property
is known as the Universal Approximation Theorem. The theorem asserts that a
neural network with a sufficient number of hidden nodes and appropriate activa-
tion functions can approximate any continuous function y = f (x1 , . . . , xI ) to an
arbitrary degree of accuracy. This foundational result underscores the flexibility
of neural networks in capturing complex, non-linear relationships between inputs
and outputs. The choice of activation functions is critical. Among them, sigmoid
functions, characterized by their S-shaped curve, are particularly effective. Another
widely used activation function is the Rectified Linear Unit (ReLU ), defined as

ReLU(x) = max(x, 0) . (3.3.16)

ReLU is computationally efficient, simple to implement, and helps mitigate the


vanishing gradient problem that often affects the training of deep neural networks.
To conclude, let us briefly discuss the optimization of the neural network’s param-
eters. As described above, given the input values x1 , . . . , xI and fixing the values
for all the weights and biases, a general neural network predicts the output values
ŷj , where j = 1, . . . , O. In supervised learning, the true values, denoted as yj , are
known for the training dataset. This allows us to compute the error made by the
3.3. MACHINE LEARNING 33

neural network for each data point, ŷj − yj . The total error across the dataset can
be quantified using a loss function, such as the Mean Squared Error (MSE ) formula,
O
1 X
MSE = (ŷj − yj )2 . (3.3.17)
O j=1

Minimizing this error is the goal during training, as it ensures the network’s pre-
dictions ŷj closely match the true values yj . The key to minimizing this error—and
thus improving the predictions of our neural network—lies in the dependence of
each ŷj on the weights and biases. If the neural network has H hidden layers
with N1 , N2 , . . . , NH nodes in each respective layer, the total number of parameters
(weights and biases) can be calculated as,

(NI N1 + N1 ) + (N1 N2 + N2 ) + . . . + (Nh Nh+1 + Nh+1 ) + . . . + (NH No + No )


= N1 (NI + 1) + N2 (N1 + 1) + . . . + Nh+1 (Nh + 1) + . . . + No (NH + 1)
H
X
= Nh+1 (Nh + 1) , (3.3.18)
h=0

For notational convenience, we introduce N0 = NI to represent the number of input


features and NH+1 = No to represent the number of output nodes. For example, if
there are no hidden layers, the total number of parameters is,
H=0
X
Nh+1 (Nh + 1) = N0+1 (N0 + 1) = No (NI + 1) . (3.3.19)
h=0

These include the weights connecting the input nodes to the output nodes, as well
as the biases for the output nodes. Specifically, for the perceptron, where No = 1,
there are NI + 1 parameters. For a single input feature and a single output label,
there are 1 + 1 = 2 parameters to adjust: the weight w and the bias b. We can use
O
d 1 d X
MSE = (ŷj (w, b) − yj )2 . (3.3.20)
dw O dw j=1

Given the initial values of the parameters, we optimize them using methods such
as the gradient descent algorithm. The process is similar when there are more pa-
rameters. However, in this case, the change in the error function depends on all the
parameters, and the partial derivatives with respect to each parameter capture the
effect of small variations in each one. Backpropagation is the procedure that guides
the algorithm in optimizing the parameters iteratively until the best fit is achieved.

Recurrent Neural Network (RNN)


A special type of neural network is the Recurrent Neural Network (RNN). The key
difference between standard (feedforward) neural networks, as presented above, and
RNNs is that the latter incorporate contributions from previous time steps within a
sequence of data. Suppose we construct a neural network at the initial time t0 (i.e.,
there is no previous data available). At this point, the predicted output is

ŷ0 = f 0 (W0 x0 + b0 ) , (3.3.21)


34 CHAPTER 3. NON-QUANTUM APPROACHES

where we have simplified the transformation of the input x0 into the output ŷ0
through the action of the weight matrix W0 . The vector b0 is a bias vector. At a
later time t1 , the input vector is x1 , with the corresponding weight matrix W1 and
bias vector b1 . If we ignore the effect of what happened at t0 , the expected value at
t1 would be
ŷ1 = f 1 (W1 x1 + b1 ) . (3.3.22)
However, recurrent neural networks aim to include the contribution from previous
time steps. In this context, the predicted value ŷ0 becomes the hidden state at t0 ,

h0 = f 0 (W0 x0 + b0 ) , (3.3.23)

and the prediction at time t1 is

ŷ1 = f 1 V0 h0 + (W1 x1 + b1 ) ,

(3.3.24)

where V0 is the weight matrix for the contributions coming from time t0 . For time
t2 , we proceed in the same way. We define the hidden state at t1 as

h1 = f 1 V0 h0 + (W1 x1 + b1 ) ,

(3.3.25)

and
ŷ2 = f 2 V1 h1 + (W2 x2 + b2 ) .

(3.3.26)
RNNs assume that there is nothing inherently unique about any specific time step.
As a result, the weight matrices—both those associated with the input features and
the hidden states—and the activation functions remain the same across all time
steps. In other words, if there are n time steps,

V0 = V1 = . . . = Vn−2 = Vn−1 , (3.3.27)

W0 = W1 = . . . = Wn−1 = Wn , (3.3.28)
and
f 0 = f 1 = . . . = f n−1 = f n . (3.3.29)
This, moreover, reduces the number of parameters and makes training computation-
ally more efficient. In conclusion, the predicted output vector at tn is

ŷn = f V hn−1 + (W xn + bn ) , (3.3.30)

where the hidden state at tn−1 is given by



hn−1 = f V hn−2 + (W xn−1 + bn−1 ) . (3.3.31)

There is, however, a potential problem with sharing weights across all hidden
states. If the elements of the weight matrix V are much smaller than 1 at each
step, during the backpropagation process, the gradients for parameter adjustment
become progressively smaller. As we backpropagate through the sequence backward
in time, the product of gradients across time steps diminishes exponentially, leading
to the vanishing gradient problem. Consequently, the parameters are only slightly
adjusted—or not adjusted at all—leading to slow learning and effectively neglecting
the contributions from earlier time steps in the sequence of temporal data. In or-
der to solve the vanishing gradient problem, we can introduce the Long Short-Term
3.3. MACHINE LEARNING 35

Memory (LSTM ) cell. Its purpose is to guide the network at every step on how
much information from previous time steps should be retained. The LSTM cell
prioritizes recent information while gradually forgetting or neglecting contributions
from steps far back in time, ensuring that the model focuses on the most relevant
context for its predictions.

Unsupervised Learning
Unlike supervised learning, Unsupervised Learning (UL) algorithms are provided
with datasets that do not include labeled data. Given a set of input data, their goal
is to independently identify hidden patterns within the data.
In many situations, the input feature space, RI , can be reduced to a lower-
ˆ
dimensional space, RI , where ideally Iˆ ≪ I, without losing significant information
that could affect the algorithm’s predictions. For example, consider a simple case
where the data is three-dimensional, (x(n) , y (n) , z (n) ), where n = 1, . . . , N labels the
sample. If it turns out that the z feature exhibits minimal variation across all sam-
ples compared to the variations in the x and y features, we can safely ignore z.
The data can then be simplified to (x(n) , y (n) ). This reduction eliminates the need
to process the superfluous z feature, which neither contributes meaningful informa-
tion nor affects the model’s predictive quality. When dealing with high-dimensional
data, where the input space is enormous, removing irrelevant or redundant features
becomes a crucial preprocessing step. This dimensionality reduction not only ac-
celerates the algorithm but also minimizes computational costs without sacrificing
predictive performance.

Principal Component Analysis


One systematic method to perform such feature reduction is Principal Component
Analysis (PCA), a key technique under the broader category of Dimensionality
Reduction. PCA precisely quantifies the amount of information discarded during
the reduction process. Instead of arbitrarily removing less significant components,
PCA ensures that the remaining components retain as much information as possible
ˆ
from the original data. In other words, if we reduce the input space from RI to RI
(n) (n)
using the PCA algorithm, it guarantees that the transformed dataset (y1 , . . . , yIˆ )
retains most of the significant information from the original data. Here is how
PCA works conceptually: Consider two features i, j ∈ {1, . . . , I}. If the samples
exhibit a strong linear relationship between i and j, this indicates redundancy, as
the information provided by one feature can largely be inferred from the other. PCA
begins by shifting the data with respect to the mean of the xi -xj plane and then
rescales the axes (this is analogous to studying the physics of a massive system from
the perspective of its center of mass), simplifying the analysis while preserving key
relationships,
(n) (n)
(n) xi − µ i
x̄i = (n)
, (3.3.32)
σi
where v
N u N
(n) 1 X (n) (n)
u1 X (n) (n) 
µi = x , σi =t xi − µ i , (3.3.33)
N n=1 i N n=1

Similar for the j feature. The xi -xj plane can be effectively reduced to a single
36 CHAPTER 3. NON-QUANTUM APPROACHES

dimension by identifying the line that best fits the data, a process guided by the
MSE minimization method discussed earlier. This line corresponds to the direction
along which the data exhibits the greatest variance. In other words, the line aligns
with the principal eigenvector (the eigenvector with the largest eigenvalue), eij , of
the covariance matrix Σij of the data. This covariance matrix is computed after the
data has been shifted to its mean and rescaled,
N
1 X (n) (n) (n) (n) 
Σij = x̄i x̄i + x̄j x̄j . (3.3.34)
N n=1

(n) (n)
If we define the two-dimensional feature vector x̄(n) = [x̄i x̄j ]T , its component
along the principal eigenvector eij is given by the dot product

yij = x̄(n) · eij . (3.3.35)

By comparing yij with respect to x̄ij , we can quantify the amount of information
lost when substituting x̄ij with yij and ignoring the transverse component. This
comparison provides a measure of the variance retained in the reduced representa-
tion versus the variance discarded. This process can be systematically applied to as
many pairs of features as possible, iteratively reducing the dataset’s dimensionality.
The reduction continues until the number of features is brought to a manageable
size, balancing computational efficiency with minimal information loss. A common
best practice is to reduce the original feature space to a subspace that captures
90-95% of the total variance, ensuring that the reduced dataset retains most of the
critical information while discarding noise and less relevant variability.

k-Means Clustering
Given a dataset {x(1) , . . . , x(n) , . . . , x(N ) }, where N is the number of samples and
(n) (n) (n)
x(n) is the feature vector of the nth record, i.e., x(n) = [x1 . . . xi . . . xI ]T , the k-
Means Clustering algorithm aims to group the data into K distinct clusters identified
by the algorithm. The number of clusters, K, is a hyperparameter chosen by the
data analyst, and the algorithm automatically groups the data points. The first step
is to select K random points in the feature space RI ,

µ0k = [µ0k,1 . . . µ0k,i . . . µ0k,I ]T , (3.3.36)

where k = 1, . . . , K. Here, µ0k,i is the ith component of the kth vector. These vectors
are referred to as the clustering centroids, for reasons we will discuss shortly. For
each feature vector x(n) and each centroid µ0k , the algorithm computes the Euclidean
distance between them,
v
u I
(n) 0
 u X (n) 2
d x , µk = t xi − µ0k,i . (3.3.37)
i=1

Every feature vector is then assigned to the cluster whose centroid is the closest,
that is, the one for which d x(n) , µ0k is minimal. At this stage, the dataset is
partitioned into K clusters, denoted as C10 , . . . , CK
0
, each containing N10 , . . . , NK0
3.3. MACHINE LEARNING 37

points, respectively. Next, the algorithm updates the centroids µ1k of these clusters
by computing
1 X (n)
µ1k,i = 0 x , (3.3.38)
Nk (n) 0 i
x ∈Ck

for each component i = 1, . . . , I. This update ensures that each centroid represents
the mean position of all points in its respective cluster. The distances d x(n) , µ1k
are then recomputed for every feature vector and the updated centroids. Each data
point is reassigned to the cluster with the nearest centroid, forming new clusters
C11 , . . . , CK
1
. This process of recalculating centroids and reassigning data points is
repeated iteratively. The algorithm terminates when subsequent iterations result in
minimal or no change in the centroids, indicating convergence.

3.3.2 ML in Finance
The applications of ML to finance are many, and our intention here is not to present
a comprehensive account of the subject.7 Instead, let us focus on few applica-
tions of each of the algorithms presented above. For regression, we will consider
credit scoring and risk assessment. For the classification algorithms, we will con-
sider: credit risk assessment, transaction fraud detection, credit card fraud detec-
tion, money laundering detection, market behavior and sentiment analysis for the
kNN algorithm; credit scoring and risk assessment for the SVM algorithm; fraud
detection for NNs; and algorithmic trading and sentiment analysis for RNNs. For
unsupervised learning algorithms, we will see the application of PCA in portfolio
management, credit risk analysis, and algorithmic trading. Finally, we will examine
how the k-means algorithm is used in fraud detection and anti-money laundering.
Regression models are used in credit scoring to predict the probability of a bor-
rower repaying their loan (output close to 1) or defaulting (output close to 0). The
raw dataset typically contains information about borrowers, including demographic
details (such as age and gender) and financial data (such as loan amount, credit
history, and repayment records). This data is often used to derive additional fea-
tures, such as the length of credit history or the debt-to-income ratio, which can
enhance the model’s predictive power. Using this enriched dataset, the model is
trained to discover patterns between the input features and the target variable (e.g.,
the probability of repayment or default). The model’s performance is then evaluated
on a test dataset to ensure it generalizes well. Once trained and tested, the regres-
sion model can predict the probability of repayment for new applicants. This helps
financial institutions decide whether to approve a loan or determine credit limits
based on the applicant’s predicted creditworthiness. We have referred to probability
as a measure of the borrower’s creditworthiness. Banks, however, may instead use a
different metric known as the credit score. Credit scores have a defined range with
a minimum (indicating a higher risk of default) and a maximum (indicating a lower
risk of default). While credit scores and probabilities are expressed differently, they
are indirectly related, as both reflect the borrower’s credit risk.
Risk assessment has a broader meaning than simply evaluating a customer’s credit
risk. In finance, risk assessment aims to predict both the likelihood and potential
cost of adverse events that may impact an companies’ financial stability. The specific
7
See, for example, the book by M. F. Dixon et al., Machine Learning in Finance.
38 CHAPTER 3. NON-QUANTUM APPROACHES

dataset and features used depend on the type of risk being assessed, which could
include market risk, credit risk, operational risk, or country risk. For instance, when
assessing risks to a multinational company, factors such as financial performance,
political stability, social trends, and global economic conditions may be considered.
Suppose we are interested in evaluating the risk an event poses to the company’s
market valuation. After collecting all relevant data, input features are defined, and
the target variable (e.g., changes in the company’s valuation or earnings volatility)
is established. The regression model is trained on this data to discover patterns
and then tested to evaluate its predictive accuracy. This insight enables financial
institutions or companies to make informed decisions to mitigate potential risks. In
the context of a large financial institution or a multinational corporation, country
risk assessment can be seen as an extension of credit risk analysis, incorporating a
broader set of variables, such as political instability, regulatory changes, and cur-
rency fluctuations.
That the kNN algorithm can be used for credit risk assessment is quite obvious.
Suppose we are interested in the binary classification version, namely, predicting
whether a potential borrower will repay the loan (1 if they will repay, and 0 if they
will default). After collecting and cleaning the data, which includes personal and
financial information from previous borrowers along with their repayment history,
the algorithm is trained to recognize the customer’s profiles associated with suc-
cessful loan repayment. The data of a new applicant is then compared to the k
nearest neighbors in the training dataset and, using majority voting, the algorithm
predicts whether the applicant will repay the loan or default. Based on this pre-
diction, the bank can decide whether to approve or reject the loan application. It
is easy to see how kNN can be used to evaluate the legitimacy of a transaction by
comparing it to previous transactions, a process known as transaction fraud detec-
tion. In this case, the dataset consists of bank transactions, labeled as either valid
or fraudulent. When a new transaction is classified as fraudulent, the bank can
issue a warning to the account holder or block the transaction. Credit card fraud
detection and money laundering detection using machine learning work in a simi-
lar manner, although money laundering detection typically involves more complex
feature engineering and domain-specific knowledge.
Market movements are highly complex, and sophisticated techniques are often
required to attempt predictions of their future behavior. However, it can provide a
pedagogical example to illustrate the kNN algorithm. Suppose we wish to predict
the movement of a stock—whether it will go up, down, or remain stable—at some
future time tn+1 . To do this, we can collect historical financial data over a certain
period. For instance, we might gather the trading volume and the stock’s open,
high, low, and close prices at times t0 , t1 , . . . , ti , . . . , tn . Additionally, incorporating
macroeconomic indicators (such as interest rates, inflation data, or GDP growth)
and other relevant market data can enhance the model’s predictive capabilities. At
every time step ti , for i = 1, . . . , n, we define the input features as the financial
and economic data collected up to that point. The target variable can be specified
based on the price difference between ti and ti+1 , categorizing it as “up,” “down,”
or “stable.” The kNN algorithm is then trained to learn the relation between the
input features at each time ti and the corresponding movement label for ti+1 . When
applied to new data, the algorithm identifies the k nearest data points in the feature
space and uses majority voting to predict the stock’s movement at tn+1 . Another
variant of the kNN algorithm can be used to forecast future asset prices based
3.4. COMPUTATIONAL FINANCE 39

on the historical price movements of similar stocks. However, as noted, this is a


naive approach to market analysis. For instance, this method does not account for
temporal dependencies or evolving trends over time, which are critical in financial
time-series analysis. More advanced techniques, such as RNNs and LSTM networks,
are better suited for capturing these temporal dynamics (see below).
PCA can be used for credit risk assessment. In fact, datasets used for credit risk
analysis often contain features that are highly correlated, such as income, debt-to-
income ratio, credit utilization, and payment history. PCA addresses this issue by
reducing the original feature space to a much smaller subspace while retaining most
of the variance. This helps risk analysts focus on the most significant factors driving
credit risk. For example, reducing the dataset to three dimensions can facilitate the
visualization of borrower clusters with similar risk profiles, as well as the identifi-
cation of outliers that might represent unique risks or anomalies. It is not difficult
to understand why PCA is also useful for risk management in general and fraud
detection. For example, let us see the case of portfolio management. Many factors
contribute to the construction of a portfolio, ranging from macroeconomic and social
influences to political events and global conditions. Reducing the feature space can
help portfolio managers identify the most important risk factors and understand how
these factors translate into asset allocation decisions. By simplifying the covariance
matrix, PCA reveals the correlation between pairs of assets, helping to identify and
remove highly correlated assets, which in turn reduces the portfolio’s size without
sacrificing diversification. Although there may be some loss of information during
dimensionality reduction, the efficiency of the calculations and the ability to focus
on the most significant factors make the approximation introduced by PCA worth-
while. The use of PCA for market analysis is somewhat similar. A large amount of
data, such as stock prices and economic factors, is reduced by performing PCA on
historical data to project it onto a subspace of nearly uncorrelated principal com-
ponents. By reducing the number of features, the market analyst or algorithmic
trading system can better identify and focus on key market drivers, while ignoring
irrelevant factors. This reduction helps improve efficiency and accuracy over time
(crucial, for instance, for high-frequency trading strategies).
As we saw previously, a key distinction between k-means clustering and super-
vised learning algorithms is that k-means, being an unsupervised learning method,
does not rely on labeled data. This enables it to discover unexpected patterns or
previously unseen suspicious behaviors, making it especially valuable in evolving
scenarios where fraudsters use increasingly sophisticated tactics. Applications in-
clude fraud detection and anti-money laundering, where grouping similar data points
and highlighting outliers is crucial. While k-means is not explicitly designed as an
anomaly detection algorithm, it can help uncover unusual behaviors by identifying
data points that do not belong to any cluster or are far from cluster centroids.

3.4 Computational Finance


One natural question that arises at this point is: how do we implement these mod-
els? To answer this, let us first briefly review the evolution of quantitative finance
over the past hundred years. We will then provide a concise introduction to the
computational tools commonly used to solve the financial problems discussed ear-
lier.
40 CHAPTER 3. NON-QUANTUM APPROACHES

3.4.1 Historical Background


Despite Bachelier’s seminal thesis dating back to 1900, quantitative finance emerged
as a formal field of study around the mid-20th century. Prior to this, investors and
financial institutions primarily relied on experience and practical judgment to guide
their activities. By the 1950s, finance had become increasingly mathematical. Sig-
nificant advancements were made, such as Markowitz’s Mean-Variance Model (1952)
for portfolio optimization and the Black-Scholes equation (1973) for option pricing.
From the 1950s to the early 1980s, financial mathematicians focused on refining ex-
isting models and creating new ones. For example, Itô’s calculus, developed in the
1940s, became a cornerstone of financial mathematics. The 1980s marked a turning
point with the advent of powerful and accessible computers. Financial organiza-
tions shifted their focus from mathematical modeling to solving existing equations
more efficiently. On the software side, programming languages like Fortran and C
(introduced in 1957 and 1972 by IBM and Bell Labs, respectively) enabled financial
professionals to perform complex computations on computers developed by compa-
nies such as IBM and HP. At the same time, the growing availability of financial
data, facilitated by platforms like Bloomberg Terminal (launched in 1982), spurred
a shift toward a more data-driven approach to finance.
On a personal note, I remember that in the 1990s, when I was studying physics at
university, the field of Econophysics was gaining popularity. The idea behind this
field was that physicists, with their mathematical and computational expertise in
solving differential equations and understanding stochastic processes, could tackle
some of the most challenging problems in finance.
The 21st century, largely driven by the internet, has been marked by the ever-
growing availability of financial data, as well as increasingly powerful computers
and advanced software. In recent years, we have witnessed the latest computational
revolution in quantitative finance with the advent of artificial intelligence, particu-
larly machine learning. In conclusion, over the past half-century, we have seen a shift
from mathematical finance to computational finance—a transition from the devel-
opment of theoretical models based on rigorous assumptions to a more pragmatic,
data-driven approach, where the goal is to uncover patterns in the data.

3.4.2 Python’s Dominance


In the early days of computational finance, during the 1980s and 1990s, C became
the dominant programming language due to its fast execution, minimal resource
usage, portability across different hardware and operating systems, and the control
and adaptability it offers in software development. However, by the 2010s, Python
emerged as the preferred programming language in finance. Unlike C, Python’s
syntax is more intuitive and concise, facilitating faster development and easier col-
laboration among teams. With libraries like Pandas, NumPy, and SciPy, Python
has become the ideal tool for handling large datasets and performing complex calcu-
lations efficiently. Moreover, machine learning libraries such as scikit-learn, Tensor-
Flow and PyTorch have significantly boosted Python’s adoption within the finance
community. As a result, Python’s ability to handle large amounts of data, intuitive
syntax, rich ecosystem, and strong community support has made it the dominant
language in finance.
In the following pages, we will introduce some basic code examples from Python’s
3.4. COMPUTATIONAL FINANCE 41

most common libraries, including machine learning libraries. (If you are already
well-versed in Python, you may skip the rest of this chapter.)

NumPy
NumPy (Numerical Python) is a library for numerical computing in Python. It
supports not only one-dimensional arrays of data (a simple list of values, like a
row of numbers) but also multi-dimensional arrays (for example, a two-dimensional
array is a table or matrix with rows and columns). In NumPy, these arrays are called
ndarray. A wide range of mathematical functions can be applied to them. We will
explore some examples below. NumPy’s advantages include improved computation
speed, reduced memory usage, and seamless integration with other powerful libraries
like Pandas and TensorFlow, which we will examine below. Today, NumPy is an
essential library used by data scientists. In the financial industry, as well as in any
sector that works with data, proficiency in Python implies expertise in NumPy.
To use NumPy, it must first be installed (if it has not already) using the following
command:

pip install numpy

Then, it must be imported into the environment where Python code is written and
executed (for example, a Jupyter notebook ). The conventional way is:

import numpy as np

After importing NumPy, we can—for example—define a general 2D array (or matrix)


as follows:

X = np.array([[a11 a12 a1m ], . . . , [an1 an2 anm ]])

To see the shape of the array we have defined, we use the following function:

X.shape

which, in our case gives (n,m). Be aware that all the elements in an ndarray must
be of the same type. This means that they must all be integers, floats, complex
numbers, booleans, etc. To see the type of elements in the ndarray X defined above,
use the following command:

X.type

Regarding the mathematical operations we can perform with ndarrays, addition and
multiplication work as expected. For example, we can compute cX+dX, where c and
d are two numbers, by typing the following line of code in the Jupyter notebook:

c*X+d*X

Given another ndarray Y with the same shape and type of elements as X, we can
compute the sum cX+dY by writing:

c*X+d*Y
42 CHAPTER 3. NON-QUANTUM APPROACHES

If the shape of the matrix X is (n,p) and that of the matrix Y is (p,m), we can
multiply the matrices by using:

X.dot(Y)

Alternatively, we could have used:

np.dot(X,Y)

Many more operations can be performed on NumPy’s ndarrays, for example, ma-
trix transposition and computing the inverses and determinants of matrices. One
of the limitations of NumPy is that it cannot handle non-numerical data. This is
certainly a limitation because much of the data collected does not come in numerical
form. For example, dates and text data cannot be directly processed using NumPy
arrays. In such cases, libraries like Pandas are often used, as they provide better
support for handling mixed data types.

Pandas
Pandas is a data manipulation and analysis library in Python. Like NumPy, it is
widely used for handling structured data in tables, particularly large datasets. One
of the advantages of Pandas is its seamless integration with other Python libraries,
such as NumPy and machine learning libraries like Scikit-learn. It also enables data
visualizations by integrating with Matplotlib. Pandas is more powerful than Numpy
and has become an essential tool in financial data analysis, commonly expected to
be known by anyone applying for a data analyst role. In finance, Pandas enables
financial analysts to import historical stock market data, clean and preprocess it,
compute moving averages, measure volatility, and analyze correlations between dif-
ferent assets.

SciPy
While Pandas is primarily designed for data manipulation and analysis, SciPy is
focused on scientific computing. It provides advanced mathematical functions for
tasks like optimization, integration, and solving differential equations. While Pan-
das is great for preparing and analyzing data, SciPy extends these capabilities with
specialized tools for more complex mathematical operations. The two libraries can
be used together, with Pandas handling data manipulation and SciPy offering ad-
vanced computations.

Matplotlib
The preferred tool for graphing in Python is the library Matplotlib. The advantages
of Matplotlib include its flexibility in creating a wide range of static, animated,
and interactive plots. It offers extensive customization of plot elements, such as
labels, titles, and axes, enabling users to create highly specific visualizations. Ad-
ditionally, it integrates seamlessly with other libraries such as NumPy and Pandas
for data analysis. How Matplotlib compares to Excel is a natural question since
Excel is known for its user-friendly interface and powerful graphical tools. The
3.4. COMPUTATIONAL FINANCE 43

main difference between the two is that Excel is more accessible for beginners but
also more limited in terms of customization. Matplotlib, on the other hand, being
a Python library, provides much greater flexibility and programmability, allowing
developers to create more complex plots and handle large datasets with greater ease.

Before concluding this section, let us mention the most commonly used Python
library in machine learning.8

Scikit-learn
Scikit-learn is a widely used Python library for machine learning. It provides a
complete and well-rounded set of tools for data preprocessing, model training, and
evaluation. It supports both supervised and unsupervised learning algorithms. Since
it is built on NumPy, SciPy, and Matplotlib, it ensures efficient performance and
seamless integration with other data science libraries. Scikit-learn is optimized for
speed and handles moderate-sized datasets efficiently. However, it lacks support for
deep learning and may not be ideal for very large datasets compared to frameworks
like TensorFlow or PyTorch. Despite these limitations, its ease of use, strong com-
munity support, and extensive documentation make it a go-to library for traditional
machine learning tasks.

8
An introductory ML book with a strong emphasis on programming with Python is A. C. Müller
& S. Guido, Introduction to Machine Learning with Python. When it comes to finance, refer to
Y. Hilpisch, Python for Finance, and A. Nag, Stochastic Finance with Python.
Chapter 4

Quantum-Enhanced Solutions

Like any other business, the goal of a financial institution is to provide the best
possible service to its customers while maintaining profitability. In a competitive
free-market environment, achieving this is a significant challenge, due to factors such
as intense competition, evolving local and global regulations, and complex ethical
considerations. Meeting customer expectations under these conditions is no easy
task. This is where quantum computing could make a substantial difference in the
future.
The rationale for adopting quantum computing is clear: modern industries rely
heavily on digital technologies, and since quantum computers are expected to sur-
pass classical systems in both efficiency and security, these industries—and mod-
ern society as a whole—will inevitably be impacted by this emerging technology.
However, this reasoning both overestimates and oversimplifies the true potential of
quantum technologies. While it is certain that quantum computers will impact some
industries sooner than others, some sectors may experience little to no change at all.
Moreover, the impact of quantum technologies is believed to extend beyond mere
computational efficiency. Only future research will reveal the full extent of their
influence.
What seems undeniable is that quantum computers will profoundly impact every
industry that relies on machine learning (ML). This is largely because two funda-
mental mathematical pillars of ML—linear algebra and probability theory—are also
central to quantum mechanics. As a result, industries that use ML in their produc-
tion or operations will likely be disrupted by the current generation of NISQ (Noisy
Intermediate-Scale Quantum) computers, as well as by more advanced versions on
the horizon. Finance, which heavily depends on ML for portfolio optimization, mar-
ket prediction, and other financial challenges, is no exception. Some experts predict
that finance will be the first industry to be revolutionized by quantum computing.1
Before exploring how quantum computing can be applied in finance, it is important
to recall that the current NISQ era is characterized by noisy quantum devices and a
relatively small number of coherent qubits. In fact, there is broad consensus among
experts that fully reliable, fault-tolerant quantum computers will only become avail-
able in the long term. Because of this, researchers have developed a new class of
1
Some important papers on the subject are: A. Bouland et al., “Prospects and Challenges
of Quantum Finance” (2020), D. J. Egger et al., “Quantum Computing for Finance” (2020),
D. A. Herman et al., “A Survey of Quantum Computing for Finance” (2022), D. A. Herman et al.,
“Quantum Computing for Finance” (2023) and R. Orús et al., “Quantum Computing for Finance”
(2018).

45
46 CHAPTER 4. QUANTUM-ENHANCED SOLUTIONS

algorithms known as hybrid quantum-classical algorithms. The core idea behind


these models is to delegate the most computationally complex aspects of a problem
to a quantum computer while leveraging classical machines—whose efficiency is well
established—for the remaining tasks. From a practical standpoint, the advantage
of these hybrid approaches is that the quantum subroutine requires only a small
number of coherent qubits and a shallow circuit, a technological threshold expected
to be achievable in the near future.

4.1 Quantum Portfolio Optimization


The mathematical foundations of modern portfolio theory were presented in a previ-
ous section. Here, we aim to explain how two quantum algorithms, the Variational
Quantum Eigensolver (VQE) and the Quantum Approximate Optimization Algo-
rithm (QAOA), could improve the optimization process. In fact, classical algorithms
often struggle with the scalability of large portfolios, while quantum algorithms may
be able to process these massive datasets more efficiently, potentially unlocking new
levels of optimization that are difficult for classical algorithms to achieve. As men-
tioned earlier, there is currently no formal proof that these quantum algorithms will
provide a speedup compared to the faster classical algorithms available today. How-
ever, it is expected that future developments will shed light on how and in which
areas these quantum algorithms may indeed be beneficial.

4.1.1 The VQE Algorithm


The Variational Quantum Eigensolver (VQE ) leverages the variational principle of
quantum mechanics to approximate solutions to the time-independent Schrödinger
equation for complex systems. This equation can describe real quantum systems,
such as complex molecules or the electronic configurations of new materials. Alter-
natively, as we will see below, it can represent the quantized version of a classical
system. What makes these algorithms particularly interesting is that they are de-
signed to run on hybrid classical-quantum computers. The quantum subroutine
prepares quantum states and computes Hamiltonian expectation values, while a
classical device performs the optimization process. In summary, this is how it oper-
ates.2
Let us say we want to find the minimum eigenvalue E0 of a known Hamiltonian,
Ĥ. Assume that, based on traditional theoretical methods, we have determined that
the minimum eigenstate is close to the state |Q⟩. e In the present context, this state
is known as the ansatz state. As single qubits can be parameterized by two angles in
the Bloch sphere, we can assume that any quantum state can be expressed in terms
of a set of parameters θ = (θ1 , θ2 , . . .). Thus, in theory, the ansatz state can be
written as |Q⟩
e = |Q(θ)⟩.
e We further assume that the ansatz state can be prepared
by applying a parameterized circuit U (θ) e to an initial n-qubit state |0⟩⊗n = |0⟩,

|Q⟩
e = |Q(θ)⟩ e |0⟩ .
e = U (θ) (4.1.1)

|0⟩ 7→ U (θ)
e |0⟩ = |Q(θ)⟩
e . (4.1.2)
2
For additional explanations, refer to QC2, Subsection 4.2.
4.1. QUANTUM PORTFOLIO OPTIMIZATION 47

The parameterized circuit U (θ)


e is constructed by incorporating the parameters into
an appropriate combination of Pauli gates, single-qubit gate rotations, CNOT gates,
and so on. The expectation value of the Hamiltonian in this state is computed as
follows. First, recall that any Hamiltonian operator can be expressed as a linear
combination of Pauli operators,3
X
Ĥ = hA1 ...An σA1 ⊗ . . . ⊗ σAn , (4.1.3)
A1 ,...,An

where the coefficients hA1 ...An are real numbers, and the σA ’s are Pauli gates X, Y ,
Z (for A = X, Y , Z) or the identity operator (for A = I). That is, we measure
X
E(θ)
e = hA1 ...An ⟨0| U † (θ)
e σA ⊗ . . . ⊗ σAn U (θ)
1
e |0⟩ . (4.1.4)
A1 ,...,An

The VQE tells us that, from a computational point of view, it is more convenient
to estimate each of the terms with a quantum device,

⟨0| U † (θ)
e σA ⊗ . . . ⊗ σAn U (θ)
1
e |0⟩ , (4.1.5)

and let the sum be computed by a classical computer. This process is then repeated
for other parameters in the neighborhood of θ,
e

⟨0| U † (∆θ)
e σA ⊗ . . . ⊗ σAn U (∆θ)
1
e |0⟩ . (4.1.6)

All these results (obtained from the quantum device) are then sent to a classical
optimizer. In summary,
X
min hA1 ...An ⟨0|, U † (θ), σA1 ⊗ . . . ⊗ σAn U (θ), |0⟩ = EV QE ≳ E0 . (4.1.7)
θ
A1 ,...,An

Let us illustrate how the VQE could be applied to the optimization of portfolios. As
we discussed above (see equation (3.1.23)), a binary portfolio optimization problem
aims at
S
X S
X
min α bs Σss′ bs′ − µ s bs , (4.1.8)
s,s′ =1 s=1

where bs is a binary variable, bs ∈ {0, 1}, and Σss′ is a symmetric matrix, Σss′ = Σs′ s .
For completeness, let us write the objective function,
S
X S
X
f (b1 , . . . bs . . . , bS ) = α bs Σss′ bs′ − µ s bs . (4.1.9)
s,s′ =1 s=1

The variational quantum method establishes that we can minimize this function by
constructing a cost Hamiltonian, ĤC , and finding its minimum expectation value.
Minimizing the objective function is equivalent to minimizing the expectation value
of the cost Hamiltonian:

min f (b1 , . . . bs . . . , bS ) = min ⟨Q|ĤC |Q⟩ , (4.1.10)


3
See QC1, equation (4.71).
48 CHAPTER 4. QUANTUM-ENHANCED SOLUTIONS

S S
where |Q⟩ ∈ H2 . If we choose the computational basis {|b1 · · · bs · · · bS ⟩} for H2 ,
where the entries of each vector |b1 · · · bs · · · bS ⟩ are associated to their correspond-
ing stocks (bs = 1 if the stock s is in the portfolio and bs = 0 if it is not), the vector
|Q⟩ can be expressed as a linear superposition of these basis vectors,
S
X
|Q⟩ = α... bs ... | · · · bs · · · ⟩ . (4.1.11)
s=1

The construction of the Hamiltonian operator in terms of Pauli gates is relatively


simple. For this, recall that,
Z |0⟩ = |0⟩ = (1 − 2 · 0) |0⟩ , (4.1.12)
Z |1⟩ = − |1⟩ = (1 − 2 · 1) |1⟩ . (4.1.13)
In more compact notation,
Z |b⟩ = (1 − 2b) |b⟩ , (4.1.14)
or,
1
(I − Z) |b⟩ .
b |b⟩ = (4.1.15)
2
Hence, for every basis vector we have that,
1
(I − Zs ) | · · · bs · · · ⟩ ,
bs | · · · bs · · · ⟩ = (4.1.16)
2
where Zs = I ⊗ . . . ⊗ Zs ⊗ . . . ⊗ I. The operator associated with the linear term in
(4.1.9) is then:
S S
X X 1
− µs bs 7−→ − µs (I − Zs ) . (4.1.17)
s=1 s=1
2
The operator associated with the quadratic term in (4.1.9) is obtained in a similar
fashion,
S S
X X 1 1
α bs Σss′ bs′ →
7 α (I − Zs ) Σss′ (I − Zs′ )
s,s′ =1 s,s′ =1
2 2

S
X Σss′
=α (I − Zs′ − Zs + Zs Zs′ ) . (4.1.18)
s,s′ =1
4

The cost Hamiltonian is thus,


S S
X Σss′ X 1
ĤC = α (I − Zs′ − Zs + Zs Zs′ ) − µs (I − Zs ) . (4.1.19)
s,s′ =1
4 s=1
2

Suppose the case of only two stocks, s and s′ . The corresponding cost Hamiltonian
is,
Σss′ 1 1
ĤCss′ = α (I − Zs′ − Zs + Zs Zs′ ) − µs (I − Zs ) − µs′ (I − Zs′ )
2 2 2
Σss′  µs Σss′   µs ′ Σss′ 
=α Zs Zs′ + −α Zs + −α Zs′
2 2 2 2 2
 Σ ′ µs µs ′ 
ss
+ α − − I. (4.1.20)
2 2 2
4.1. QUANTUM PORTFOLIO OPTIMIZATION 49

Since we can always shift the minimum of the Hamiltonian expectation value, we
simply consider
Σss′ 1  1 
ĤCss′ = α Zs Zs′ + µs − αΣss′ Zs + µs′ − αΣss′ Zs′ . (4.1.21)
2 2 2

4.1.2 The QAO Algorithm


The Quantum Approximate Optimization Algorithm (QAOA) is a variational al-
gorithm designed to solve classical combinatorial optimization problems, such as
portfolio optimization.4 We start by rewriting the cost Hamiltonian (4.1.19) as
follows:
S S S
X Σss′ X 1 X 
ĤC = α Zs Zs′ + µs − α Σss′ Zs , (4.1.22)

s,s =1
4 s=1
2 ′
s =1

where—for the same reason discussed above—we have omitted the term proportional
to the identity operator. To make this expression more manageable, we define
S S S
X Σss′ X 1 X 
ĤZZ =α Zs Zs′ , ĤZ = µs − α Σss′ Zs . (4.1.23)

s,s =1
4 s=1
2 s′ =1

We thus have that


ĤC = ĤZZ + ĤZ . (4.1.24)
The evolution operator corresponding to this Hamiltonian is given by

UC (γ) = e−iγ ĤC = e−iγ ĤZZ e−iγ ĤZ , (4.1.25)


where γ is a positive parameter. Note that we have applied the Campbell-Hausdorff
formula and used the fact that Pauli-Z operators commute with each other. More
explicitly,
S S S
h X Σss′ i h X 1 X  i
UC (γ) = exp − iγ α Zs Zs′ exp iγ α Σss′ − µs Zs . (4.1.26)
s,s′ =1
4 s=1
2 s′ =1

Let us pause here to understand the quantum circuit corresponding to this unitary.
First, recall that the rotation of a single qubit around the a-axis, where a = x, y, z, is
given in equation (2.1.13). The circuit corresponding to the exponential containing
ĤZ is obtained in the following manner. We begin by rewriting the exponential as
follows:
S S
−i γ ĤZ
hX γ X  i
e = exp i α Σss′ − µs Zs
s=1
2 s′ =1

S
O h γ X S  i
= exp i α Σss′ − µs Zs . (4.1.27)
s=1
2 s′ =1

To simplify the notation, we define


S
1 X 
as = − α Σss′ − µs , (4.1.28)
2 s′ =1
4
For more details, refer to section 5 of QC3.
50 CHAPTER 4. QUANTUM-ENHANCED SOLUTIONS

so that
S
O
−iγ ĤZ
e = e−iγas Zs . (4.1.29)
s=1
5
This unitary is equivalent to
S
O S
O
−iγ ĤZ −iγas Zs
e = e = Rz (2γas ) . (4.1.30)
s=1 s=1

This result tells us that the exponential involving ĤZ is equivalent to rotating each
qubit s = 1, 2, . . . , S by an angle of 2γas about the z-axis. The circuit corresponding
to the exponential containing ĤZZ is a bit more complicated to figure out. Since,
as can easily be shown,

e−iδZs Zs′ |bs ⟩ |bs′ ⟩ = CNOT (I ⊗ Rz (2δ)) CNOT |bs ⟩ |bs′ ⟩ , (4.1.31)

we conclude that
S
h X i S
O
e−iγ ĤZZ = exp −iγass′ Zs Zs′ = e−iγass′ Zs Zs′
s,s′ =1 s,s′ =1

S
O
= CNOTss′ (I ⊗ Rz (2γass′ )) CNOTss′ , (4.1.32)
s=1
s′ <s

where, to simplify the notation, we have introduced ass′ = αΣss′ /4. The evolution
operator in equation (4.1.25) is thus realized by the circuit in (4.1.32), followed by
the circuit in (4.1.30).
Now that we know how to realize the evolution operator corresponding to the
cost Hamiltonian, we are interested in the qubit that enters the circuit, how to
prepare it, and the qubit that exits it. It is common to choose the input qubit as
|Q⟩in = |+⟩⊗S . This is done using Hadamard gates. Recall that a Hadamard gate
acts on a computational basis vector as follows:

1 X ′
H |b⟩ = √ (−1)bb |b′ ⟩ . (4.1.33)
2 b′

More generally,

1 X ′ ′
H ⊗S |b1 . . . bS ⟩ = √ (−1)b1 b1 + ... +bS bS |b′1 . . . b′S ⟩ . (4.1.34)
S
2 b′
s

The initial qubit |Q⟩in = |+⟩⊗S is prepared by applying a Hadamard gate to each
individual qubit |bs ⟩ = |0⟩:

1 X ′
|Q⟩in = |+⟩⊗S = H ⊗S |0 . . . 0⟩ = √ |b1 . . . b′S ⟩ . (4.1.35)
S
2 b′
s

5
See equation (4.72) of QC1.
4.1. QUANTUM PORTFOLIO OPTIMIZATION 51

The output state is then given by

H ⊗S UC (γ) 1 X ′
|0 . . . 0⟩ 7−−−−−→ |Q⟩in 7−−−−−−→ UC (γ) √ |b1 . . . b′S ⟩ . (4.1.36)
S
2 b′
s

Regardless of the input qubit state, the QAOA stipulates that we follow the unitary
UC (γ) with a second unitary, associated with the so-called mixer Hamiltonian,
S
X
ĤM = Xs . (4.1.37)
s=1

The corresponding parameterized unitary is given by


S
PS O
−iβ ĤM −iβ
UM (β) = e =e s=1 Xs
= e−iβXs . (4.1.38)
s=1

Note that, since UM (β) does not commute with UC (γ), the strict order is as follows:
first, UC (γ) acts on the input qubit, and then UM (β). It can easily be shown that
S
O
UM (β) = Rx (2β) . (4.1.39)
s=1

The qubit state that exits the quantum circuit, formed by the unitaries UC (γ)
followed by UM (β), is now parameterized by the angles γ and β,
UM (β)UC (γ)
|Q⟩in 7−−−−−−−−−→ |Q(γ, β)⟩ = UM (β) UC (γ) |Q⟩in . (4.1.40)

This is the ansatz state that we will use to measure the expectation value of the
cost Hamiltonian in equation (4.1.22),

⟨Q(γ, β)| ĤC |Q(γ, β)⟩ . (4.1.41)

Since the expectation value of the cost Hamiltonian is a real-valued function of both
parameters γ and β, we can simply write

F (γ, β) = ⟨Q(γ, β)| ĤC |Q(γ, β)⟩ . (4.1.42)

We could then send the measurements of the expectation value of the cost Hamilto-
nian F (γ, β) to a classical optimizer to propose better values for γ and β, repeating
this process as many times as necessary until we reach a good approximation (γ∗ , β∗ ).
However, the QAOA suggests that, rather than optimizing a single pair of parame-
ters (γ, β), a better approximation can be found by creating a sequence of unitaries
UC (γ) and UM (β), each with its own parameter. In other words, the QAOA pre-
scribes that we allow the initial state |Q⟩in to enter the following parameterized
sequence of gates:

|Q⟩in 7−→ UM (βp ) UC (γp ) . . . UM (βk ) UC (γk ) . . . UM (β1 ) UC (γ1 ) |Q⟩in

= |Q(γ1 , . . . , γk , . . . , γp , β1 , . . . , βk , . . . , βp )⟩ . (4.1.43)
52 CHAPTER 4. QUANTUM-ENHANCED SOLUTIONS

Each pair of unitaries UM (βk )UC (γk ), for k = 1, 2, . . . , p, is called a layer . Specifi-
cally, UM (βk )UC (γk ) is the kth layer, with UC (γk ) referred to as the kth cost layer
and UM (βk ) as the kth mixer layer . It has been shown that the larger the number
of layers, the better the approximation of the optimization problem. Needless to
say, though, the number of layers must be kept within a reasonable limit to ensure
that the calculation is not adversely affected by excessive noise.
In total, there are 2p parameters to be optimized variationally: p angles γk and
p angles βk . We can collect all these variational parameters in a more compact
notation: γ = (γ1 , . . . , γp ) and β = (β1 , . . . , βp ). The ansatz state is thus
p
Y
|Qp (γ, β)⟩ = UM (βk ) UC (γk ) |Q⟩in . (4.1.44)
k=1

The function in 2p variables that the classical computer must optimize is


Fp (γ, β) = ⟨Qp (γ, β)| ĤC |Qp (γ, β)⟩ . (4.1.45)
The optimal portfolio is the solution to the problem:
min Fp (γ, β) = min ⟨Qp (γ, β)| ĤC |Qp (γ, β)⟩ . (4.1.46)
γ,β γ,β

4.2 Quantum Machine Learning


We have already reviewed the main ideas and mathematical foundations of classical
machine learning. In this section, we explore how quantum computing can enhance
these classical approaches. We begin by introducing the basics of quantum machine
learning, including several key algorithms, and then examine how they can be applied
in financial contexts.

4.2.1 QML Algorithms


If we want to analyze classical data using a quantum computer, the first step is to
encode that information into a quantum system that the quantum computer can
process—in other words, into qubits. We begin with a brief review of several meth-
ods developed to achieve this.6

Data Encoding
Suppose we have a set of samples, n = 1, . . . , N , characterized by two features, x1
and x2 . For simplicity, assume that each feature can take one of the following four
values: 0, 1, 2, or 3. Using simple binary notation, we can represent these values
as 00, 01, 10, and 11, respectively. The feature vector of the n-th sample can be
expressed in binary notation as follows:
 (n) (n) T (n)  (n) (n) T
x(n) = x1 x2 ←→ xb = x1b x2b
 (n) (n) (n) (n) T
= (b1 )1 (b1 )2 (b2 )1 (b2 )2
 (n) (n) (n) (n) T
= b11 b12 b21 b22 . (4.2.1)
6
For an introduction, see D. Pastorello, Concise Guide to Quantum Machine Learning, and
M. Schuld & F. Petruccione, Machine Learning with Quantum Computers.
4.2. QUANTUM MACHINE LEARNING 53

(n)
Basis encoding associates the binary feature vector xb with a computational basis
vector of a 24 -dimensional qubit space:
(n) (n) (n) (n) (n) (n)
xb 7−→ |xb ⟩ = |b11 b12 b21 b22 ⟩ . (4.2.2)

For any other sample, say n′ , we have a similar expression,


(n′ ) (n′ ) (n′ ) (n′ ) (n′ ) (n′ )
xb 7−→ |xb ⟩ = |b11 b12 b21 b22 ⟩ . (4.2.3)

If the samples n and n′ are characterized by the two features x1 and x2 , the entire
dataset, X, is associated with the following state vector:
" (n) (n)
#
x1 x2 1 (n) 1 (n′ )
X = (n′ ) (n′ ) 7−→ |Xb ⟩ = √ |xb ⟩ + √ |xb ⟩ . (4.2.4)
x1 x2 2 2

The generalization to more complex cases is straightforward. For simplicity, suppose


that x is a positive integer number expressed in the usual decimal system. The
corresponding bit string is given by7
n
X
x = 2n−1 b1 + 2n−2 b2 + . . . + 20 bn = 2n−j bj ←→ xb = b1 b2 . . . bn , (4.2.5)
j=1

where bj ∈ {0, 1}, and n depends on the value of x. (Note that the subscript n
here should not be confused with the superscript (n) in x(n) , which denotes the nth
sample.) If there are two features, say i and i′ , the feature vector for the nth sample
is given by
 (n) (n) T (n)  (n) (n) (n) (n) T
x(n) = xi xi′ ←→ xb = bi1 . . . bin bi′ 1 . . . bi′ n′ , (4.2.6)

and the computational basis vector associated with it is


(n) (n) (n) (n) (n) (n)
xb 7−→ |xb ⟩ = |bi1 . . . bin bi′ 1 . . . bi′ n′ ⟩ . (4.2.7)

In general, for I features:


 (n) (n) T (n) (n) (n) (n)
x(n) = x1 . . . xI 7−→ |b11 . . . b1n1 . . . bI1 . . . bInI ⟩ . (4.2.8)
 (n) 
The ket associated with the entire classical dataset X = xi is then given by
N
1 X (n)
X 7−→ |X⟩ = √ |x ⟩ . (4.2.9)
N n=1

For decimal numbers, the procedure is similar.


Another common method of mapping classical data into quantum states is am-
plitude encoding. We start with the feature vector of the nth sample, x(n) =
 (n) (n) (N ) T
x 1 . . . xi . . . xI , where n = 1, . . . , N , and normalize it,

x(n)  (n) (n) (n) T


x(n) 7−→ (n)
= x̄(n) = x̄1 . . . x̄i . . . x̄I , (4.2.10)
∥x ∥
7
See equation (2.1) of QC1.
54 CHAPTER 4. QUANTUM-ENHANCED SOLUTIONS

where,
I I
(n) 2 (n) 2
X X
∥x(n) ∥2 = xi , ∥x̄(n) ∥2 = x̄i = 1. (4.2.11)
i=1 i=1
(n)
We then associate the normalized feature vector x̄ with a quantum state as follows:
I
X
(n) (n) (n)
x̄ 7−→ |x ⟩= x̄i |i⟩n . (4.2.12)
i=1
(n)
Note that for each feature value x̄i , there is an associated basis vector |i⟩n . It
follows that the dimension of the qubit space must satisfy 2Q ≥ I, where Q is the
number of qubits in |i⟩n . More specifically,
2Q I 2 Q
X (n)
X (n)
X (n)
(n)
|x ⟩= x̄i |i⟩n = x̄i |i⟩n + x̄i |i⟩n , (4.2.13)
i=1 i=1 i=I+1

(n)
where x̄i = 0 for i = I + 1, . . . , 2Q . The same idea can be extended to the entire
 (n) 
dataset X = xi , where i = 1, . . . , I, and n = 1, . . . , N . In this case, we normalize
(n) (n) (n)
the elements of the matrix X by setting x̄i = xi /∥xi ∥, where
I X
N
(n) 2
(n)
X
∥xi ∥2 = xi . (4.2.14)
i=1 n=1

The corresponding quantum state is given by


I X
N Q
2 I 2 N Q
X (n)
X X (n)
X 7−→ |X⟩ = x̄i |n⟩ |i⟩ = x̄i |n⟩ |i⟩ , (4.2.15)
i=1 n=1 i=1 n=1
(n)
where 2QI ≥ I, 2QN ≥ N , and x̄i = 0 for n = N +1, . . . , 2QN and i = I +1, . . . , 2QI .
The final approach we wish to mention is angle encoding or rotational encoding.
Recall that a qubit in the Bloch sphere is described by the vector
|q(ϑ, ϕ)⟩ = cos(ϑ/2)|0⟩ + eiϕ sin(ϑ/2)|1⟩ . (4.2.16)
See equation (2.1.5). The parameters ϑ and ϕ lie in the ranges ϑ ∈ [0, π] and
ϕ ∈ [0, 2π), respectively. The rotation operator Ra (θa ), given in equation (2.1.13),
rotates a qubit by θa radians about the a-axis, where a = x, y, z. For example, a
rotation of θ radians about the y-axis is given by
Ry (θ) = cos(θ/2)I − i sin(θ/2)Y . (4.2.17)
Applying this operator to the basis vector |0⟩, we get
Ry (θ) |0⟩ = cos(θ/2) |0⟩ + sin(θ/2) |1⟩ ; (4.2.18)
where we have used that Y |0⟩ = i |1⟩. Note that this vector has ϕ = 0.
(n)
Suppose we have a single sample and want to encode a feature value, xi , into a
(n) (n)
quantum state. To do this, we first rescale xi so that its new value, θi , lies within
the range [0, π]. After that, we associate this value with a vector state as follows:
(n) (n) (n) (n)
xi 7−→ θi 7−→ |θi ⟩ = Ry (θi ) |0⟩
(n) (n)
= cos(θi /2) |0⟩ + sin(θi /2) |1⟩ . (4.2.19)
4.2. QUANTUM MACHINE LEARNING 55

(n) (n)
Consider now all the feature values of the nth sample, x1 , . . . , xI . To use a
(n)
similar angle parametrization, we can associate the smallest feature value, xi,min ,
(n)
with 0 radians and the largest value, xi,max , with π radians. The remaining angles
will lie between these two extremes,
(n) (n)
(n) xi − xi,min
θi = (n) (n)
π. (4.2.20)
xi,max − xi,min

After applying this transformation to all features and replacing x(n) 7→ θ (n) =
 (n) (n) T
θ1 . . . θI , we associate the following ket with this column vector:
I
O
(n) (n) (n) (n)
x 7−→ θ 7−→ |θ ⟩= Ry (θi ) |0⟩ . (4.2.21)
i=1

The rotation of the single-qubit state vector |0⟩ about the y-axis allows us to use
the angle θ to encode one feature value. If there are I features, we can encode them
in I angles, with one angle per qubit |0⟩. In general, though, a qubit requires two
real values (angles in the Bloch sphere) to be fully described. We can therefore use
the angle ϕ, associated with a rotation about the z-axis, to encode another piece of
classical data. Using the general formula above for a rotation operator, a z-rotation
acts as:
Rz (ϕ) = cos(ϕ/2)I − i sin(ϕ/2)Z . (4.2.22)
When applied to the qubit state Ry (θ) |0⟩, given in (4.2.17), it produces

Rz (ϕ)Ry (θ) |0⟩ = e−ϕ/2 cos(θ/2) |0⟩ + eϕ sin(θ/2) |1⟩ ,



(4.2.23)

where we have used that Z |b⟩ = (−1)b |b⟩. Thus, we can encode 2I features in
the angles of rotation of I qubits. For example, we can associate the odd-indexed
features with rotations about the y-axis,
(n) (n) (n)
x2i−1 7→ x̄2i−1 7→ θ2i−1 , (4.2.24)

and the even-indexed features with rotations about the z-axis,


(n) (n) (n)
x2i 7→ x̄2i 7→ ϕ2i . (4.2.25)

Ignoring the global phase, we can encode two classical data points as follows:
 (n) (n) T (n) (n)
x2i−1 x2i 7−→Rz (ϕ2i )Ry (θ2i−1 ) |0⟩
(n)
(n) (n)
= cos(θ2i−1 /2) |0⟩ + eϕ2i sin(θ2i−1 /2) |1⟩ . (4.2.26)

Finally, the entire set of features corresponding to the nth sample is encoded in the
following ket:
I
O (n) (n)
x(n) 7−→ Rz (ϕ2i )Ry (θ2i−1 ) |0⟩ .
i=1

I
O (n)
(n) (n)
cos(θ2i−1 /2) |0⟩ + eϕ2i sin(θ2i−1 /2) |1⟩ .

= (4.2.27)
i=1
56 CHAPTER 4. QUANTUM-ENHANCED SOLUTIONS

Now that we understand how classical data can be encoded into quantum informa-
tion, let us examine how this quantum information can be processed into the analog
of classical neural networks.

Quantum Neural Networks


Suppose a dataset with 2I features per sample point. As we saw above, if we use
angle encoding, we can encode each sample in an I-qubit system. That is, the
2I classical features of the nth sample, where n = 1, . . . , N , can be encoded in a
quantum state schematically indicated as follows:
I
x(n) ∈ R2I 7−→ |φ(n) ⟩ ∈ C2 . (4.2.28)
We now let pass the quantum state |φ(n) ⟩ through a parameterized quantum circuit
U (θ),
|φ(n) ⟩ 7−→ U (θ) |φ(n) ⟩ . (4.2.29)
Finally, we perform the measurement. If we denote by M the observable, the ex-
pectation value is then
⟨φ(n) | U † (θ)M U (θ) |φ(n) ⟩ . (4.2.30)
This is not something new. In fact, it is the standard parameterized quantum circuit
approach. What differs in a Quantum Neural Networks (QNN ) is the architecture
of the circuit. Suppose that, as we did for the classical neural network, we introduce
H hidden layers, each with Nn nodes, where h = 1, . . . , H. Each layer consists
of single-qubit gates and two-qubit gates (to create entanglement). These are the
analogs of nodes in a classical NN. For simplicity, we fix the two-qubit gates (e.g.,
CNOT gates) and allow the single-qubit gates to be rotational gates. Given that
there are H hidden layers, each acting on I qubits, we have at most I × H angle
parameters to train.
Let us close this brief review of quantum machine learning with some general
considerations.
The algorithms we have presented above are usually called native quantum machine
learning algorithms. This terminology arises from the fact that every step—from
encoding classical data to the optimization process—is purely quantum. Another
approach in quantum machine learning involves incorporating quantum subroutines
into the pipeline of a classical machine learning process. For example, the Quantum
Basic Linear Algebra Subroutines (QBLAS ) accelerate basic linear algebra compu-
tations. These subroutines can be integrated into classical machine learning pro-
cedures to speed up certain operations, such as matrix inversion or inner prod-
uct estimation. However, it has been shown that neither native quantum machine
learning algorithms nor QBLAS necessarily provide an exponential speedup over
classical machine learning algorithms in general settings. While certain quantum
algorithms—such as those leveraging quantum linear algebra techniques—can offer
polynomial or, in some cases, exponential improvements for specific problem in-
stances, these speedups rely on strong assumptions about data access and problem
structure. Furthermore, given that practical, large-scale hybrid quantum-classical
computing architectures are not yet available, realizing meaningful quantum advan-
tages for machine learning remains an open challenge.
Although much of the discussion about quantum computing revolves around the
potential speedup of quantum algorithms compared to classical ones, quantum ma-
chine learning highlights other advantages beyond mere computational acceleration.
4.2. QUANTUM MACHINE LEARNING 57

For example, in certain tasks, QML techniques may provide a better approximation
than purely classical ML techniques. Even if the computation takes longer, this
advantage can be valuable. This contrasts with the traditional perspective, where
quantum algorithms are primarily expected to outperform their classical counter-
parts in terms of speed. The relevance of this shift is clear: in some cases, accuracy
is more desirable than faster computation, such as in privacy-sensitive applications
or scenarios requiring higher precision in modeling complex systems. For instance,
in financial modeling, precise risk estimation, market trend prediction, or portfolio
optimization may be more valuable than rapid execution. Another example outside
of finance is drug discovery, where accurately modeling quantum interactions at the
molecular level may be more crucial for identifying promising compounds, even at
the expense of a longer computational time.
As seen in the previous paragraph, evaluating the advantage of quantum machine
learning techniques in real-world applications can be quite complex. In addition
to this, there are the technical challenges such as the efficiency and robustness of
encoding classical data into quantum states, the impact of qubit and quantum gate
fidelity on the training process, the use of quantum optimizers instead of the classical
ones usually considered, among others.

4.2.2 QML in Finance


The use of the algorithms discussed in the previous paragraphs in finance follows
directly from our earlier discussion on the applications of classical machine learning
in finance. These quantum-enhanced algorithms aim to accelerate the performance
of their classical counterparts. For example, Quantum Principal Component Anal-
ysis (QPCA) is used in portfolio management, and Quantum k-Means Clustering
enhances clustering techniques for applications such as fraud detection and money
laundering.
Let us discuss a few more advanced algorithms that have been proposed for use in
finance.8

Quantum Adversarial Models


The first approach we want to discuss is Generative Adversarial Networks (GANs).
They are called networks because they consist of two neural networks: a genera-
tor —hence the term generative—and a discriminator . The generator creates data
that resembles real data as closely as possible, which is then sent to the discrimi-
nator. The discriminator evaluates how likely this data is to be real or generated.
This evaluation is then sent to the generator. These models are called adversarial
precisely because of this cyclic interaction between the two neural networks. They
engage in an opposing game, where the generator aims to create synthetic data that
is increasingly difficult for the discriminator to distinguish from real data. Thanks
to this interaction, GANs are capable of generating highly realistic data. In finance,
8
In addition to the references mentioned in the footnote 1, the review paper by M. Pistoia et
al., “Quantum Machine Learning for Finance” (2021), offers a concise overview of the subject as
it stood a couple of years ago. The book by A. Jacquier and O. Kondratyev, Quantum Machine
Learning and Optimization in Finance, although it covers many of the subjects already discussed
in this guide, provides additional insights into the application of these concepts specifically to
finance.
58 CHAPTER 4. QUANTUM-ENHANCED SOLUTIONS

GANs are used to generate synthetic financial data, such as stock prices or market
conditions, helping to test the resilience of financial strategies and create more ro-
bust models. They can also be employed to generate realistic fraudulent transaction
data, thereby improving fraud detection systems.

Quantum Generative Adversarial Networks

The second adversarial paradigm we want to discuss is Adversarial Reinforcement


Learning (ARL). Reinforcement Learning (RL) is a machine learning approach that
is neither supervised nor unsupervised. The agent that learns in RL is called the
learning agent. ARL extends reinforcement learning by introducing an adversarial
agent that aims to challenge or deceive the learning agent. The key advantage of
ARL is its ability to improve the robustness of the learning agent, especially in
complex, dynamic environments. In finance, ARL can be used to optimize trading
strategies by simulating adversarial market conditions, allowing agents to learn and
adapt to unpredictable or hostile environments. It can also enhance risk management
by training agents to handle worst-case scenarios and improve portfolio management
by making strategies more resilient to market manipulation or unexpected shocks.
By incorporating adversarial elements, ARL helps develop strategies that are better
suited for real-world challenges.

4.3 Programming Quantum Computers


Some of the leading firms working toward building the first practical quantum com-
puter (see Section 5.2) have also made their hardware partially available in the cloud
to individuals, startups, and large organizations. To use these platforms, though,
users must be familiar with the programming languages developed for them. We
will discuss some of them here. In addition to the software provided by hardware
developers, independent firms have created their own tools to interface with quan-
tum cloud platforms.

Qiskit

Qiskit is the most popular quantum software framework at the moment. Its success
can be attributed to several factors. First, it was developed by IBM, one of the
leading quantum hardware companies in the world today, and the company pro-
vides free access to their quantum computers through the cloud. Second, Qiskit has
a Python-based interface that integrates seamlessly with popular data science tools
like NumPy and Pandas, making it easy for students and professionals from various
fields who are familiar with Python to get started. As a result, Qiskit is a promi-
nent choice for both educational purposes and professional research. Its success is
also attributed to the fact that it is open-source software, benefiting from an active
and collaborative community, much like Python, that contributes to the frame-
work’s continuous development. Fourth, Qiskit enables users to develop quantum
algorithms, simulate quantum circuits, and run experiments on quantum computers
and simulators (classical computers that simulate the behavior of quantum comput-
ers). Finally, Qiskit supports a growing quantum ecosystem, including integration
4.3. PROGRAMMING QUANTUM COMPUTERS 59

with other quantum platforms and hardware.9

Cirq
Similar to IBM’s Qiskit, Google has developed its own quantum computing frame-
work called Cirq. Cirq shares many of the advantages found in Qiskit.10 First, it is
backed by one of the largest tech companies in the world, which has a proven track
record of breakthroughs in quantum computing. Second, it offers a Python-based
interface that integrates seamlessly with Google’s quantum hardware, making it—at
least in principle—appealing to students and professionals from diverse fields. Third,
Cirq is open-source, allowing users to contribute to its development and utilize it
for creating and running quantum circuits, whether on quantum computers or sim-
ulators. Like Qiskit, Cirq also integrates with other quantum computing platforms
and tools. However, compared to Qiskit, Cirq lacks a large, established, and col-
laborative community of researchers and developers. While it’s difficult to quantify
the exact reasons for Qiskit’s broader popularity, it is likely that Qiskit’s expansive
ecosystem, strong educational resources, and greater community support have made
it a more widely adopted choice in the quantum computing developer community.11

PyQuil
The PyQuil quantum software framework was developed by Rigetti, a quantum
hardware company specializing in superconducting qubits. While IBM and Google
also focus on superconducting quantum processors, Rigetti is a smaller company
with a distinct emphasis on hybrid quantum-classical computing. PyQuil serves
as Rigetti’s counterpart to Qiskit and Cirq, designed for seamless integration with
its quantum hardware. Like the two frameworks discussed above, PyQuil allows
users to design and deploy quantum applications on both simulators and real quan-
tum processors. While Qiskit provides a broader ecosystem covering areas such as
quantum circuits, machine learning, and quantum chemistry, PyQuil is specifically
designed to facilitate hybrid quantum-classical computing. Although Qiskit and
Cirq also support hybrid execution, PyQuil is the most explicitly hybrid-focused
framework among the three, making it particularly well-suited for variational quan-
tum algorithms and real-time classical processing. That said, PyQuil lacks some of
Qiskit’s advantages, such as a larger user base and extensive community resources.
IBM’s strong investment in educational materials, cloud-based quantum access, and
an active global community gives Qiskit a more extensive ecosystem. Nonetheless,
PyQuil remains a powerful tool for users working within Rigetti’s quantum comput-
ing stack, particularly those interested in hybrid computing paradigms. 12

Amazon Braket
Although Amazon is developing its own quantum hardware, publicly available infor-
mation suggests that it is less advanced than that of IBM, Google, and Rigetti. In
fact, Amazon is best known for its quantum software framework: Amazon Braket.
9
https://www.ibm.com/quantum/qiskit
10
For an insightful discussion on the differences between Qiskit and Cirq, read my LinkedIn post
and the comments at https://bit.ly/QiskitvsCirq.
11
https://quantumai.google/cirq
12
https://www.rigetti.com
60 CHAPTER 4. QUANTUM-ENHANCED SOLUTIONS

Amazon Braket does not use Amazon’s own quantum hardware but instead provides
access to quantum processors from multiple external providers, including Rigetti
(superconducting qubits), IonQ (trapped-ion qubits), QuEra (neutral-atom qubits),
and D-Wave (a quantum annealer). In addition to providing a Python Software De-
velopment Kit (SDK) to build and run quantum algorithms on quantum computers,
it also offers classical quantum simulators to test algorithms before running them
on quantum hardware. Finally, Amazon Braket’s integration with other classical
computing resources from the Amazon ecosystem enables users to create seamless
hybrid quantum-classical workflows, which are ideal for solving complex problems,
such as those involving variational quantum algorithms.13

PennyLane
PennyLane is a hardware-agnostic quantum machine learning framework designed
to integrate seamlessly with classical machine learning libraries. It connects to quan-
tum computers through APIs from platforms such as Qiskit (IBM), Cirq (Google),
Rigetti’s Quantum Cloud Services (QCS), and Braket (Amazon). One of its key
strengths is quantum differentiation, which allows for efficient gradient computation
in quantum circuits, making it particularly valuable for quantum machine learn-
ing and AI research. Additionally, PennyLane works seamlessly with classical ma-
chine learning frameworks like TensorFlow and PyTorch, enabling users to develop
quantum-enhanced machine learning models and optimize complex tasks by incor-
porating quantum circuits into hybrid workflows.

13
https://aws.amazon.com/braket
Chapter 5

How to Get Quantum-Ready

In this Chapter, we focus on the broader context of the adoption of quantum comput-
ing by financial institutions. Before delving into the details, however, it is essential
to understand the current status of the quantum computing ecosystem at large.
Recognizing the near-future impact of quantum technologies on society, the gov-
ernments of the most developed countries have begun funding research centers and
educational programs. Given the nascent and evolving status of the field, where
cutting-edge research is crucial to securing a competitive position, the primary fo-
cus of governments has been on supporting research institutions. Research centers
have been established in the United States, China, Europe, Singapore, and the Gulf
countries, to name just a few.
To address the present and future needs of research centers and industries already
engaged in quantum computing, advanced educational programs tailored specifically
to these requirements, such as MSc and PhD programs, have been created. These
programs cover diverse topics, ranging from quantum optics and machine learning
to the funding of startups. They are available in most countries with significant
quantum computing initiatives. Governments have played an active role in funding
these programs.
Due to the relatively low cost of educational initiatives compared to advanced
research—especially if it involves experimental research—quantum computing ed-
ucational programs are being proposed globally, including in developing countries.
Online certifications are also offered by leading educational institutions such as MIT
and by private companies.
The private sector, represented by major technology companies such as IBM and
Google, has also developed a strong presence in quantum research and education.
Companies not only focus on their internal needs and strategies for the future but
also contribute to the collective advancement of the field. In addition to this en-
gagement by major corporations, particularly in hardware and software research and
development, dozens of startups have emerged to address specific needs, including
those related to financial services, as discussed below.
Collaborations between these three sectors—governments, educational institutions,
and the private sector—are frequent.1 For instance, research partnerships often
1
The seminal book The Triple Helix: University-Industry-Government Innovation in Action,
by H. Etzkowitz & L. Leydesdorff, remains the basic reference for explaining how the interactions
between governments, universities, and private companies contribute to innovation, economic de-
velopment, and technological progress. Etzkowitz’s most recent book, published under the same
title, adopts a more practical approach and is well worth reading.

61
62 CHAPTER 5. HOW TO GET QUANTUM-READY

involve banks, public institutions such as universities, and companies focused on


hardware and software development. Similar collaborations are also seen in other
fields, such as pharmaceuticals, advanced materials, and engineering research.

5.1 Adopting Technological Innovations


As history shows, failing to embrace technological innovations can have severe con-
sequences for businesses, particularly in industries where competition and customer
expectations evolve rapidly.
Well-known studies have shown that every time a new technology is developed and
introduced to the market, there are always groups ready to adopt it, even at the
early stages when the product is incomplete and the future uncertain.2 On the other
hand, there are those who, for various reasons, vehemently reject the idea. These
are two extreme cases: the early adopters (13.5%) and the laggards (16%). Most
people, however, fall somewhere in between these extremes. In fact, the majority of
people will adopt the technology at an intermediate stage of its development. Some
will adopt it earlier—referred to as the early majority (34%)—and others later,
known as the late majority (34%). Before these large groups, there is a minority,
the innovators (2.5%), who create and initially use the new technology.3
Regarding quantum computing, it is important to clearly discern whether it is still
in the innovators stage or if it has already moved past to the stage where more
people are beginning to believe in its potential and adopt it. Among the innovators,
we can include companies like IBM, Quantinuum, D-Wave, and IonQ, among many
others, which are developing quantum hardware. In the early adopters group, we can
mention financial institutions such as JPMorgan and HSBC. Despite this, evidence
shows that the vast majority of businesses are still reluctant to take action and start
investing in quantum computing initiatives.
This widespread hesitation explains why many leaders in the financial sector—both
individuals and small and large companies—devote significant time, energy, and
budgets to promoting the potential benefits of quantum computing for businesses.

5.1.1 Consequences of Delaying Technology Adoption


Each market is unique, and the way businesses adopt technological innovations must
be assessed on a case-by-case basis. The financial services industry is no exception.
However, there are some general considerations that are common to most cases.
Broadly speaking, companies that resist adopting new technologies risk falling be-
hind and, ultimately, failing.
A key factor to consider is that in today’s fast-paced, technology-driven societies,
customers have become increasingly demanding and competition has grown fiercer,
leaving companies struggling to acquire and retain customers. This dynamic has led
2
The subject of innovation is vast. Some recommended readings on the subject are C. M. Chris-
tensen, The Innovator’s Dilemma; C. A. O’Reilly III & M. L. Tushman, Lead and Disrupt; the
classic text by E. M. Rogers, Diffusion of Innovations; and J. Tidd & J. Bessant, Managing
Innovation.
3
For an insightful discussion on technological innovation, adoption, and quantum computing,
read my LinkedIn post and the comments at https://bit.ly/TechInnovationandAdoption.
5.1. ADOPTING TECHNOLOGICAL INNOVATIONS 63

to a situation where companies that fail to adapt quickly to technological advance-


ments deliver mediocre services, prompting customers to migrate to more tech-savvy
alternatives. We must also remember that technological innovations often enable
businesses to improve operational efficiency and economic performance. Conse-
quently, companies that delay adopting new technologies risk incurring financial
losses, which can translate into higher costs or inferior services for customers. This,
in turn, drives customers toward competitors offering better value and convenience.
In sectors where technology plays a pivotal role and where the stakes are exception-
ally high, such as in the financial industry, these considerations become even more
critical. Adapting to and embracing technological change is not merely an option
but a necessity for survival and growth in this increasingly competitive landscape.
Let us briefly mention two well-known examples of companies, outside the financial
industry, that failed due to their reluctance to adopt innovative technologies.
As most of you certainly remember, Kodak was once a leader in the photogra-
phy industry, dominating the market with its iconic film products and memorable
advertising campaigns, such as the “Kodak Moments” slogan, which became syn-
onymous with capturing cherished memories. However, despite inventing the first
digital camera in 1975, Kodak chose to focus on its profitable film business, fear-
ing that digital cameras would cannibalize its core revenue stream. The company
delayed digital adoption, allowing competitors to seize the opportunity. It is said
that Steve Sasson, the engineer who invented Kodak’s digital camera, after facing
several rejections within the company, saw his invention overlooked while competi-
tors like SONY embraced the technology. SONY launched its first digital camera in
the 1980s, leveraging the potential Kodak had ignored. As digital cameras became
mainstream, produced notably by Japanese companies such as SONY and CANON,
Kodak’s market share began to plummet. By the 2000s, the once-dominant com-
pany was struggling to stay relevant in a rapidly changing market. In 2012, Kodak
filed for bankruptcy, becoming a cautionary tale of technological complacency and
the risks of failing to adapt to innovation. Today, Kodak’s story is often cited as
a lesson for businesses in the importance of embracing change and future-proofing
strategies.
Another well-known example of a successful company that failed due to its reluc-
tance to embrace new technologies was Blockbuster. For those who may not remem-
ber, Blockbuster was once the global leader in video rental services, with thousands
of stores around the world. In the 1990s, it was a staple of weekend entertainment.
I fondly recall that during my high school and university years, most Friday nights
after class, my friends and I would head to one of the many Blockbuster stores to
pick out a couple of movies for the weekend. The vibrant stores, with rows of VHS
tapes and DVDs, were part of the cultural fabric of the time. However, Blockbuster
ignored the rapid rise of digital streaming and dismissed opportunities to adapt its
business model. Most famously, it declined an offer to purchase Netflix for just $50
million in 2000, underestimating the disruptive potential of online streaming ser-
vices. As consumer preferences shifted toward the convenience of digital platforms,
Blockbuster’s physical rental model quickly became outdated. In 2010, Blockbuster
filed for bankruptcy, leaving behind a cautionary tale of what happens when busi-
nesses fail to recognize and adapt to technological change.
Like Kodak and Blockbuster, banks that fail to adopt emerging technologies risk
becoming irrelevant in a fast-changing market. Let us recall two such cases. Of
course, we do not suggest that these banks collapsed solely due to their lack of
64 CHAPTER 5. HOW TO GET QUANTUM-READY

technology adoption; however, it played a crucial role.


The first example is Barings Bank, a bank founded in 1762 in London. After a
long and prestigious reputation, Barings collapsed when a trader accumulated mas-
sive losses through unauthorized trades. The bank’s outdated systems and lack of
proper internal controls or automated monitoring tools allowed the trader to exploit
weaknesses, leading to catastrophic losses. The second example is Lehman Brothers,
a global American bank founded in 1850. One of the most famous bank failures in
financial history, Lehman Brothers’ downfall was, in part, due to its outdated risk
management systems and inability to leverage emerging financial technologies. The
bank lacked advanced tools for real-time risk assessment and data analysis, which
could have identified the growing risks in its portfolio earlier.
We have just seen two examples of banks whose demise was, to some extent, due
to a lack of technological adoption. In the competitive and fast-paced modern fi-
nancial services sector, banks must prioritize customer satisfaction, efficiency and,
as evidenced by the case of Lehman Brothers, effective risk management. As we will
discuss next, technological innovations play a crucial role in achieving these goals,
in addition to helping banks stay compliant with evolving industry standards.

5.1.2 The Big-Data Revolution in Fintech


By fintech, some experts broadly refer to the transformative impact of technology
on the financial sector. If by finance we mean the processes and tools for managing
money, investments, and transactions, then, in fact, the history of fintech spans a
long timeline. Our main interest, though, is specifically in information and data
technology. For completeness, let us briefly recall some of these interactions.
Businesses in the financial sector have been collecting and utilizing data since the
inception of these institutions. For instance, pawn shops, dating back to antiq-
uity, indirectly gathered data about their borrowers to assess creditworthiness and
manage risk. Similarly, currency exchange houses often sent employees to survey
competitors, evaluate exchange rates, and determine competitive pricing to retain
customers. In addition, they kept informed of the political and economic situations
of the countries issuing the currencies they traded—whether by reading newspapers,
exchanging information by word of mouth, or other means. What has changed in
modern times is not the reliance on data itself but the sheer volume of data col-
lected, the systematic ways it is stored and analyzed, and its purposeful utilization
for decision-making and competitive advantage.
The invention of the telegraph, and later the telephone, revolutionized the flow of
information from the late 19th century, creating an explosion in data and a grow-
ing need for efficient storage solutions. By the 1940s, the collection and processing
of data were further transformed by the invention and subsequent adoption of elec-
tronic computers by financial institutions. A landmark example of this technological
advancement was the American company Visa, which used these early computers
to launch the first credit card system. For the first time, financial institutions could
electronically store, manage, and access the data of cardholders, setting the stage
for the data-driven financial systems we see today.
From the advent of the internet in the 1990s, the amount of data collected and pro-
cessed by Big Tech companies has grown at an unprecedented pace. An important
fact is that financial institutions are among the greatest buyers of this information.
5.2. THE RACE FOR THE FIRST QUANTUM COMPUTER 65

Artificial intelligence, and more specifically machine learning, are among the tools
banks use to analyze these staggering amounts of data and make sound decisions,
enabling better risk management, personalized services, and improved operational
efficiency.
In the previous chapters, we explored how machine learning has transformed the fi-
nancial industry, with applications in portfolio optimization, fraud detection, credit
risk analysis, anti-money laundering, and enhanced security. Beyond these, there
are other notable innovations, such as the delivery of more personalized services and
the use of AI-driven chatbots for instant customer support. However, it is impor-
tant to remember that the shift toward adopting machine learning was not always
universally accepted. Just a few years ago, many professionals and financial insti-
tutions were hesitant to embrace it, often due to a lack of understanding, concerns
about data privacy, or skepticism regarding its effectiveness. Today, however, there
is broader recognition of its potential to revolutionize the industry. It is now widely
accepted that banks that fail to adopt machine learning, or artificial intelligence
more broadly, risk becoming obsolete, much like institutions such as Lehman Broth-
ers and Barings Bank, which failed due to their inability to adapt. There is now a
consensus that AI is essential for enhancing customer experience, reducing opera-
tional costs, managing risks, and staying competitive in a rapidly evolving financial
landscape.4
A final word on quantum technologies: If the historical relationship between finance
and technology has been defined by the collection, storage, and transmission of
information, it is highly likely that the physical nature of that information will play
a crucial role in shaping future developments. Just as the transition from analog
to digital information revolutionized the financial services industry in the late 20th
century, the shift from digital to quantum information promises to be equally, if not
more, transformative.5

5.2 The Race for the First Quantum Computer


The race to build the first practical quantum computer is a global competition, with
tech giants, startups, and research institutions vying for breakthroughs. Companies
like IBM, Google, and others mentioned below are advancing superconducting qubit
technologies, pushing qubit counts and improving error correction. Meanwhile, IonQ
and Pasqal are focusing on trapped-ion and neutral-atom quantum computing, re-
spectively. D-Wave, on the other hand, continues to refine quantum annealing,
offering specialized solutions for optimization problems. Another key factor is the
global race for quantum dominance. The United States, China, the European Union,
and other emerging technological powers are heavily investing in national quantum
strategies, recognizing the transformative potential of this field.
Despite rapid progress, though, fundamental challenges remain—qubit decoher-
ence, error correction, scalability, and hardware reliability still limit quantum sys-
tems from achieving large-scale practical use. Quantum computing is evolving daily
4
For an insightful discussion on the adoption of quantum computing by financial institutions,
read my LinkedIn post and the comments at https://bit.ly/QCBanksAdoption.
5
An interesting periodization of the evolution of fintech is provided by D. W. Arner et al., “The
Evolution of FinTech.” For a detailed discussion on the physics of digital and quantum information,
refer to my second course on quantum computing, cited above.
66 CHAPTER 5. HOW TO GET QUANTUM-READY

and it remains uncertain which approach will ultimately prove the most transfor-
mative. Let us explore some of these technologies and the key players shaping the
field.

Superconducting Qubits
Superconducting qubits use superconducting circuits with Josephson junctions to
create and manipulate quantum states. While they perform well in gate operations,
they require extremely cooling systems that are difficult to achieve. Leading compa-
nies in this field include IBM, Google, Rigetti, and Alibaba. Since this is currently
the most mature quantum computing technology, let us take some time to discuss
it.
IBM is one of the leading companies in superconducting qubits. Its technology
provides qubits with long coherence times and incorporates advanced quantum er-
ror mitigation techniques. The company has developed quantum processors such
as Eagle in 2021, with 127 qubits; Osprey in 2022, with 433 qubits; and Condor in
2023, with 1,121 qubits. Despite the tenfold increase in qubit count, maintaining
high qubit quality as systems scale remains a significant challenge. Recognizing this
challenge, in December 2023, IBM announced the Heron processor, featuring 133
qubits. It was the first in IBM’s new generation of error-mitigated quantum proces-
sors, focusing on improved qubit connectivity and reduced noise rather than simply
increasing the number of qubits. In 2024, the company unveiled the IBM Quantum
Heron R2, a 156-qubit processor. This chip builds upon the Heron architecture,
increasing the qubit count from 133 to 156 and introducing two-level system mit-
igation to further reduce noise. By the end of the decade, IBM plans to deliver a
fully error-corrected system with 200 qubits capable of running 100 million gates.6
Google, one of the major tech companies heavily investing in quantum computing
developments, employs a similar type of superconducting qubits but with a different
architecture. Google’s quantum circuits use a planar layout with nearest-neighbor
coupling, enabling efficient two-qubit gate operations. They focus on quantum error
correction, aiming for logical qubits that can sustain long computations. Google’s
Sycamore processor, which achieved quantum supremacy in 2019, used a 54-qubit
chip to outperform classical supercomputers in a random circuit sampling task (ac-
tually, only 53 qubits were used because one was faulty). In 2024, Google unveiled
its latest quantum processor, Willow, featuring 105 qubits. It achieved in less than
five minutes a task that would take today’s fastest classical supercomputers millions
and millions of years to complete. This was the second time Google achieved quan-
tum supremacy—the only Western company to have reached this goal. Google’s
roadmap includes building a 1-million-physical-qubit system with error correction
by the 2030s.7
Rigetti is a much smaller quantum hardware company, with approximately 150
employees, that also focuses on developing superconducting qubit processors. Its
Aspen-9 processor was announced in 2021 with 32 qubits, and the Aspen-M was
announced in 2023 with up to 80 qubits. Their high gate fidelity for single-qubit
and two-qubit gates has the potential for scalability and improved performance.
Rigetti plans to build quantum processors with up to 1,000 qubits by the end of
the decade, with fidelity above 99% and increasing coherence times. Due to their
6
https://www.ibm.com/quantum/technology
7
https://quantumai.google/quantumcomputer
5.2. THE RACE FOR THE FIRST QUANTUM COMPUTER 67

practical-oriented objectives, their roadmap highlights scalable, high-fidelity quan-


tum processors capable of tackling more practical and complex problems by 2030.
Additionally, Rigetti is focusing on hybrid quantum-classical integrations. Their ap-
proach involves combining quantum processors with classical computing resources
to tackle practical problems.8
Alibaba is another major tech company that focuses on developing quantum hard-
ware using superconducting qubits. They have made significant groundbreaking
contributions with their quantum processors. For example, the Zuchongzhi proces-
sor, with 56 qubits, was able to achieve quantum supremacy in 2020. According to
available information, Alibaba’s quantum processors have reached up to 60 qubits
as of the time of writing. Their roadmap also aims to enhance the fidelity of quan-
tum gates (with goals above 99%) and extend the coherence times of qubits for
more complex computations. Their goal is to achieve practical quantum advantage
by the end of the decade, with applications in areas like optimization and artificial
intelligence.

Trapped-Ion Qubits
In this approach, individual qubits are encoded in the internal energy states, hy-
perfine states, or other quantum states of the ions, and precision lasers are used to
manipulate these states. The most commonly used ions for trapped ion quantum
computing are barium (Ba), calcium (Ca), magnesium (Mg), and ytterbium (Yb).
The concept of using ions trapped in electromagnetic fields for quantum computing
began to take shape by the mid-1990s. However, it wasn’t until the 2010s that
trapped-ion qubits were scaled up to handle multiple qubits, with advancements in
fidelity, coherence, and error correction. Today, trapped-ion quantum technology is
regarded as one of the most promising approaches in quantum computing.
IonQ 9 and Quantinuum 10 are two prominent companies in the field of trapped-
ion quantum computing, each employing different hardware strategies. IonQ has
developed quantum computers with up to 32 physical qubits, while Quantinuum
has achieved up to 20. IonQ’s roadmap aims to reach 64 algorithmic qubits (error-
corrected qubits) by the end of 2025, with a target logical two-qubit gate fidelity
of 99.999%. In contrast, Quantinuum plans to develop a system with 96 physical
qubits and a physical error rate below 5 × 10−4 , and by 2029, they intend to in-
troduce a processor with thousands of physical qubits and hundreds of algorithmic
qubits, targeting a logical error rate between 1×10−5 and 1×10−10 . Both companies
face the challenge of scaling their systems while maintaining error correction, qubit
coherence, and performance as they increase qubit numbers.

Photonic Qubits
In addition to the three cases of quantum supremacy achieved using superconducting
technologies, photonic qubits (also called optical qubits) have also achieved quantum
supremacy.
Photonic qubits encode quantum information using the intrinsic properties of in-
dividual photons, such as polarization. These qubits are generated by single-photon
8
https://www.rigetti.com
9
https://ionq.com
10
https://www.quantinuum.com
68 CHAPTER 5. HOW TO GET QUANTUM-READY

sources, manipulated using beam splitters and phase shifters, and measured with
single-photon detectors. The key advantages of this technology are its low decoher-
ence, fast transmission, and room-temperature operation, making photonic qubits
particularly suited for quantum communication and networking. However, chal-
lenges such as weak photon-photon interactions, photon loss, and reliance on prob-
abilistic gates hinder scalability. Despite these obstacles, companies like PsiQuan-
tum 11 and Xanadu 12 are making significant strides toward large-scale, fault-tolerant
photonic quantum computing systems.
As mentioned above, quantum supremacy using photonic qubits was first demon-
strated in 2020 with the Jiuzhang experiment at the University of Science and Tech-
nology of China. The group was able to solve a problem in minutes that would take
millions of years on the most powerful classical computers. The follow-up Jiuzhang
2.0 experiment in 2021 further validated these results. While groundbreaking, these
experiments are task-specific and, as previously indicated, face ongoing challenges
for potential future applications.

Neutral Atom Qubits


Neutral atom qubits use individual neutral atoms, whose states are manipulated by
highly focused laser beams to perform quantum computations. The most commonly
used atoms for neutral atom quantum computing are alkali metals, such as rubidium
(Rb), cesium (Cs), and sodium (Na). One of the key advantages of this approach
is scalability, as large numbers of atoms can be controlled simultaneously. Achieve-
ments in the field include high-fidelity operations, long coherence times, and success-
ful multi-qubit entanglement. Despite these advancements, challenges remain, such
as slow gate speeds, laser precision issues, and the need for error correction. A lead-
ing company in this technology is Pasqal , founded in 2019 in France by a group of
physicists, including the renowned quantum physicist and Nobel laureate Alain As-
pect. Pasqal has achieved control over more than 100 qubits in its systems (specific
fidelity metrics for this system have not been publicly disclosed). While challenges
persist, neutral atom qubits hold significant promise for future large-scale quantum
computing. According to the official roadmap, they plan to develop a fault-tolerant
quantum computing processor with 128 or more logical qubits by 2028.13

Topological Qubits
In topological qubits, quantum information is stored in the global properties of quan-
tum states within certain materials. The key advantage of topological qubits is their
enhanced robustness to errors, as the information is encoded in the global properties
of the quantum states—specifically in the braiding of exotic particles called anyons,
which are neither fermions nor bosons. These qubits possess properties that enable
them to be isolated and manipulated in a way that makes them resistant to lo-
cal disturbances. This error resilience has the potential to significantly enhance the
scalability and reliability of quantum computers. The leading company in the devel-
opment of topological qubits is Microsoft, which focuses on a specific type of anyon
called Majorana fermions. The main challenges involve not only the theoretical un-
11
https://www.psiquantum.com
12
https://xanadu.ai
13
https://www.pasqal.com
5.3. FINANCIAL INDUSTRY LEADERS 69

derstanding of these objects but also experimental difficulties, such as isolating the
anyons and performing the necessary braiding operations. Despite these challenges,
Microsoft is fully committed to the development of topological qubits, investing
heavily in research to make topological quantum computing a practical technology.14

Quantum Annealers
This is the first time we mention quantum annealers. We have not discussed them
earlier because quantum annealers are not gate-based quantum computers (they are
not structured as quantum circuits). In quantum annealing, a problem is encoded
into the system’s Hamiltonian and the system evolves towards its lowest energy
state, which represents the optimal solution. The underlying physics involves a
quantum phenomenon called the adiabatic process. Quantum annealers are con-
sidered non-universal because they are specifically designed to solve optimization
problems. They excel at solving optimization tasks in fields like logistics, material
science, and finance. D-Wave is a leading company in the development of quantum
annealers, with their latest processor containing 5,000 qubits. However, the fidelity
remains much lower than that of gate-based quantum systems due to noise and de-
coherence. While quantum annealers face the same challenges as other quantum
computing approaches, such as noise, decoherence, and error correction, achieving
reliable results for complex problems remains difficult. Some quantum computing
experts are skeptical about the results obtained by quantum annealers and the po-
tential of the technology for the future.15

5.3 Financial Industry Leaders


If we want to understand the potential impact that quantum computers may have
in the financial sector, what a better place to look at than the bigger actors in the
industry. They want to be sure that when the technology matures, the financial
sector will likely be among the first to adopt quantum-enhanced solutions for these
high-impact applications.
JPMorgan, HSBC, Goldman Sachs, all of them multinational corporations with
valuations of trillions of dollars, are well aware of the catastrophic consequences can
have on their future not tacking the upfront position and taking actions regarding
the new quantum technology. All of them have created their own quantum research
groups and they publish their research. They have invested tens of millions of dollars
and have created research groups with dozens of members from complementary fields
such as finance, physics, engineering, mathematics, and other technical disciplines.16

JPMorgan Chase
JPMorgan is perhaps the most prominent financial institution actively promoting
quantum computing. Its Managing Director and Head of Global Technology Ap-
plied Research has helped establish the firm as a leader in quantum computing for
financial services. He has not only built a strong team of researchers and published
14
https://quantum.microsoft.com
15
https://www.dwavesys.com
16
For an insightful discussion on how small and large banks are adopting quantum computing,
read my LinkedIn post and the comments at https://bit.ly/QCBigvsSmallBanks.
70 CHAPTER 5. HOW TO GET QUANTUM-READY

papers and surveys reviewing the state of the art for the expert community but
is also actively engaged in promoting quantum computing to non-experts in the
financial sector, such as quants and executives. The group’s research has been par-
ticularly focused on quantum computing for portfolio optimization, option pricing,
risk analysis, and machine learning applications such as fraud detection and natural
language processing.17

HSBC
HSBC is also a well-known bank heavily investing in quantum computing for finance.
However, according to available information, the bank focuses more on cybersecu-
rity, particularly on using quantum technologies to ensure the secure storage and
communication of sensitive information, such as customer transactions. Another
area of active research at the bank is fraud detection. Thus, although JPMorgan
and HSBC are two leaders in the quantum computing for finance industry and have
areas of overlap, JPMorgan focuses more on quantum computing solutions for finan-
cial services, such as portfolio optimization and quantum machine learning, while
HSBC appears to prioritize cybersecurity and fraud detection.18

Wells Fargo
Wells Fargo is another leader in quantum computing for financial services and se-
curity. Its areas of research are similar to those of JPMorgan and HSBC, with its
own unique strengths. However, the reason we want to mention it here is different.
The Managing Director and Chief Technology Officer of Advanced Technology at
Wells Fargo has been particularly vocal about the hype surrounding quantum com-
puting and its impact on how financial institutions, from small to large, approach
this technology. He believes that the hardware is still not developed enough, and
that making large investments in quantum computing for financial services at this
stage is not the right decision. He advocates that banks should refrain from making
excessive investments, limit their spending to stay informed about the technology
and new developments, and only make the leap into quantum once there are prac-
tical demonstrations of quantum technology in finance. In his view, banks should
remain frugal in their investments and avoid falling into the trap of hype around the
supposed practical advantages of quantum computing, which, as of today, remain
largely speculative.19

Big financial companies, known as incumbents in financial jargon, strive to protect


themselves not only from their direct competitors but also from Big Tech companies
and the emergence of startups that can disrupt the system. These startups have
the potential to capture a portion of the market share or make incumbents reliant
on their innovations, whether in hardware, software, or specialized services. Early
collaborations between big financial firms and startups have become a common
strategy for the former to integrate new technologies and mitigate risks.
Before delving into the startup landscape, it is important to address the poten-
tial risks that financial incumbents face regarding Big Tech companies, which are
17
https://www.jpmorgan.com/technology/applied-research
18
https://www.hsbc.com/who-we-are/hsbc-and-digital/hsbc-and-quantum
19
Refer to the comments at https://bit.ly/QCBigvsSmallBanks.
5.4. THE STARTUP LANDSCAPE 71

among the largest collectors of information in the world and leaders in quantum
computing research and development. Companies like Google, Amazon, and Meta
(formerly Facebook) have already begun entering the financial services industry, and
the possibility of them expanding their presence more decisively is a real concern
for traditional financial institutions.
The Chinese multinational company Alibaba, actively involved in quantum com-
puting research, is particularly noteworthy. This platform has seamlessly integrated
financial services into its ecosystem, offering payment solutions, lending, and invest-
ment products, thereby transforming how millions of users manage their finances.
Such developments illustrate the disruptive potential Big Tech companies could
bring to the global financial industry.
To conclude, it is worth noting that some major banks have yet to start—or at
least have not made it publicly known—that they are adopting quantum comput-
ing in their research or hiring personnel to work on it. Perhaps these institutions
believe, as historical precedent has sometimes proven, that it is more strategic to
wait until the technology has matured before making the substantial intellectual
and financial investments required to catch up with competitors. However, this
strategy is not without its risks. Delaying adoption could mean falling significantly
behind early adopters who have already established expertise and infrastructure.
On the other hand, investing heavily in a technology that is still several years away
from widespread practical implementation also carries inherent risks. The decision
requires a careful balance between foresight and pragmatism.

5.4 The Startup Landscape


In recent years, the financial industry has seen the emergence of several startups
dedicated to addressing financial challenges, such as portfolio optimization and op-
tion pricing. Due to the confidential nature of the services they provide, specific
details are often not available. However, let us mention a few that have published
their work.

Multiverse Computing
Multiverse Computing was founded in 2019 by a team of financial experts and physi-
cists. Originally established in San Sebastián, Spain, the company has expanded its
presence with offices in Paris, Munich, London, among others. Initially, Multiverse
Computing focused on providing quantum software solutions for the finance industry.
Recognizing that many finance professionals are not well-versed in quantum com-
puting, the company developed Singularity, a software platform that allows users to
implement quantum algorithms through familiar tools like Microsoft Excel, without
requiring prior quantum computing knowledge. Multiverse Computing has collabo-
rated with major financial institutions, including BBVA and Crédit Agricole CIB,
to explore the application of quantum computing in finance. These collaborations
have led to advancements in areas such as portfolio optimization and risk analy-
sis. The company actively publishes its findings in research papers, contributing to
the broader scientific and financial communities. More recently, Multiverse Com-
puting has emphasized the development of quantum-inspired algorithms to enhance
artificial intelligence capabilities. This strategic shift aims to leverage quantum tech-
72 CHAPTER 5. HOW TO GET QUANTUM-READY

nologies to improve AI processes, making them more efficient and effective across
various applications. Over time, Multiverse Computing has broadened its scope to
offer quantum-inspired solutions across various sectors, including energy, manufac-
turing, logistics, biotech, pharmaceuticals, and aerospace.20

Quantum Signals
Much smaller than Multiverse Computing, Quantum Signals focuses exclusively on
quantum computing solutions for the financial sector. Founded in 2024 by two quan-
tum computing experts in finance, the company has, from the beginning, focused
on quantum-inspired solutions aimed at speeding up and improving the accuracy of
artificial intelligence applications.21

AbaQus
AbaQus was founded in 2021 in Vancouver. While detailed information about the
company remains limited, online sources suggest that the company focuses on the
practical implementation of quantum algorithms, providing access to cloud-based
quantum services, experimenting with quantum-inspired optimization, and integrat-
ing hybrid quantum-classical approaches into existing financial workflows.22

QuantFi
Founded in 2019 by American and French business partners, QuantFi is a startup
that offers quantum computing solutions for financial institutions. They engage in
training initiatives to help financial professionals understand quantum computing
and its potential impact—similar to what we saw with AbaQus. Additionally, they
conduct joint research projects with institutions to explore quantum computing ap-
plications in finance.23

It is important to exercise caution when evaluating the achievements of software


developments in quantum computing for finance. In addition to the well-known
lack of transparency in machine learning results (where many claimed outcomes are
presented without adequate data or processing details), the financial sector faces
the additional challenge that large companies, as well as startups, are often unwill-
ing to disclose their complete methodologies for strategic and competitive reasons.
Furthermore, regulations frequently prohibit the disclosure of sensitive information
about customers, adding another layer of complexity. These factors make it diffi-
cult—and sometimes purely speculative—to assess the actual level of development
of software solutions proposed in the market for addressing financial sector prob-
lems. This lack of transparency can hinder informed evaluations and the broader
adoption of promising technologies.
As in almost any area of scientific research, achieving progress requires a balance
among the interests of companies, the ethical handling of customer data, and adher-
ence to scientific principles. Such a balance would allow the scientific community to
critically assess and validate the factual advancements in quantum computing for
20
https://multiversecomputing.com
21
https://www.quantumsignals.ai
22
https://www.abaqus.dev
23
https://www.quantfi.com
5.5. A SAFE ROADMAP TO THE QUANTUM FUTURE 73

finance.

5.5 A Safe Roadmap to the Quantum Future


Quantum computing is expected to be a game-changer for industries like finance in
the near to mid-term future. While the development of this technology is still in its
early stages and significant work remains, as quantum technology matures, it will
enable faster and more accurate solutions that classical computers cannot match.
In this context, financial institutions that have already adopted or plan to adopt
quantum solutions early are likely to gain a significant competitive edge, particularly
in areas where computational speed and precision are critical. Examples include
optimizing financial portfolios, enhancing Monte Carlo simulations, and identifying
patterns in the vast data sets collected by financial institutions.
While it is true that the few quantum computers available today are expensive and
largely experimental, the assumption that small and mid-sized financial institutions
are destined to fall behind the larger players is inaccurate. In fact, several actionable
steps can be taken by smaller institutions to remain competitive—and in some cases,
even gain an advantage over bigger financial incumbents.
The first strategy that comes to mind, and can be implemented today, is to ed-
ucate the workforce on quantum computing and shift the mindset of the entire
team toward embracing the upcoming revolution of quantum computing in finance.
This transition will undoubtedly require specialized skills that are not commonly
found in financial organizations. Therefore, hiring personnel who can bridge the
gap between traditional and quantum approaches to solving financial problems (as
discussed above) is essential. Early preparation will allow institutions to build a
team of experts, even if small, to align their strategies with quantum technologies,
particularly focusing on algorithms tailored to financial challenges. This proactive
approach will ensure a smoother transition as fully quantum solutions become avail-
able.
Given the high cost of the limited quantum computers available, several technol-
ogy companies offer cloud-based quantum computing services.24 These platforms
enable individuals and institutions to experiment with quantum algorithms with-
out requiring an investment in expensive quantum hardware. By leveraging these
services, small and mid-sized financial institutions can begin exploring quantum
applications tailored to their unique needs.
A strategy commonly employed by large financial companies, but also accessible
to smaller institutions, is partnering with universities, research centers, and fintech
startups that are open to collaborations for research purposes. By engaging in these
initiatives, small institutions can gain early access to emerging quantum tools and
expertise, which can enhance their understanding of both research and the market.
In addition to the direct financial applications of quantum computing, small and
mid-sized financial institutions can also leverage it for logistical purposes. The
speedup gained from quantum machine learning in optimization problems can help
these institutions streamline operations and reduce costs.
In summary, by upskilling and hiring a quantum computing workforce, utilizing
cloud-based quantum services, and collaborating in quantum research efforts with
24
See details above, 4.3.
74 CHAPTER 5. HOW TO GET QUANTUM-READY

educational institutions or fintech startups, small financial organizations can benefit


from quantum computing without the resources of a major bank. This approach
will enable them to prepare for a future in finance shaped by quantum technologies.
Chapter 6

Conclusion

In this guide, I have sought to strike a balance between technical and practical as-
pects, emphasizing the complexities of applying quantum computation techniques
to the financial services industry. An inherently interdisciplinary subject, it encom-
passes quantum mechanics, computer science, mathematical finance, programming,
technological research and business innovation.
Before concluding with actionable steps you can take to prepare for the next major
technological revolution in the financial industry, let us recap some of the main points
covered in this short book.
Quantum computation, by leveraging the principles of quantum mechanics that
govern nature, aims to build quantum computers whose efficiency and precision
will surpass current digital computers by hundreds or even millions of orders of
magnitude.
Among the many applications this groundbreaking technology will have in society,
the financial industry is expected to be one of the first to benefit from it. By acceler-
ating and improving conventional computational techniques—such as optimization,
Monte Carlo simulations, and machine learning—quantum computers promise to
transform the future of finance. They will enhance the way financial organizations
provide services, refine predictive strategies, and optimize investment methods, all
while ensuring compliance with increasingly stringent regulations imposed by gov-
ernments and regulatory bodies.
To become “quantum ready,” small and mid-sized financial institutions must act
proactively before it is too late. Although workable quantum computers are likely
several years away, this time should be used to prepare staff and familiarize them
with the most pressing advancements in the field. This preparation will not only en-
sure a smoother transition but also provide a competitive edge in a rapidly evolving
technological landscape.
If you are interested in learning how to implement quantum technologies in your
own organization, please do not hesitate to contact me. I would be glad to help
you navigate this exciting frontier and position your institution for success in the
quantum era.

75
Index

k-Means Clustering algorithm, 36 Circuit diagram, 8


k-Nearest Neighbors (kNN) Cirq, 59
algorithm, 30 Classification, 30
n qubit, 10 Clustering centroid, 36
n-qubit gate, 11 CNOT gate, 11
Computational basis states, 9
Activation function, 31 Computational error, 8, 12
Adiabatic process, 69 Cost (loss) function, 31
Adversarial agent, 58 Cost Hamiltonian, 47
Adversarial models, 57 Cost layer, 52
Adversarial Reinforcement Learning Covariance matrix, 19
(ARL), 58 Credit card fraud, 16
Algorithm, 7 Credit card fraud detection, 38
Alibaba, 67 Credit risk assessment, 16
AMazon Braket, 59 Credit score, 16, 37
Amplitude encoding, 53 Credit scoring, 37
Angle encoding, 54
Ansatz state, 46, 51, 52 D-Wave, 69
Anti-money laundering, 16 Data, 28
Anyons, 68 Decoherence, 12
Delta (∆), 24
Backpropagation, 33
Delta-neutral portfolio, 25
Basis encoding, 53
Derivatives, 15
Bias, 31
Digital (classical) computer, 8
Binary classification, 30
Dimensionality Reduction, 35
Binary digit (bit), 8
Discriminator, 57
Binary portfolio optimization
problem, 20 Efficient circuit, 8
Bit-flip error, 12 Expected portfolio return rate, 19
Bit-flip quantum repetition code, 13
Black-Scholes equation, 26 Fault-tolerant quantum computer, 14
Boolean (binary) model of Fault-tolerant quantum era, 14
computation, 7 Feature, 28
Boolean algebra, 7 Feature vectors, 28
Boolean circuit, 8 Financial services, 16
Boolean function, 8 Fintech, 64
Brownian motion, 23
Gamma (Γ), 25
Call option, 15 Generative Adversarial Networks
Circuit complexity, 8 (GANs), 57

77
78 INDEX

Generative Machine Learning, 57 Native quantum machine learning


Generator, 57 algorithms, 56
Google, 66 ndarray, 41
Greeks, 24 Neural Networks, 31
Neutral atom qubits, 68
Hedging, 24 NISQ era, 14
Heuristic algorithms, 14 Node (Neural Network), 31
Hidden layer, 31 NumPy, 41
Hidden state, 34
Hybrid quantum-classical algorithms, Observable, 11
14, 46 Optical qubits, 67
Optimization, 17
IBM, 66 Option, 15
Input, 8 Output, 8
Input layer, 31 Output layer, 31
Interest rate (risk-free), 26 Pandas, 42
IonQ, 67 Parameterized circuit, 46
Parity check, 13
Jiuzhang experiment, 68
Pasqal, 68
Jupyter notebook, 41
Pauli gates, 10
PennyLane, 60
Label, 28
Perceptron, 31
Lasso regression, 30
Photonic qubits, 67
Layer, 31, 52
Physical qubit, 13
Learning agent, 58
Portfolio, 15
Least-Squares Error (LSE) method,
Portfolio management, 39
27
Portfolio optimization, 15
Linear regression, 30
Portfolio optimization problem, 18
Log stock return rate, 24
Portfolio return rate, 18
Logical gate (Boolean), 8
Principal Component Analysis
Logical gate (quantum), 9
(PCA), 35
Logical qubit, 13
PsiQuantum, 68
Long Short-Term Memory (LSTM), Put option, 16
35 PyQuil, 59
Loss (cost) function, 31
Qiskit, 58
Machine learning (ML), 27 Quantinuum, 67
Majorana fermions, 68 Quantum k-Means Clustering, 57
Matplotlib, 42 Quantum advantage, 14
Mean, 19 Quantum algorithm, 9
Mean Squared Error (MSE), 33 Quantum annealing computers,
Mean-variance model, 19 quantum annealers, 69
Microsoft, 68 Quantum Approximate Optimization
Mixer Hamiltonian, 51 Algorithm (QAOA), 49
Mixer layer, 52 Quantum Basic Linear Algebra
Model of computation, 7 Subroutines (QBLASs), 56
Modern portfolio theory, 19 Quantum circuit, 9
Money laundering detection, 38 Quantum circuit model of
Multiclass classification, 30 computation, 9
INDEX 79

Quantum computation, 7 SciPy, 42


Quantum computer, 7, 9 Set of universal quantum gates, 11
Quantum gate, 10 Sharing weights, 34
Quantum Generative Adversarial Sigmoid functions, 32
Networks, 58 Single qubit, 9
Quantum measurement, 11 Stochastic process, 22
Quantum model of computation, 9 Stock return rate, 18
Quantum Neural Networks (QNN), 56 Stock weight, 18
Quantum Principal Component Strike price, 15
Analysis (QPCA), 57 Structured data, 28
Quantum supremacy, 14, 66, 67 Superconducting qubits, 66
Qubit (quantum binary digit), 9 Supervised Learning, 29
QUBO problem, 18
Test data, 29
Random walk, 22 Theta (Θ), 26
Rectified Linear Unit (ReLU), 32 Topological qubits, 68
Recurrent Neural Networks (RNNs), Training data, 29
33 Transaction fraud detection, 38
Regression, 30 Trapped-ion qubits, 67
Reinforcement Learning (RL), 58
Relative phase gate, Phase shift gate, Universal Approximation Theorem,
10 32
Ridge regression, 30 Unstructured data, 28
Rigetti, 66 Unsupervised Learning, 35
Risk, 19 Vanishing gradient problem, 34
Risk assessment, 37 Variance of a portfolio return rate, 19
Risk aversion coefficient, 20 Variational Quantum Eigensolver
Risk management, 16 (VQE) algorithm, 46
Rotation gate, 11 Volatility, 26
Rotational encoding, 54
Weights (Neural Networks), 31
Samples, 28
Scikit-learn, 43 Xanadu, 68

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy