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.
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.
In this work, we introduce a new workflow to solve portfolio optimization problems on annealing platforms. We combine a classical preprocessing step with a modified unconstrained binary optimization (QUBO) model and evaluate it using simulated annealing (classical computer), digital annealing (Fujitsu’s Digital Annealing Unit), and quantum annealing (D-Wave Advantage). Starting from Markowitz’s theory on portfolio optimization, our classical preprocessing step finds the most promising assets within a set of possible assets to choose from. We then modify existing QUBO models for portfolio optimization, such that there are no limitations on the number of assets that can be invested in. Furthermore, our QUBO model enables an investor to also place an arbitrary amount of money into each asset. We apply this modified QUBO to the set of promising asset candidates we generated previously via classical preprocessing. A solution to our QUBO model contains information about what percentage of the whole available capital should be invested into which asset. For the evaluation, we have used publicly available real-world data sets of stocks of the New York Stock Exchange as well as common ETFs. Finally, we have compared the respective annealing results with randomly generated portfolios by using the return, variance, and diversification of the created portfolios as measures. The results show that our QUBO formulation is capable of creating well-diversified portfolios that respect certain criteria given by an investor, such as maximizing return, minimizing risk, or sticking to a certain budget.
In this paper we show how to implement in a simple way some complex real-life constraints on the portfolio optimization problem, so that it becomes amenable to quantum optimization algorithms. Specifically, first we explain how to obtain the best investment portfolio with a given target risk. This is important in order to produce portfolios with different risk profiles, as typically offered by financial institutions. Second, we show how to implement individual investment bands, i.e., minimum and maximum possible investments for each asset. This is also important in order to impose diversification and avoid corner solutions. Quite remarkably, we show how to build the constrained cost function as a quadratic binary optimization (QUBO) problem, this being the natural input of quantum annealers. The validity of our implementation is proven by finding the optimal portfolios, using D-Wave Hybrid and its Advantage quantum processor, on portfolios built with all the assets from S&P100 and S&P500. Our results show how practical daily constraints found in quantitative finance can be implemented in a simple way in current NISQ quantum processors, with real data, and under realistic market conditions. In combination with clustering algorithms, our methods would allow to replicate the behaviour of more complex indexes, such as Nasdaq Composite or others, in turn being particularly useful to build and replicate Exchange Traded Funds (ETF).
Computational complexity of portfolio optimization grows rapidly with the number of assets and is a fundamental problem in finance. Limiting the number of assets to be included in the portfolio makes this problem combinatorial and NP-hard. This work offers a detailed study of a portfolio optimization problem using quantum computing through extensive backtesting. We also evaluated the effectiveness of the quantum solver by benchmarking it against a classical solver. The performance of each of the generated portfolio is assessed using financial metrics such as annual return, annual volatility, Sharpe ratio, diversification ratio, Value-at-Risk (VaR) and Conditional Valueat-Risk (CVaR). Through extensive backtesting experiments, we found that the quantum solver produces portfolios with higher diversification, lower volatility, and better worst-case metrics, though with lower expected returns, while the classical solver consistently achieves higher returns with higher risks. A key contribution of this work is the development of a backtesting pipeline for evaluating the results of the quantum algorithm, validated on local simulators and AWS Braket SV1. This research highlights the current limitations of quantum approaches in portfolio optimization, paving the way for future large-scale financial decision workflows.
Portfolio optimization (PO) is extensively employed in financial services to assist in achieving investment objectives. By providing an optimal asset allocation, PO effectively balances the risk and returns associated with investments. However, it is important to note that as the number of involved assets and constraints increases, the portfolio optimization problem can become increasingly difficult to solve, falling into the category of NP-hard problems. In such scenarios, classical algorithms, such as the Monte Carlo method, exhibit limitations in addressing this challenge when the number of stocks in the portfolio grows. Quantum annealing algorithm holds promise for solving complex portfolio optimization problems in the NISQ era. Many studies have demonstrated the advantages of various quantum annealing algorithm variations over the standard quantum annealing approach. In this work, we conduct a numerical investigation of randomly generated unconstrained single-period discrete mean-variance portfolio optimization instances. We explore the application of a variety of unconventional quantum annealing algorithms, employing both forward annealing and reverse annealing schedules. By comparing the time-to-solution(TTS) and success probabilities of diverse approaches, we show that certain methods exhibit advantages in enhancing the success probability when utilizing conventional forward annealing schedules. Furthermore, we find that the implementation of reverse annealing schedules can significantly improve the performance of select unconventional quantum annealing algorithms.
Portfolio optimization under conditions of risk and market uncertainty remains a foundational challenge in financial economics and investment management. Classical optimization frameworks, including mean–variance models and stochastic programming approaches, often struggle with high-dimensional asset universes, nonlinear correlations, and dynamic market regimes. This paper examines quantum computing approaches to portfolio optimization under risk and market uncertainty, focusing on hybrid quantum–classical algorithms designed to enhance combinatorial optimization and probabilistic modeling. By integrating quantum annealing, variational quantum circuits, and quantum-enhanced sampling techniques with classical financial analytics, the study evaluates their potential to improve computational efficiency and scenario sensitivity. The analysis considers both theoretical advantages and practical limitations within the Noisy Intermediate-Scale Quantum (NISQ) era. The findings suggest that quantum-assisted optimization may complement traditional portfolio models by expanding feasible solution spaces and improving robustness under uncertainty, thereby contributing to more adaptive and resilient investment strategies.
Classical mean-variance optimization is powerful in theory but fragile in practice, often producing highly concentrated, high-turnover portfolios. Naive equal-weight (1/N) portfolios are more robust but largely ignore cross-sectional information. We propose a quantum stochastic walk (QSW) framework that embeds assets in a weighted graph and derives portfolio weights from the stationary distribution of a hybrid quantum-classical walk. The resulting allocations behave as a “smart 1/N” portfolio: structurally close to equal-weight, but with small, data-driven tilts and a controllable level of trading. On recent S&P 500 universes, QSW portfolios match the diversification and stability of 1/N while delivering higher risk-adjusted returns than both mean-variance and naive benchmarks. A comprehensive hyper-parameter grid search shows that this behavior is structural rather than the result of fine-tuning and yields simple design rules for practitioners. A 34-year, multi-universe robustness study with rolling re-optimization further demonstrates that the QSW optimizer preserves these advantages across market regimes. Overall, the QSW framework improves risk-adjusted performance while maintaining strong diversification and moderate turnover.