[Paper Review] Portfolio Optimization on Classical and Quantum Computers Using PortFawn
This paper introduces PortFawn, an open-source Python library for mean-variance portfolio optimization on both classical and quantum computers using quantum annealing. It enables researchers to customize portfolios via adjustable constraints and cost functions, demonstrating that quantum-optimized portfolios (BMOP) achieve competitive risk-return profiles despite binary weight constraints, highlighting potential for quantum advantage in finance.
Portfolio diversification is one of the most effective ways to minimize investment risk. Individuals and fund managers aim to create a portfolio of assets that not only have high returns but are also uncorrelated. This goal can be achieved by comparing the historical performance, fundamentals, predictions, news sentiment, and many other parameters that can affect the portfolio's value. One of the most well-known approaches to manage/optimize portfolios is the well-known mean-variance (Markowitz) portfolio. The algorithm's inputs are the expected returns and risks (volatility), and its output is the optimized weights for each asset in the target portfolio. Simplified unrealistic assumptions and constraints were used in its original version preventing its use in practical cases. One solution to improve its usability is by altering the parameters and constraints to match investment goals and requirements. This paper introduces PortFawn, an open-source Python library to create and backtest mean-variance portfolios. PortFawn provides simple-to-use APIs to create and evaluate mean-variance optimization algorithms using classical computing (real-valued asset weights) as well as quantum annealing computing (binary asset weights). This tool has many parameters to customize the target portfolios according to the investment goals. The paper introduces the background and limitations of the mean-variance portfolio optimization algorithm, its architecture, and a description of the functionalities of PortFawn. We also show how one can use this tool in practice using a simple investment scenario.
Motivation & Objective
- To address the limitations of classical mean-variance portfolio optimization, such as unrealistic assumptions about liquidity, transaction costs, and return distribution.
- To provide a flexible, extensible, and well-tested open-source framework for researchers to experiment with mean-variance optimization under various constraints.
- To evaluate the performance of quantum annealing-based portfolio optimization using D-Wave hardware and the Ocean software stack.
- To demonstrate the feasibility and competitiveness of quantum-optimized portfolios (BMOP) compared to classical counterparts (MRP, MVP, MSRP) in a realistic backtesting scenario.
- To support educational and research use of portfolio optimization tools while explicitly disclaiming financial advisory use.
Proposed method
- PortFawn collects historical asset prices and computes expected returns and covariance matrices as inputs for mean-variance optimization.
- The library implements classical mean-variance optimization using real-valued asset weights via quadratic programming with customizable constraints.
- It integrates with D-Wave’s quantum annealing hardware and the Ocean software stack to solve portfolio optimization as a binary quadratic optimization problem.
- PortFawn supports multiple cost functions and constraints, enabling users to tailor portfolios to specific investment goals and risk preferences.
- The framework includes full pipeline support: data collection, optimization, backtesting, and visualization of portfolio performance.
- Quantum optimization is formulated as a binary-weighted problem (BMOP), where each asset is either fully included or excluded, mapping to the Ising model.
Experimental results
Research questions
- RQ1Can quantum annealing effectively solve portfolio optimization problems with binary asset weights, and how does its performance compare to classical methods?
- RQ2How do different mean-variance portfolio configurations (MRP, MVP, MSRP, BMOP) perform in terms of risk-adjusted returns and volatility under realistic backtesting conditions?
- RQ3To what extent do the unrealistic assumptions of classical mean-variance optimization—such as ignoring transaction costs and assuming i.i.d. returns—limit practical applicability?
- RQ4How does the correlation structure between classical and quantum-optimized portfolios affect diversification benefits?
- RQ5Can open-source tools like PortFawn facilitate reproducible and extensible research in quantum-enhanced financial optimization?
Key findings
- The mean-variance portfolio (MRP) achieved the highest cumulative returns among all tested portfolios, while the minimum variance portfolio (MVP) exhibited the lowest volatility.
- The balanced portfolio (MSRP) offered a compromise between return and risk, showing moderate correlation with other strategies.
- The quantum-optimized binary portfolio (BMOP) performed competitively despite the constraint of binary weights, indicating potential for quantum advantage in portfolio construction.
- The equal-weighted portfolio (EWP) demonstrated strong risk-adjusted performance with simplicity and robustness, serving as a strong benchmark.
- Correlation analysis revealed that MSRP and MVP were less correlated with other portfolios, suggesting diversification benefits when combined.
- Visualizations confirmed that classical portfolios (MRP, MVP, MSRP) fell along or near the efficient frontier, while BMOP, though constrained, remained competitive in the risk-return space.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.