Professional Documents
Culture Documents
Quantum Computational Finance: Monte Carlo Pricing of Financial Derivatives
Quantum Computational Finance: Monte Carlo Pricing of Financial Derivatives
measure. Any α 6= r allows for arbitrage under the In the case of complex payoff functions and/or complex
measure P. When α > r, one can make a profit above asset price dynamics, options prices cannot be solved
the market rate r by investing in the stock, and when analytically and one often resorts to Monte Carlo
α < r one can make a profit by short selling the stock. evaluation. Nevertheless, analytical solutions as above
Pricing of derivatives is performed under a probability can be used for benchmarking Monte Carlo simulations.
measure where the drift of the stock price is exactly the Finally, note that there is a dynamical equation of motion
market rate r. This pricing measure is denoted by Q in for the options price Πt in the interval 0 ≤ t ≤ T , which is
contrast to the original measure P. given by a partial differential equation. Such an equation
More formally, the probability measure Q is defined is used in practice for ‘hedging’, i.e. safeguarding during
such that the discounted asset price is a martingale, the time 0 ≤ t ≤ T while the option is active against
i.e. the discounted expected value of the future stock eventual payouts. In this work we do not consider such a
price is the present day stock price itself. The martingale differential equation but focus on the present-day options
property is given in this context by price Π ≡ Π0 .
probability distribution is known, or can be obtained These elements are now combined into a simple
from calibrating to market variables. Sample from this quantum algorithm to obtain the expectation value. First
risk-neutral probability distribution a market outcome, apply the algorithm A:
compute the asset prices given that market outcome,
n
then compute the option payoff given the asset prices. 2X −1
n
Averaging the payoff over multiple samples obtains A|0 i = ax |xi, (18)
an approximation of the derivative price. Assume a x=0
European option on a single benchmark asset and let
where |0n i denotes the n qubit register with all qubits in
the true option price be Π and Π̂ be the approximation
the state |0i. Then perform the rotation of an ancilla via
obtained from k samples. Assume that the random
R
variable of the payoff f (ST ) is bounded in variance,
i.e. V[f (ST )] ≤ λ2 . Then the probability that the price P2n −1
x=0 ax |xi|0i (19)
estimation Π̂ is away from the true price is determined P2n −1 p p
by Chebyshev’s inequality [22] → x=0 ax |xi( 1 − v(x)|0i + v(x)|1i) =: |χi.
(b)
ȁ𝜒ۧ Initial state
(a) ȁ𝜓ۧ
Final state
𝑉ȁ𝜒ۧ
𝑄ȁ𝜓ۧ
2𝜃
𝛾 −𝑆ȁ𝜓ۧ
Intermediate
Q ⇔ F Z F † V F Z F † V state
𝜃
2𝜃 − 𝛾
ȁ𝜒 ⊥ ۧ
(c) (d)
Preparing |χi controlled amplitude amplification
|0i ... 0.05
|0i ...
|0i ...
A n−1 0.04
|0i R Q Q2 ... Q2
|0i ...
... 0.03
|0i
|0i ...
0.02
|0i H • 0.01
|0i H •
.. .. QF T −1 .. 0.00
. . . -4 -2 0 2 4
|0i H • x
FIG. 2. Using amplitude estimation for the quantum Monte Carlo pricing of financial derivatives. (a) The n + 1 qubit phase
estimation unitary is written in terms of F := R(A ⊗ I2 ), and the simple rotation unitaries Z := I2n+1 − 2|0n+1 ih0n+1 | and
V := I2n+1 − 2I2n ⊗ |1ih1|. (b) A visualization of the action of Q := US, with S = VUV and U = FZF † , on an arbitrary state
|ψi (red) in the span of |χi and V|χi. First, the action of −S on |ψi is to reflect along V|χi, resulting in the intermediate −S|ψi
(amber). Then, −U acts on −S|ψi by reflecting along |χi. The resultant state Q|ψi (green) has been rotated anticlockwise by
an angle 2θ in the hyperplane of |χi and |χ⊥ i. (c) The phase estimation circuit. Here, A encodes the randomness by preparing
a superposition in |xi, while R encodes the random variable into the |1i state of an ancilla qubit according to Eq. (17). The
output after both steps is the multiqubit state |χi. Amplitude estimation then proceeds by invoking phase estimation to encode
the rotation angle θ in a register of quantum bits that are measured to obtain the estimate θ̂. (d) For pricing a European call
option, the superposition prepared by A (or equivalently G in Eq. (35)) is a discretization of the normal distribution in x with
a fixed cutoff (e.g. c = 4), approximating the Brownian motion of the underlying asset. In this case, R encodes the call option
payoff in Eq. (5).
angles φ and θ. Note that our expectation value can be Note that −S reflects across V|χi and leaves V|χi itself
retrieved via unchanged. The transformation
1 − 2µ = cos(θ/2). (24) Q := US = UVUV (27)
The task becomes to measure θ. We now define a performs a rotation by an angle 2θ in the two-dimensional
transformation Q that encodes θ in its eigenvalues. First, Hilbert space spanned by |χi and V|χi. Figure 2 (a)
define the unitary reflection shows the breakdown of Q into its constituent unitaries
and Fig. 2 (b) illustrates how Q imprints a phase of 2θ
U := I2n+1 − 2|χihχ|, (25)
via the reflections just discussed. The eigenvalues of Q
which acts as U|χi = −|χi and U|χ⊥ i = |χ⊥ i for are e±iθ with corresponding eigenstates |ψ± i [15]. The
any orthogonal state. Note that −U reflects across |χi task is to resolve these eigenvalues via phase estimation,
and leaves |χi itself unchanged. This unitary can be as shown in Fig. 2 (c).
implemented as U = FZF † , where F † is the inverse of For phase estimation of θ [32], we require the
F and Z := I2n+1 − 2|0n+1 ih0n+1 | is the reflection of the conditional application of the operation Q. Concretely,
computational zero state. Similarly, define the unitary we require
for an arbitrary n qubit state |ψi. Phase estimation that uses O (log 1/δ) copies of the state |χi, uses U for a
then proceeds in the following way, see Fig. 2 (c). Take number of times proportional to O (t log 1/δ) and outputs
a copy of |χi by applying F to a register of qubits in an estimate µ̂ such that
|0n+1 i. Then prepare an additional m-qubit register in
E[v(A)] 1
!
the uniform superposition via the Hadamard operation
p
H |µ̂ − E[v(A)]| ≤ C + 2
t t
m
2 −1
⊗m m 1 X
H |0 i|χi = √ |ji|χi. (29) with probability at least 1 − δ, where C is a universal
2m j=0 constant. In particular, for any fixed δ > 0 and any
such that 0 < ≤ 1, to produce an estimate µ̂ such that
Then perform the controlled operation Qc to obtain with probability at least 1− δ, |µ̂ − E[v(A)]|
p ≤ E[v(A)],
m
2 −1 it suffices to take t = O (1/( E[v(A)]) . To achieve
1 X
√ |jiQj |χi. (30) |µ̂ − E[v(A)]| ≤ with probability at least 1 − δ, it suffices
2m j=0 to take t = O (1/).
One can show that |χi = √12 (|ψ+ i + |ψ− i) is the This theorem is a direct application of amplitude
expansion of |χi into the two eigenvectors of Q estimation via Theorem 1. The success probability of
corresponding to the eigenvalues e±iθ [15]. An inverse 8/π 2 of amplitude estimation can be improved to 1 − δ
quantum Fourier transformation applied to Eq. (30) by taking the median of multiple runs of Theorem 1, see
prepares the state Appendix F, Lemma 6. Theorem 2 can be generalized to
random variables with bounded variance as follows.
m
2X −1
α+ (x)|xi|ψ+ i + α− (x)|xi|ψ− i. (31) Theorem 3 (Mean estimation with bounded variance
x=0 [22]). Let there be given a quantum circuit A. Let v(A)
be the random variable corresponding to v(x) when the
The |α± (x)|2 are peaked where x/2m = ±θ̂ is an outcome x of A is measured, such that V[v(A)] ≤ λ2 .
m-bit approximation to ±θ. Hence, measurement of the Let the accuracy be < 4λ. Take U and |χi as in
|xi register will retrieve the approximations ±θ̂. The Theorem 2. There exists a quantum algorithm that uses
detailed steps are shown in Appendix F. O (log(λ/) log log(λ/))
copies of |χi and uses U for a
These results can be formalized with the following number of times O (λ/) log3/2 (λ/) log log(λ/) and
theorems.
estimates E[v(A)] up to additive error with success
Theorem 1 (Amplitude estimation [10]). There is a probability at least 2/3.
quantum algorithm called amplitude estimation which
takes as input: one copy of a quantum state |χi, a unitary Theorem 3 can be proved by employing Theorem
transformation U = I −2|χihχ|, a unitary transformation 2. We proceed by sketching the proof, and refer the
V = I − 2P for some projector P , and an integer t. The interested reader to the detailed treatment in [22]. To
algorithm outputs â, an estimate of a = hχ|P |χi, such show Theorem 3, the bounded-variance random variable
that v(A) is related to a set of random variables with outputs
p between [0, 1] and then the estimates of the mean of
a(1 − a) π 2 each of these random variables are combined to give
|â − a| ≤ 2π + 2
t t the final estimate. This can be done in three steps.
First, the random variable v(A) can be approximately
with probability at least 8/π 2 , using U and V t times each. standardized by subtracting an approximation to the
mean and dividing by the known variance bound λ2 ,
This theorem can be used to estimate expectation
to obtain a random variable v 0 (A). Second, v 0 (A) can
values. Given the cosine relationship in Eq. (24), it is
be split into positive and negative parts by using the
natural to start with [0, 1] bounded expectation values.
functions fmin (x) = min{x, 0} and fmax (x) = max{x, 0}.
Theorem 2 (Mean estimation for [0, 1] bounded (Coincidentally, these function are similar to the call and
functions [22]). Let there be given a quantum circuit A put option payoff functions.) This defines new random
on n qubits. Let v(A) be the random variable that maps variables B< = −fmin (v 0 (A)) and B> = fmax (v 0 (A)),
to v(x) ∈ [0, 1] when the bit string x is measured as the both taking on only values ≥ 0. These random variables
output of A. Let R be defined as can be rescaled and combined to give the desired random
p p variable.
R|xi|0i = |xi( 1 − v(x)|0i − v(x)|1i). As the third step, both positive random variables
B<,> =: B can be split into multiple auxiliary random
Let |χi be defined as |χi = R(A ⊗ I2 )|0n+1 i. Set variables with outputs between [0, 1] and each of these
U = I2n+1 − 2|χihχ|. There exists a quantum algorithm random variables is estimated by Theorem 2. This is
7
done by defining the functions for 0 ≤ a < b [−∞, ∞] → [−xmax , xmax ] and discretize this interval
n
( with
√2 points, where n is an integer. Here, xmax =
1 x if a ≤ x < b, O T , as a few standard deviations are usually enough
fa,b (x) = (32)
b 0 otherwise.
to capture the normal distribution and reliably estimate
which take on values in [0, 1]. Now the auxiliary random the options price. The discretization points may be
variables f0,1 (B), f1,2 (B), f2,4 (B), f4,8 (B) and so forth defined as xj := −xmax +j∆x, with ∆x = 2xmax /(2n −1)
can be defined which are all taking values in [0, 1]. and j = 0, . . . , 2n − 1. Define the probabilities pj =
P2n −1
Theorem 2 can be used to estimate the mean of each pT (xj )/C, with the normalization C = j=0 pT (xj ).
of these random variables. It can be shown that only This process is illustrated in Fig. 2 (d). According to
a small number dlog(λ/)e of these auxiliary random Ref. [33], there exists a quantum algorithm G (which
variables are needed to estimate the mean of random takes on the role of A in the previous section) such that
variable B with final error . This estimation makes we can prepare
use of the bounded-variance property which leads to the n
2X −1
distribution tails contributing only a small error. n √
The resource count of Theorem 3 is justified as G|0 i = pj |ji. (35)
follows. For an estimation with accuracy it can be j=0
We can now go through the steps of the quantum where Õ (·) suppresses polylogarithmic factors. This
Monte Carlo algorithm. Sec. IV assumes availability quantity can be considered the analogue of the classical
of R with a real-valued function v(x). Such a number of Monte Carlo runs [15, 22]. The required
rotation can be directly implemented in some cases number of quantum steps is quadratically better than
[35].
pHere, we invokepthe controlled
rotation R|ji|0i = the classical number of steps in Eq. (15), or the naive
|ji 1 − ṽ(xj )|0i + ṽ(xj )|1i , with the discretized quantum case in Eq. (22).
options payoff function ṽ(x). See Appendix D for an
implementation of this rotation by using an auxiliary VI. ASIAN OPTION PRICING
register of qubits and the circuit for the options payoff.
The steps are similar to before,
Up to this point, we have discussed the quantum Monte
n
2X −1 q Carlo pricing of derivatives via the illustrative example of
G|0n i = p(xj )|ji (39) the European call option. This call option can be priced
j=0 analytically in the Black-Scholes-Merton framework, thus
n
2X −1 q MC methods are in principle not required. Another
→ p(xj )|ji (40) family of options is the so-called Asian options, which
j=0 depend on the average asset price before the maturity
q q date [30].
1 − ṽ(xj )|0i + ṽ(xj )|1i =: |χi.
Definition 4 (Asian options). The Asian call option
payoff is defined as
Measuring the ancilla in the state |1i, we obtain the
expectation value f (AT ) = max{0, AT − K}, (45)
n
2X −1 where K is the strike price and T the maturity date. The
µ = hχ|(I2n ⊗ |1ih1|)|χi = pT (xj )ṽ(xj ). (41) arithmetic mean option value is defined via
j=0
L
1X
This expectation value µ, assuming it can be measured Aarith
T = Stl , (46)
L
exactly, determines the option price EQ [v(WT )] to l=1
10−1
2.2
10−3 2.1
Error
10−4
2.0
10−5
FIG. 3. Scaling of the error in classical and quantum MC FIG. 4. Ratio of the quantum to classical scaling exponents.
methods (defined in Eq. (57)) plotted against number of The quantum scaling is obtained by fitting the simulations
MC steps for a European call option in log-log scale with results to the power law in Eq. (58), while the classical scaling
S0 = $100, K = $50, r = 0.05, σ = 0.2, T = 1, and exponent is taken to be −0.5. Results are plotted with varying
D = 24. Subscripts C and Q denote the errors from classical strike price K (in dollars) and fixing other parameters to
MC and quantum phase estimation, respectively. Evidently, be the same as in Fig. 3. An almost quadratic speed up is
the error for the quantum algorithm (with a fitted slope of obtained for all chosen values of K.
ζQ = −0.982) scales almost quadratically faster than the
classical MC method (which has ζC = −0.5). The theoretical
upper bound on the error in quantum algorithm is shown by assumed that the distribution of the underlying random
the solid green curve, which corresponds to ζQ = −1. variables, i.e. the martingale measure, is known and the
corresponding quantum states can be prepared efficiently.
In addition, we assume efficient computability of the
the corresponding θ = 2 arccos(1 − 2Π/S0 ) via Eq. (24) derivative payoff function. Under these assumptions, we
for use in the phase estimation. In addition, we have exhibit a quadratic speedup in the number of samples
also plotted a fit of the quantum error to the power law required to estimate the price of the derivative up to a
given in Eq. (58) resulting in the scaling exponent to given error: if the desired accuracy is , then classical
be ζQ = −0.982. It is evident that the scaling exponent methods show a 1/2 dependency in the number of
of quantum phase estimation is almost twice the classical samples, while the quantum algorithm shows a 1/
one. Indeed, the green solid curve shows the upper bound dependency.
on the errors in quantum estimation defined as [15], see As an exemplary case, we have discussed European
also Appendix F: call options for which analytical solutions are known.
! ! In addition, we have discussed Asian options, which
θ̂ π θ̂
Q := cos + − cos , (59) in the arithmetic averaging case require Monte Carlo
2 kQ 2 methods to be priced. Our approach can in principle
be applied to any derivative which has a payoff that
where θ̂ is the phase estimated via the quantum is a function that can be efficiently broken down into
algorithm. This upper bound has a scaling exponent elementary arithmetic operations within a quantum
of −1 and hence straightforwardly demonstrates the circuit, and which can also depend on an average over
quadratic speedup in the number of steps for phase multiple time windows. Future work will extend these
estimation to a given error. discussions to the complex payoff functions often used at
To test the robustness of the quadratic speedup in leading financial institutions, as well as addressing more
scaling, we vary the strike price and plot the ratio of complicated stochastic models.
the quantum to the classical scaling exponents ζQ /ζC Monte Carlo simulations play a major role in managing
in Fig. 4. We obtain an almost quadratic advantage in the risk that a financial institution is exposed to
estimation overhead for all strike prices. Similar tests by [3]. Especially after the financial crisis of 2008-9,
varying other parameters also show a robust quadratic sophisticated risk management is increasingly important
quantum speedup of the Monte Carlo estimation. to banks internally and also required by government
regulators [38, 39]. Such risk analysis falls under the
umbrella of so-called valuation adjustments (VA), or
VIII. DISCUSSION AND CONCLUSION XVA [38, 39], where X stands for the type of risk
under consideration. An example is CVA, where the
In this work, we have presented a quantum algorithm counterparty credit risk is modeled. Such a valuation
for the pricing of financial derivatives. We have adjusts the price of the derivative based on the risk that
11
the counterparty in that financial contract runs out of However, one is not restricted to such a setting but
money. can use other universal quantum computational models
XVA calculations are a major computational effort such adiabatic quantum computation or continuous
for groups (‘desks’) at financial institutions that handle variable (CV) quantum computation. In the continuous
complex derivatives such as those based on interest variable setting, instead of qubits one has oscillators
rates. For complex financial derivatives, such risk which in principle have infinite dimensional Hilbert
management involves a large amount of Monte Carlo spaces. In this setting, preparing Gaussian states
simulations. Different Monte Carlo runs assess the price for the probability distributions can be done in a
of a derivative under various scenarios. Determining the straightforward manner, instead of employing the
risk of the complete portfolio of a desk often requires relatively complicated preparation routine according to
overnight calculations of the prices according to various Grover-Rudolph. Investigating the promising advantages
risk scenarios. Quantum computers promise a significant of the CV setting in a financial context in more detail will
speedup for such computations. In principle, overnight be left for future work.
calculations could be reduced to much shorter time scales
(such as minutes), which would allow a more real time
analysis of risk. Such close-to real time analysis would
allow the institution to react faster to changing market ACKNOWLEDGMENTS
conditions and to profit from trading opportunities.
The qubit model for universal quantum computing We acknowledge Juan Miguel Arrazola, John C. Hull,
was employed here to provide a succinct discussion. Ali Najmaie and Vikash Ranjan for insightful discussions.
[1] J. C. Hull, Options, futures, and other derivatives [18] E. Knill, G. Ortiz, and R. Somma, Physical Review A
(Prentice Hall, 2012). 75, 012328 (2007).
[2] S. Shreve, Stochastic Calculus for Finance II: [19] R. D. Somma, S. Boixo, H. Barnum, and E. Knill,
Continuous-Time Models (Springer-Verlag, 2004). Physical Review Letters 101, 130504 (2008).
[3] H. Föllmer and A. Schied, Stochastic Finance: An [20] D. Poulin and P. Wocjan, Physical Review Letters 102,
Introduction in Discrete Time (Walter de Gruyter, 2004). 130503 (2009).
[4] F. Black and M. Scholes, Journal of Political Economy [21] A. Chowdhury and R. D. Somma, Quantum Information
81, 637 (1973). and Computation 17, 0041 (2017).
[5] R. C. Merton, The Bell Journal of Economics and [22] A. Montanaro, Proc. R. Soc. A 471, 0301 (2015).
Management Science 4, 141 (1973). [23] B. E. Baaquie, Quantum finance (Cambridge University
[6] R. Eckhardt, Los Alamos Science 15, 131 (1987). Press, 2004).
[7] P. Glasserman, Monte Carlo Methods in Financial [24] M. L. de Prado, Advances in financial machine learning
Engineering (Springer-Verlag, 2003). (John Wiley & Sons, 2018).
[8] L. K. Grover, in STOC ’96 Proceedings of the 28th [25] I. Halperin, arXiv preprint arXiv:1712.04609 (2017).
Annual ACM Symposium on the Theory of Computing [26] G. Rosenberg, P. Haghnegahdar, P. Goddard, P. Carr,
(ACM, New York, 1996), pp. 212–219. K. Wu, and M. L. de Prado, IEEE Journal of Selected
[9] C. Dürr and P. Hoyer, arXiv preprint quant-ph/9607014 Topics in Signal Processing 10, 1053 (2016).
(1996). [27] N. Elsokkary, F. S. Khan, D. La Torre, T. S. Humble,
[10] G. Brassard, P. Hoyer, M. Mosca, and A. Tapp, and J. Gottlieb, Tech. Rep., Oak Ridge National
Contemporary Mathematics 305, 53 (2002). Lab.(ORNL), Oak Ridge, TN (United States) (2017).
[11] S. Heinrich, Journal of Complexity 18, 1 (2002). [28] G. Rosenberg, 1QBit white paper:
[12] A. Ambainis, SIAM Journal on Computing 37, 210 https://1qbit.com/whitepaper/arbitrage/ (2016).
(2007). [29] F. Longstaff and E. Schwartz, Review of Financial
[13] M. Szegedy, in FOCS ’04 Proceedings of the 45th Annual Studies 14, 113 (2001).
IEEE Symposium on Foundations of Computer Science [30] A. Kemna and A. Vorst, Journal of Banking and Finance
(IEEE Computer Soc., Washington, D.C., 2004), pp. 14, 113 (1990).
32–41. [31] W. Schoutens, Lévy Processes in Finance: Pricing
[14] P. Wocjan, C.-F. Chiang, D. Nagaj, and A. Abeyesinghe, Financial Derivatives (Wiley, 2003).
Phys. Rev. A 80, 022340 (2009). [32] M. A. Nielsen and I. Chuang, Quantum computation
[15] G. Xu, A. J. Daley, P. Givi, and R. D. Somma, AIAA and quantum information (Cambridge University Press,
Journal 56, 687 (2018). Cambridge, 2002).
[16] V. Giovannetti, S. Lloyd, and L. Maccone, Physical [33] L. Grover and T. Rudolph, arXiv preprint
Review Letters 96, 010401 (2006). quant-ph/0208112 (2002).
[17] F. Magniez, A. Nayak, J. Roland, and M. Santha, in [34] IEEE standard for Floating-Point Arithmetic, IEEE Std
STOC ’07 Proceedings of the 39th Symposium on the 754-2008 pp. 1–70 (2008).
Theory of Computing (ACM, New York, 2007), pp. [35] G. H. Low and I. L. Chuang, Phys. Rev. Lett. 118,
575–584. 010501 (2017).
12
[36] N. Killoran, J. Izaac, N. Quesada, V. Bergholm, M. Amy, s(t, x). To obtain the differential, expand this function
and C. Weedbrook, arXiv preprint arXiv:1804.03159 to second order in dx and use the solution St to obtain
(2018).
[37] D. S. Steiger, T. Häner, and M. Troyer, Quantum 2, 49 ∂s ∂s 1 ∂2s 2
dx + O dt2 , dx3 (A4)
ds(t, x) = dt + dx +
(2018). ∂t ∂x 2 ∂x2
[38] A. Green, XVA: Credit, Funding and Capital Valuation σ2 σ2
Adjustments (John Wiley & Sons, 2015). = (α − )s(t, x)dt + σs(t, x)dx + s(t, x)dx2 .
2 2
[39] P. J. Zeitsch, Journal of Mathematical Finance 7, 239
(2017). Using dx = dWt and dx2 = dWt2 = dt from Result 2
[40] V. Vedral, A. Barenco, and A. Ekert, Phys. Rev. A 54, leads to the differential
147 (1996).
[41] D. Beckman, A. N. Chari, S. Devabhaktuni, and dSt = St αdt + St σdWt . (A5)
J. Preskill, Phys. Rev. A 54, 1034 (1996).
[42] R. V. Meter and K. M. Itoh, Phys. Rev. A 71, 052320
(2005).
[43] T. G. Draper, S. A. Kutin, E. M. Rains, and K. M. Svore, Next, we show the martingale property of the
Quantum Information and Computation 6, 351 (2006). discounted stock price.
[44] Y. Takahashi, S. Tani, and N. Kunihiro, Quantum
Information and Computation 10, 0872 (2010).
Lemma 2. Under the Q measure, the stock price is a
[45] M. K. Bhaskar, S. Hadfield, A. Papageorgiou, and martingale, i.e.
I. Petras, Quantum Information and Computation 16,
S0 = e−rT EQ [ST ]. (A6)
0197 (2016).
[46] N. Wiebe and M. Roetteler, Quantum Information and
Proof.
Computation 16, 134 (2016).
[47] R. Cleve, A. Ekert, C. Macchiavello, and M. Mosca, σ2 T
variance of the BSM price for the call option. First note = 2πT e 2 . (A12)
the following result.
Result 2. (informal) For the infinitesimal Brownian Via a similar calculation we can obtain the price for
increment it holds that the call option.
dWt2 = dt (A1) Lemma 3. The Black-Scholes price for the European call
option is given by
This result can be reasoned by the variance of the
Π = S0 Φ(d1 ) − Ke−rT Φ(d2 ). (A13)
Brownian increment being proportional to the time
interval of the increment. Next, we show the solution Proof. To compute the price we start at
to the following stochastic differential equation.
Π = e−rT EQ [f (ST )]. (A14)
Lemma 1. The stochastic differential equation
Note that for the call option we can write
dSt = St αdt + St σdWt , (A2)
f (ST ) = max{0, ST − K} = (ST − K)1ST ≥K , (A15)
is solved by
where 1x is the indicator function on the set x. Using
σWt +(α− σ2
2
)t
the solution for ST we have
St = S0 e . (A3)
− K)1
2
f (W̃T ) = (S0 eσW̃T +(r−σ /2)T
(log SK0 −(r− σ22 )T ) .
Proof. We show this result by finding the differential dSt W̃T ≥ σ
given St . The quantity St can be seen as a function (A16)
13
Compute the part involving the strike price K Putting it all together we obtain
VQ [f (ST )] = EQ [f (ST )2 ] − EQ [f (ST )]2
" # Z
∞ (A29)
E 1 2
(log −(r− )T )
K σ = (log K −(r− σ2 )T ) dx p(x) 2
W̃T ≥
S0
σ
2 S0
√
2 = e(2r+σ )T S02 Φ(d3 ) − 2KerT S0 Φ(d1 )
σ T
VQ [f (ST )]
Z x Z x
1 y2 We obtain an upper bound as =
Φ(x) = dy p(y) := √ dy e− 2 . (A18) 2
−∞ 2π −∞ O poly(S0 , erT , eσ T , K) .
Proof. The variance is exactly computable. First note |ψi = αi |ii, (B2)
2
i=0
that ST2 = S02 e2σW̃T +(2r−σ )T . We have
EQ [f (ST )2 ] = EQ [(ST − K)2 1ST ≥K ] (A22) with αi ∈ C and |ii = |i1 i ⊗ |i2 i ⊗ . . . ⊗ |in i the vector
of basis states over n qubits such that [i1 , i2 , . . . , in ] is
= EQ [(ST − 2ST K + K )1ST ≥K ].
2 2
the length n binary representation of i. The probability
The last two terms were calculated analogously in the that the n qubits are in state |ii is equal to |αi |2 , where
P2n −1 2
Black-Scholes price already. They are i=0 |αi | = 1. Note that the tensor product symbol ⊗
denotes the joining of two quantum systems (e.g. qubits)
2KEQ [ST 1ST ≥K ] = 2KerT S0 Φ(d1 ) (A23) in quantum mechanics.
EQ [K 2
1ST ≥K ] = K Φ(d2 ). 2
(A24) Isolated quantum system evolve according to unitary
transformations, i.e. so that |ψi goes to |ψ 0 i = U |ψi
The first term is EQ [ST2 1ST ≥K ] which is proportional to for some unitary U (which satisfies U † U = U U † = I,
" # where † is the conjugate transpose and I is the identity
EQ e2σW̃T 1 (log SK0 −(r− σ22 )T ) (A25) operator). Unitaries can be controlled externally and
W̃T ≥ σ also applied to collections of multiple qubits, as is often
Z ∞ √ the case in this work. A standard library of one- and
= (log K −(r− σ2 )T ) dx p(x)e2σ T x (A26) two-qubit unitaries can also be applied, and are often
S0 2
√
σ T called quantum gates [32] in analogy to the gates used
2
= e2σ T
Φ(d3 ). (A27) used for binary logic operations, e.g. AND, OR, etc. This
work uses the Hadamard gate H, which acts on one qubit
with with the transformation
3σ 2
1 S0 1 1
d3 = √log + r+ T . (A28) |0i → √ (|0i + |1i) , |1i → √ (|0i − |1i) . (B3)
σ T K 2 2 2
14
The inverse quantum Fourier transform QF T −1 is also in the computational basis state given by the xi , i.e. |ai =
utilized in this work, which acts to perform an inverse |x0 , x1 , . . . , xm i. For real numbers 0 ≤ r < 1, we can use
discrete Fourier transform on the amplitudes αj , i.e. m bits bi , i = 0, . . . , m − 1 such that
taking the corresponding state |ji to
b0 b1 bm−1
n
2X −1 r= + + · · · + m =: [.b1 , b2 , . . . , bm−1 ]. (C2)
1 2 4 2
√ ω jk |ki, (B4)
2n k=0 The accuracy is 1/2m . The qubit encoding of the real
n number is where |ri refers to a m qubit register prepared
with ω = e−2πi/2 . Unitaries acting on one or more in the computational basis state given by the bi , i.e. |ri =
qubits can also be controlled by another qubit, e.g. so |b0 , b1 , . . . , bm−1 i. For signed integers or reals, we have
that the unitary is enacted if the control qubit is in state an additional sign quantum bit |si.
|1i and the unitary is not enacted if the control qubit is in Any operation performed on a classical computer can
state |0i. One important example is the controlled-NOT be written as a transformation from n to m bits, that
(CNOT) gate, which swaps the state of a qubit from |0i is F : {0, 1}n → {0, 1}m . A central result of reversible
to |1i (and vice versa) whenever a control qubit is in computing is that the number of input and output bits
state |1i. Its extension is the Toffoli gate, which swaps can be made the same and the function F can be mapped
the state of a qubit from |0i to |1i (and vice versa) only to a function F 0 : {0, 1}n+m → {0, 1}n+m which is given
when two control qubits are in state |1i. by F 0 (x, y) = (x, y⊕F (x)). F 0 is a reversible function and
Compositions of unitaries acting on multiple qubits, a permutation. This permutation can be realized with a
prepared in various initial states, can be created to form circuit that consist only of negation and Toffoli gates. If
quantum circuits. These quantum circuits are able to F is efficiently computable then the circuit depth is at
carry out quantum algorithms that may perform a task most a polynomial in n + m. The classical circuit then
faster than on a classical device, e.g. Shor’s algorithm immediately translates into a quantum circuit consisting
[32]. The unitary nature of quantum algorithms means of bit flip σz operations and Toffoli gates. The Toffoli
that all quantum circuits are reversible. Reversibility gate can be broken down into a series of two qubit
has implications for the structure of quantum circuits, CNOTs and Hadamard and T gates.
and marks a departure from the more familiar classical We now review how basic arithmetic operations can be
circuits. For example, the AND gate is not reversible performed on a quantum computer. Using the following
because a single bit is returned from which the two input basic gates, a number of arithmetic operations can be
bits cannot be inferred in all cases. constructed [40]:
Quantum circuits can be represented pictorially using
a quantum circuit diagram, as is the case in Fig. 2 (a) and • (C3)
1 1
(c). Here, each qubit is represented by a horizontal line, 2 SU M = 2 •
with time moving from left to right. The unitaries are 3 3
applied to various qubits by drawing a box over the qubit
lines, with control from another qubit symbolized by a
black dot and line connecting to the box. Measurements 1 1 • (C4)
on the qubits are represented by the symbol. 2 = 2 • •
3 CY 3 • •
Finally, the CNOT gate is written as • , with the 4 4
upper qubit acting as the control and the lower qubit
where CY represents the ‘carry’ operation. Composing
acting as the target, while the Toffoli gate is represented
these gates can achieve addition, multiplication,
as • , with control from the top two qubits and target
• exponentiation and other operations. Numerous other
works provide circuits for these operations with improved
on the bottom qubit. performance and lower gate requirements [41–46].
There exists a quantum circuit that performs the
Appendix C: Quantum circuits for arithmetic
addition modulo N. Given two integers 0 ≤ a, b < N
operations we can construct a circuit of the form
There also exists a quantum circuit that performs the Appendix E: Preparation of the quantum state
multiplication encoding the sampling distribution
which performs
( for any a ≤ b = 0, . . . , 2n − 1, a ≤ b. Thus for m =
|a, s, ai if |si = |0i 1, . . . , n we can efficiently compute the probabilities
|a, s, 0i → . (C11)
|a, s, 0i if |si = |1i
(k+1)2n−m −1
Here, the sign bit is used as a controller and a controlled (m)
X
pk = pj , (E3)
addition is performed if the sign bit is positive. There j=k2n−m
exists a circuit for mapping the Brownian motion to the
stock price, which consists of the basic operations shown with k = 0, . . . , 2m − 1.
above, The quantum algorithm goes as follows [33]. For m <
|xi |xi (C12) n, assume we have prepared the state
S(σ, r, t) 2
|0i |eσx+(r−σ /2)t i. m
2X −1 q
(m) (m)
Combining the stock price with the max function, we |ψ i= pk |ki. (E4)
obtain the circuit for mapping the Brownian motion k=0
outcome to the payoff for the European call option
We would like to show by induction that we can prepare
|xi |xi (C13) the state
CALL(K, σ, r, T )
|0i |ṽeuro (x)i.
2m+1
X−1 q
with ṽeuro (x) ≡ ṽeuro (x, K, σ, r, t) the bit approximation |ψ (m+1) i =
(m+1)
pk |ki. (E5)
of the payoff function Eq. (36). k=0
|ψ (m) i|0i|0i →
(m)
pk |ki|θk i|0i
(m)
(E8) → √ (e−i 2 2 + e−i 2 2 e+i 2 2 )|0i
2
k=0 θ k−1 θ 0 k−1 θ k−1
m
2X −1 q + (e−i 2 2 − e−i 2 2 e+i 2 2 )|1i . (F7)
(m) (m)
→ pk |ki cos θk |0i (E9)
From this, the measurement probabilities are given by
k=0
[15]
(m)
+ sin θk |1i 1 1
(k)
+ cos 2k θ − π[.bk+1 , . . . , bm ] ,
(m+1)
P0 =
≡ |ψ i. (E10) 2 2
(k) (k)
(m) P1 = 1 − P0 . (F8)
In the second step the register |θk i was uncomputed.
These probabilities can be sampled to obtain an m-bit
estimate of θ.
Appendix F: Phase estimation In the main text and Fig. 2, we obtain the output
probability distribution for the best m-bit estimate for
This Appendix shows the basic steps for phase the phase θ using standard m-qubit phase estimation,
estimation and provides an analysis of errors and the as typically discussed in the literature [32, 47]. This
success probability. presents a coherent, controlled version of the procedure
First, the illustrative example of the single-qubit phase above. Using the eigenstate |ψθ i associated with the
estimation is presented, then we review the multi-qubit eigenvalue θ, an m-qubit register, and the operation Qc ,
setting. We follow closely references [15, 32, 47]. Eq. (28), we can perform
The single-qubit phase estimation is for demonstration m
2X −1
purposes since it uses a known phase θ. Here, we apply
|yiQy |ψθ i. (F9)
the single-qubit gate
y=0
θ
Uz = e−i 2 σz (F1) In the m-qubit register, we obtain
for varying powers. In this treatment, the single qubit is (|0i + ei2π2
m−1
θ
|1i)(|0i + ei2π2
m−2
θ
|1i) × (F10)
effectively simulating an m-qubit register. To obtain the i2πθ
least significant bit of the phase, the first step is to apply × · · · × (|0i + e |1i)
M/2 m
2X −1
Uz , where M is such that M ≥ 2π/ and M = 2m for
an integer m: = ei2πθy |yi.
y=0
(|0i + |1i) 1 θM θ M
√ → √ e−i 2 2 |0i + e+i 2 2 |1i (F2) After applying the inverse Quantum Fourier transform
2 2
we have the state
1 −i θ M θ M
→ e 2 2 + e+i 2 2 |0i+ m
2 −1 2 −1 m
2 1 X X −i2π xy
θ M
θ M e 2m ei2πθy |xi. (F11)
e−i 2 2 − e+i 2 2 |1i (F3) 2m x=0 y=0
1 θM θM
→ 2 cos |0i + 2i sin |1i . Let θ̂ be the m-bit approximation of θ and θ = θ̂ + δ.
2 4 4 Using these definitions leads to
The measurement probabilities are m
2 −1 2 −1 m
1 X X −i2π xy
e 2m ei2π(θ̂+δ)y |xi =
(m) θM (m) θM
P0 = cos2 , P1 = sin2 . (F4) 2m x=0 y=0
4 4
m m
2 −1 2 −1
k/2 1 X X i2π (2m θ̂−x)y
We now use Uz for k = m − 1, . . . , 1 to estimate the e 2m ei2πδy |xi (F12)
remaining bits of the phase, 2m x=0 y=0
m
1 1 θ k−1 θ k−1
2X −1
√ (|0i + |1i) → √ e−i 2 2 |0i + e+i 2 2 |1i =: αθ (x)|xi. (F13)
2 2
x=0
1 −i θ 2k−1 θ 0 k−1 θ k−1
→√ e 2 |0i + e−i 2 2 e+i 2 2 |1i . (F5)
2 The estimate θ̂ has the amplitude
0 k−1
The last step applies a phase e−iθ 2 to |1i given by the 2m −1 m
1 − ei2πδ2
m 1 X i2πδy 1
known bits, using the identity αθ (2 θ̂) = m e = m ,
2 y=0 2 1 − ei2πδ
0 k−1
e−iθ 2 = e−iπ[.bk+1 ,...,bm ] . (F6) (F14)
17
using the geometric series. This occurs with probability Note that by definition the bit estimate θ̂ ≤ π − 2 , thus,
m 2 m 2 with |θ̂ − θ| ≤ , we have θ̂+θ
4 ≤
2θ̂+
4 ≤ π2 . Thus
1 1 − ei2πδ2 1 1 − ei2πθ2
P (θ̂) = m = m .
1 − ei2πδ
! !
4 4 1 − ei2π(θ−θ̂) θ̂ + θ 2θ̂ +
(F15) sin ≤ sin . (F21)
4 4
One can efficiently sample from this bit-string
distribution via the individual bit probabilities given in
Also
Eqs. (F4) and (F8).
We now provide an error analysis of phase estimation.
!
θ̂ − θ
We follow closely the discussion in previous references. sin ≤ sin . (F22)
4 4
The phase estimation algorithm provides an estimate θ̂
that is accurate with , thus we have
We now discuss increasing the probability of success for
|θ̂ − θ| ≤ . (F16)
phase estimation. The probability of observing the best
The quantity of interest is the expectation value, which m-bit approximation is lower bounded by 8/π 2 > 0.81,
is related to the phase θ from Eq. (24) as from Eq. (F15) [32]. To boost this success probability,
multiple runs of phase estimation can be performed.
θ The median of these multiple runs will have a higher
1 − 2µ = cos . (F17) success probability [15, 22, 48], as will be shown now.
2
Let θ̂1 , . . . , θ̂D be the results of D independent runs
We would like to determine a bound for the accuracy of of phase estimation. The new estimate is the median
this expectation value, i.e. determine θ̂ = Median(θ̂1 , . . . , θ̂D ).
|µ̂ − µ|. (F18) Lemma 6 ([48]). Let the desired accuracy be > 0.
Let the probability that each sample falls outside the
First, we can use the Taylor expansion
cos((θ ± )/2) = accuracy, i.e. |θ̂j − θ| ≥ , be 0 < δ < 1/2. Then the
cos θ/2−(±) sin(θ/2)+O 2 to arrive at the first-order probability that the median is inaccurate is bounded by
bound p D
! pf ≤ 21 2 δ(1 − δ) .
θ̂
|µ̂ − µ| ≤ O sin . (F19) The proof is provided in [48]. The confidence/success
2 2
probability is defined as c := 1−pf . Taking theplogarithm
More generally, we can show the following. of the failure probability, log 2(1−c) ≤ D log 2 δ(1 − δ),
leads to
Lemma 5. Assume |θ̂−θ| ≤ , 0 ≤ θ̂ < π, and 0 < ≤ 1. p
Then | log 1 − c| ≥ D| log 2 δ(1 − δ)|, (F23)
Proof. Use the trigonometric identity for the difference D = O (| log 1 − c|) , (F24)
between cosines
if 0 < δ < 1/2 is a constant. Hence, for a confidence of c
| cos θ̂/2 − cos θ/2| = 2| sin((θ̂ + θ)/4) sin((θ̂ − θ)/4)|, one needs at most O (| log 1 − c|) independent repetitions
| cos((θ̂ + )/2) − cos θ̂/2| = 2| sin((2θ̂ + )/4) sin(/4)|. of phase estimation.