Skip to content

luan521/quantum-portfolio-optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum Portfolio Optimization

This repository provides a quantum approach to portfolio optimization using the Quantum Approximate Optimization Algorithm (QAOA) and compares its results with a classical approach for optimizing the Sharpe ratio.

The analysis includes four assets over the period from 2016-01-01 to 2021-09-20:

  • BRKM5.SA
  • ITUB4.SA
  • VALE3.SA
  • KLBN4.SA

Quantum Approach

  • notebooks/qaoa.ipynb
    • Formulates a cost function based on expected returns, risk (covariance matrix), and portfolio constraints
    • Defines the optimization problem as a Quadratic Unconstrained Binary Optimization (QUBO) problem
    • Construct the Hamiltonian for the cost function, such that its ground state represents the optimal solution
    • Simulates the QAOA algorithm for various circuit depths

Classical Approach

  • notebooks/classical_optimization.ipynb
    • Maximizes the Sharpe ratio of a portfolio using classical optimization techniques.
    • Computes the optimal portfolio weights based on expected returns and covariance matrix.

Comparison

Both approaches are applied to the same dataset of selected assets, and their results are compared to evaluate the effectiveness of QAOA in portfolio optimization.

The QAOA algorithm was designed to select two assets to include in the optimal portfolio, while the classical approach returns a weighted optimal portfolio. The results demonstrate that the two assets selected by QAOA align with the first two assets identified by the classical approach.

Reference

This implementation was inspired by the paper Quantum Finance: um tutorial de computação quântica aplicada ao mercado financeiro by Askery Canabarro et al., which introduces QAOA for portfolio optimization using assets from the Brazilian stock market. The same assets and time period (January 2016 to September 2021) were used to validate the quantum approach, achieving results consistent with those presented in the paper.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published