Classiq / classiq-library

The Classiq Library is the largest collection of quantum algorithms, applications. It is the best way to explore quantum computing software. We welcome community contributions to our Library 🙌
https://platform.classiq.io
MIT License
267 stars 94 forks source link

"Implement IQAE for Option Pricing Using Classiq SDK in Jupyter Notebook" #181

Closed AbdullahKazi500 closed 5 days ago

AbdullahKazi500 commented 1 week ago

PR Description

This pull request implements Iterative Quantum Amplitude Estimation (IQAE) for option pricing using Classiq SDK within a Jupyter Notebook. The notebook provides a comprehensive explanation and implementation of IQAE for estimating the fair price of financial derivatives. fixes #37

Some notes

review-notebook-app[bot] commented 1 week ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

AbdullahKazi500 commented 1 week ago

Hi @orsa-classiq and @Nadav138 I gave the option pricing issue a try for the Unitary fund Hack bounty and made a PR Addressing the issue a detailed Jupyter Notebook demonstrating the implementation of Iterative Quantum Amplitude Estimation (IQAE) for option pricing using Classiq SDK. It includes theoretical explanations, mathematical formulations, and practical steps, aiming to provide a clear understanding of quantum algorithms in financial modeling. I wanted to have a review on the PR Since it is the last day of Unitary fund hackathon The organizers have made an announcement regarding the same

Hackers and Maintainers,

We have received a lot of requests over the past few days to extend the review timeline for PRs that are almost ready but not yet. As such, we are extending the review time period by 1 week to June 26th.

Maintainers, if there are PRs that are very close to finalized and significant work has been done to warrant the bounty, please assign and close the unitaryHACK issue by June 26th and you can continue working with the participant until the code is ready to merge. 

Thank you, everyone! Congratulations on all the hard work put in so far! 
AbdullahKazi500 commented 1 week ago

Nice @AbdullahKazi500 ! Unfortunately, this code is not really implementing the required algorithm. For example:

  1. you don't use the variables (mu, sigma) in generating the model
  2. in quantum option pricing, you need load the distribution and the payoff within the grover's state preparation function. here you just used hadamard transform
  3. The european-call payoff is not computed correctly

Also, the notebook is not according to the requested standards. Please read them carefully, and the mentioned paper (to better understand the algorithm), then try to resubmit :)

Hi @orsa-classiq I have addressed some of the comments since the UF Hackathon is closing I would like to know if there are minor changes needed here that can close this issue

orsa-classiq commented 1 week ago

Sorry, it is still not close to be correct or in the required standard

AbdullahKazi500 commented 1 week ago

Sorry, it is still not close to be correct or in the required standard

what are the changes that needs to be done

orsa-classiq commented 1 week ago

There are a lot, it is just not good enough. But lets start with the following mistakes:

If the following commit won't show much improvement I will have to close it

AbdullahKazi500 commented 1 week ago

There are a lot, it is just not good enough. But lets start with the following mistakes:

  • grover operator is not implemented correctly
  • you don't really implement the option pricing algorithm for european options
  • you didn't remove the FunctionInput calls

If the following commit won't show much improvement I will have to close it

Hi are these the only changes also any reference on the correct implementation of grover operator because I have been referring classiq docs for this

AbdullahKazi500 commented 1 week ago

There are a lot, it is just not good enough. But lets start with the following mistakes:

  • grover operator is not implemented correctly
  • you don't really implement the option pricing algorithm for european options
  • you didn't remove the FunctionInput calls

If the following commit won't show much improvement I will have to close it

also for the European call function should it made custom or adapted from the previous code