Skip to main content

View on GitHub

Open this notebook in GitHub to run it yourself
This notebook covers the implementation of the Integration Method for the rainbow option presented in [1]. In finance, a crucial aspect of asset pricing pertains to derivatives. Derivatives are contracts whose value is contingent upon another source, known as the underlying. The pricing of options - a specific derivative instrument - involves determining the fair market value (discounted payoff) of contracts that afford their holders the right, though not the obligation, to buy (call) or sell (put) one or more underlying assets at a predefined strike price by a specified future expiration date (maturity date). This process relies on mathematical models, considering variables such as current asset prices, time to expiration, volatility, and interest rates.

Data Definitions

The problem inputs:
  • NUM_QUBITS: the number of qubits representing an underlying asset
  • NUM_ASSETS: the number of underlying assets
  • K: the strike price
  • S0: the arrays of underlying asset prices
  • dt: the number of days to the maturity date
  • COV: the covariance matrix that correlate to the underlyings
  • MU_LOG_RET: the array containing the mean of the log return of each underlying

Gaussian State Preparation

Encode the probability distribution of a discrete multivariate random variable WW taking values in {w0,..,wN1}\{w_0, .., w_{N-1}\} describing the asset prices at the maturity date. The number of discretized values, denoted as NN, depends on the precision of the state preparation module and is consequently connected to the number of qubits (n=n=NUM_QUBITS) according to the formula N=2nN=2^n: i=0N1p(wi)wi\sum_{i=0}^{N-1} \sqrt{p(w_i)}\left|w_i\right\rangle

Sanity Check

To avoid meaningless results, the process must stop if the strike price KK is greater than the maximum value reacheable by the assets during the simulation. In this case, the payoff is 00, so there is no need to simulate:

Maximum Computation

Precision Utils

Affine and Maximum Arithmetic Definitions

Integration Method

The comparator collects the probabilities g(r)g(r) of r|r\rangle state until r|r\rangle register is lower than x|x\rangle: r=02R1g(r)xrrx=x[r=0xg(r)r1+r=x2R1g(r)r0]\begin{equation} \begin{split} &\sum_{r=0}^{2^R-1}{\sqrt{g(r)}}|x\rangle|r\rangle|r\leq x\rangle \\ = &|x\rangle \otimes \left[ \sum_{r=0}^{x}{\sqrt{g(r)}} |r\rangle |1\rangle + \sum_{r=x}^{2^R-1}{\sqrt{g(r)}} |r\rangle |0\rangle \right] \end{split} \end{equation} Collecting the probability to have rxr\leq x, define the function: h~(x)=r=0xg(r)\begin{equation} \tilde{h}(x)=\sum_{r=0}^{x}g(r) \end{equation} Evaluating the probability to get a 1|1\rangle results in x=02R1h~(x)\sum_{x = 0}^{2^R-1}{\tilde{h}(x)}. To obtain a given function h~\tilde{h}, choose a proper function g(r)g(r). The g(r)g(r) for r=0r=0 value must therefore be: g(0)={~h}(0)g(0) = \tilde\{h\}(0) and for all the other rr: g(r)=h~(r)h~(r1)g(r) = \tilde{h}(r)-\tilde{h}(r-1)
Output:

Iterative Quantum Amplitude Estimation (IQAE) Algorithm

Output:

Post-process

Add a term to the post-processing function: E[max(ea(x+1)1ea(xmax+1)1c+1ea,Keb)]ebK=E[max(ea(x+1)1ea(xmax+1)1,Kebceac)]ceb+ebeaK\begin{equation} \begin{split} \mathbb{E} \left[\max\left(\frac{e^{a(x+1)} - 1}{e^{a(x_{max} +1)}-1}c + \frac{1}{e^a} , Ke^{-b'}\right)\right] e^{b'} - K \\ =\mathbb{E} \left[\max\left(\frac{e^{a(x+1)} - 1}{e^{a(x_{max} +1)}-1}, \frac{Ke^{-b'}}{c} - \frac{e^{-a}}{c}\right)\right]ce^{b'} + e^{b'}e^{-a} - K \end{split} \end{equation}

Run Method

Output:

Assertions

References

[1] Francesca Cibrario et al., Quantum Amplitude Loading for Rainbow Options Pricing. Preprint.