View on GitHub
Open this notebook in GitHub to run it yourself
Data Definitions
The problem inputs:NUM_QUBITS: the number of qubits representing an underlying assetNUM_ASSETS: the number of underlying assetsK: the strike priceS0: the arrays of underlying asset pricesdt: the number of days to the maturity dateCOV: the covariance matrix that correlates to the underlyingsMU_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 taking values in describing the asset prices at the maturity date. The number of discretized values, denoted as , depends on the precision of the state preparation module and is consequently connected to the number of qubits () according to the formula :Sanity Check
To avoid meaningless results, the process must stop if the strike price is greater than the maximum value reacheable by the assets during the simulation. In this case, the payoff is , so there is no need to simulate:Maximum Computation
Precision Utils
Affine and Maximum Arithmetic Definitions
Considering the time delta between the starting date () and the maturity date (), express the return value for the -th asset as where , being the expected daily log-return value. It can be estimated by considering the historical time series of log returns for the -th asset. is obtained through the dot product between the matrix and the standard multivariate Gaussian sample: is the Gaussian discretization step, is the lower Gaussian truncation value, and is the sample taken from the -th standard Gaussian. is the entry of the matrix , defined as , where is the lower triangular matrix obtained by applying the Cholesky decomposition to the historical daily log-return correlation matrix:Brute-Force Amplitude Loading Method
This type of amplitude loading has an exponential scale, and is therefore used as a “sanity check” method for validating the result from the direct method and integration method that are part of the paper [1].Output:
Output:
Iterative Quantum Amplitude Estimation (IQAE) Algorithm
Output:
Output:
Post-process
Add a term to the post-processing function:Run Method
Output: