Code Monkey home page Code Monkey logo

aneeshkamat4 / qaoa-portfolio-generator Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 4.9 MB

A portfolio generator developed by QuantYantriki for the QSTH 2022 - a quantum hackathon organized by the Quantum Ecosystems and Technology Council of India (QETCI). It utilizes quantum annealing and quantum approximate optimization algorithms using a feedback-based metaheuristic that incorporates classical optimization tools to improve solutions.

License: MIT License

Python 61.90% JavaScript 19.95% CSS 7.82% HTML 10.33%
hedging optimization qaoa quantum-annealing

qaoa-portfolio-generator's Introduction

Contributors Forks Stargazers Issues MIT License


Minimum Risk Portfolio Generator

Feedback assisted quantum annealing for hedging in portfolio optimization
View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contributors
  6. Contact
  7. Acknowledgments

About The Project

Usage

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.

(back to top)

Built With

  • DWave Ocean SDK
  • IBM QISKIT
  • Django
  • JQuery

(back to top)

Getting Started

Prerequisites

  • Python
    sudo apt install python3

Installation

  1. Create a virtual environment
    python3 -m venv /path/to/new/virtual/environment
    
    source /path/to/new/virtual/environment/bin/activate
  2. Clone the repo inside the virtual environment
    cd /path/to/new/virtual/environment
    git clone https://github.com/Ashish0z/portfolio_generator_QuantYantriki.git
  3. Install required python modules
    cd /path/to/new/virtual/environment/portfolio_generator_QuantYantriki
    pip install -r requirements.txt

Running the UI

  1. Run Development Server
    python3 manage.py runserver
  2. Open your browser and go to http://127.0.0.1/8000

(back to top)

Contributors

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

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

qaoa-portfolio-generator's People

Contributors

ashish0z avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

rehmatschawla

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.