Skip to main content

View on GitHub

Open this notebook in GitHub to run it yourself
This notebook covers the implementation of the Direct Amplitude Loading 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 correlates 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=) 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

Considering the time delta between the starting date (t0t_0) and the maturity date (tt), express the return value RiR_i for the ii-th asset as Ri=μi+yiR_i = \mu_i + y_i where μi=(tt0)μ~i\mu_i= (t-t_0)\tilde{\mu}_i, being μ~i\tilde{\mu}_i the expected daily log-return value. It can be estimated by considering the historical time series of log returns for the ii-th asset. yiy_i is obtained through the dot product between the matrix L\mathbf{L} and the standard multivariate Gaussian sample: yi=Δxklikdk+xminkliky_i = \Delta x \cdot \sum_kl_{ik}d_k + x_{min} \cdot \sum_k l_{ik} Δx\Delta x is the Gaussian discretization step, xminx_{min} is the lower Gaussian truncation value, and dk[0,2m1]d_k \in [0,2^m-1] is the sample taken from the kk-th standard Gaussian. likl_{ik} is the i,ki,k entry of the matrix L\mathbf{L}, defined as L=C(tt0)\mathbf{L}=\mathbf{C}\sqrt{(t-t_0)}, where C\mathbf{C} is the lower triangular matrix obtained by applying the Cholesky decomposition to the historical daily log-return correlation matrix:

Direct Method

The direct exponential amplitude loading encodes in f~\tilde{f} the following function: f~(x)={eax^,if x2Plog(K)bbKe(b+axmax),if x2P<log(K)bb\begin{equation} \tilde{f}(x)= \begin{cases} e^{-a\hat{x}}, & \text{if } \frac{x}{2^P} \geq \frac{\log(K) -b'}{b}\\ Ke^{-(b'+ ax_{max})}, & \text{if } \frac{x}{2^P} < \frac{\log(K) -b'}{b} \end{cases} \end{equation} where x^\hat{x} is the binary complement of xx (x^=xxmax\hat{x}=x-x_{max}) and xmax=2R1x_{max}=2^R-1, the maximum value that can be stored in the x|x\rangle register. For loading eax^e^{-a\hat{x}}, the r|r\rangle is initialized to all zeros. One controlled rotation for each qubit is performed. The rotation angles are θi=2arccos(ea2i)\theta_i = 2\arccos \left({\sqrt{e^{-a2^i}}}\right). All the probabilities of getting a 0R|0\rangle^{\otimes{R}} in the r|r\rangle are then collected by a multi-controlled X (MCX) gate and stored in the 1|1\rangle state of a target qubit.
Output:

Iterative Quantum Amplitude Estimation (IQAE) Algorithm

Output:

Post-process

Add a term to the post-processing function: E[max(ebz,Keb)]ebK=E[max(eax^,Kebaxmax)]eb+axmaxK\begin{equation} \begin{split} &\mathbb{E} \left[\max\left(e^{b \cdot z}, Ke^{-b'}\right) \right] e^{b'} - K \\ = &\mathbb{E} \left[\max\left(e^{-a\hat{x}}, Ke^{-b'-ax_{max}}\right) \right]e^{b'+ ax_{max}} - K \end{split} \end{equation}

Run Method

Output:

Assertions

References

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