Feedback assisted quantum annealing for hedging in portfolio optimization
View Demo
·
Report Bug
·
Request Feature
Table of Contents
We propose a novel feedback assisted quantum annealing algorithm for hedging where the optimal portfolio at a future time can be obtained by incorporating information contained in the covariance matrix as well as from other sources such as simulations and machine learning algorithms. This can potentially make the use of quantum annealing for hedging more reliable and improve the balance optimality of asset allocation for a fixed future time.
The algorithm starts by using quantum annealing to find a probability distribution over optimal asset allocation vectors based only on the covariance matrix. A subset of the elements of the asset allocation vector is then randomly sampled and compared with the optimal portfolio at a future time - the latter obtained via alternate means described above. If the marginal probability of the sampled subset of assets lies above a user-defined threshold we accept the entire asset allocation vector as the optimal prediction for that time. In the other case, we repeat quantum annealing with the same covariance matrix as before but now with biasing (using local-fields on the annealer) on the sampled variables to set them to desired values. This process can be shown to converge in linear time which is when the algorithm stops and provides us with an optimal asset allocation vector at a fixed future time.
This project contains the program that implements the above approach using the Dwave Ocean SDK and IBM Qiskit along with a Django based UI that allows you to select the inputs and call either of the subroutines to calculate the optimal porfolio.
- Python
sudo apt install python3
- Create a virtual environment
python3 -m venv /path/to/new/virtual/environment source /path/to/new/virtual/environment/bin/activate
- Clone the repo inside the virtual environment
cd /path/to/new/virtual/environment git clone https://github.com/Ashish0z/portfolio_generator_QuantYantriki.git
- Install required python modules
cd /path/to/new/virtual/environment/portfolio_generator_QuantYantriki pip install -r requirements.txt
- Run Development Server
python3 manage.py runserver
- Open your browser and go to http://127.0.0.1/8000
This project was made by Team QuantYantriki for Quantum Science and Technology Hackathon 2022
Team Member Details:
- Siddartha Santra
- Ashish Patel
- Shashwat Chakraborty
- Aneesh Kamat
Distributed under the MIT License. See LICENSE.txt
for more information.