Skip to main content

Portfolio optimization

Real-world investment decisions involve multiple, often conflicting, objectives that needs to be balanced. Primary goals typically revolve around maximizing returns while minimizing risks. At the same time, one might want to require additional constraints such as demanding a minimum carbon footprint reduction. Finding a portfolio that balances these objectives is a challenging task and can be solved using multi-objective portfolio optimization.

This repository provides Python code that converts the multi-objective portfolio optimization problem into a QUBO problem. The transformed problem can then be solved using quantum annealing techniques.

The following objectives can be considered

Additionally, we allow for a capital growth factor and arbitrary emission reduction constraints to be considered.

The Pareto front, the set of solutions where one objective can't be improved without worsening the other objective, can be computed for the objectives return on capital and diversification.

The codebase is based on the following paper:

Funding: This research was funded by Rabobank and Stichting TKI High Tech Systems and Materials, under a program by Brightland's Techruption.

Documentation

Documentation of the tno.quantum.problems.portfolio_optimization package can be found here.

Install

Easily install the tno.quantum.problems.portfolio_optimization package using pip:

$ python -m pip install tno.quantum.problems.portfolio_optimization

If you wish to run the tests you can use:

$ python -m pip install tno.quantum.problems.portfolio_optimization[tests]

Usage examples can be found in the documentation.

Data input

The data used for the portfolio optimization can be imported via an excel file, csv file, json file or as a Pandas DataFrame. The data needs to contain at least the following columns:

  • asset: The name of the asset.
  • outstanding_now: Current outstanding amount per asset.
  • min_outstanding_future: Lower bound outstanding amount in the future per asset.
  • max_outstanding_future: Upper bound outstanding amount in the future per asset.
  • income_now: Current income per asset, corresponds to return multiplied by the current outstanding amount.
  • regcap_now: Current regulatory capital per asset.

If the input datafile contains all the correct information, but has different column names, it is possible to rename the columns without altering the input file.

The data that was used for the publication can be found in the src/tno/quantum/problems/portfolio_optimization/datasets/ folder.

(End)use limitations

The content of this software may solely be used for applications that comply with international export control laws.

Metadata

Release files for tno.quantum.problems.portfolio_optimization 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tno.quantum.problems.portfolio_optimization 2.0.0
File Size Uploaded
tno_quantum_problems_portfolio_optimization-2.0.0.tar.gz 124.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tno.quantum.problems.portfolio_optimization 2.0.0
File Interpreter ABI Platform
tno_quantum_problems_portfolio_optimization-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 256.1 kB

Release files / tno_quantum_problems_portfolio_optimization-2.0.0.tar.gz

Download URL tno_quantum_problems_portfolio_optimization-2.0.0.tar.gz
Size 124.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5b5ebebe7ad372334fe9355aaf40818589ca3754519a653d5517f04bcafb9b1a
BLAKE2b-256 checksum
How to use checksums
9336bfe03e01c67a848203aad9a8c202baa7d62b9eb3a6204094d7b521618548
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release files / tno_quantum_problems_portfolio_optimization-2.0.0-py3-none-any.whl

Download URL tno_quantum_problems_portfolio_optimization-2.0.0-py3-none-any.whl
Size 131.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0eca75f87f91b067577635566f7b0663551a1dfca6adca37aab06b7d8fcbb01
BLAKE2b-256 checksum
How to use checksums
5b39ad635ea05b610410f245d282362f9eec165804dbc5c6a12631bda3011d79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page