Closed
Description
Using quantum computers for pricing financial derivatives has the promise for quadratic speedup.
In this issue we will improve the current option-pricing notebook, implementing algorithm for european call options, based on the paper Option Pricing using Quantum Computers. The goal is to use native language constructs instead of the current construct_finance_model
black box function in the existing implementation.
to complete this issue, follow the following steps:
- Open the option pricing notebook and go over the code and explanations.
- Remove the usage of the
construct_finance_model
,function_input
in the model creation. You will later on use native language functions Instead. - We use a log-normal distribution for the asset. You can use the current parameters, such as
num_qubits
,mu
,sigma
,threshold
. A bonus is to derive them from financial parameters. Use theprepare_state
function on calculated lognormal distribution with the parameters, and some truncation value (5 sigma). This can be computed classically and passed to theprepare_state
as an array of probabilities. - For the payoff, use the
*=
syntax, see amplitude loading example. Pay attention for needed remapping of the variables and normalization, as done in the paper. Here, in difference from the article, the implementation is exact and not approximated. - For the amplitude estimation, you can use the
iqae
execution scheme, that uses the iterative amplitude estimation, and the built-ingrover_operator
. See quantum_counting for example. - Verify the execution results of the algorithm with a classical computation. Add
assert
validation to the code. - Wherever needed, add Markdown cells with explanations and mathematical formulations.
- After finishing with the notebook, make sure you keep the
write_qmod(qmod, "option_pricing.qmod")
line. Run the notebook, and you will automatically update the .qmod file for this example. - Make sure the notebook looks well, does not have any typos / mistakes, and is running properly.
- Follow the contribution guidelines to open a pull request.
If you have any questions or comments, you can ask them here in the issue, or in our slack community, and the Classiq team will be happy to assist.
Happy quantum coding!