View on GitHub
Open this notebook in GitHub to run it yourself
Rainbow Options with Integration
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 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 correlate 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 (NUM_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
Integration Method
The comparator collects the probabilities of state until register is lower than : Collecting the probability to have , define the function: Evaluating the probability to get a results in . To obtain a given function , choose a proper function . The for value must therefore be: and for all the other :Output:
Iterative Quantum Amplitude Estimation (IQAE) Algorithm
Output:
Post-process
Add a term to the post-processing function:Run Method
Output: