By Tarun Bhatia - CEO QFINTEC
In recent years, advancements in quantum computing have unlocked new pathways for solving complex optimization problems that were once deemed intractable. Among the emerging quantum techniques, quantum annealing has shown promising potential, particularly in the domain of portfolio optimization. In this article, we explore how quantum annealing can be a game-changer for asset managers, delve into the unique benefits it offers over classical methods, and share results from our own experiments.

Image showing visual representation of quantum computer link
The Challenge of Portfolio Optimization
Portfolio optimization is at the heart of investment management. It involves selecting the best combination of assets to maximize return while minimizing risk—a problem that becomes highly complex as constraints and non-linear relationships between assets grow. Traditional optimization techniques, including linear programming and classical Monte Carlo simulations, perform well with smaller, less constrained portfolios but can struggle with larger, more complex datasets.
Enter Quantum Annealing
Quantum annealing is a quantum computing technique designed to tackle combinatorial optimization problems by exploring vast solution spaces in ways that classical algorithms cannot. Instead of evaluating each possible solution one by one, quantum annealers leverage quantum mechanics, allowing them to "tunnel" through potential solutions, searching more efficiently for optimal configurations. For portfolio managers, this means tackling large, constrained portfolios with efficiency and precision, discovering solutions that can enhance returns or reduce risk more effectively.
For more details about Quantum Annealing process and underlying quantum physics you can refer to Dwavesys docs
Why Quantum Annealing is Transformative for Portfolio Management
Quantum annealing excels in scenarios with:
Non-linear Relationships: Many asset returns are not linearly correlated, and the real-world interplay between assets can be complex. Quantum annealing can naturally accommodate these non-linear relationships.
Complex Constraints: Portfolio optimization problems often include numerous constraints, such as sector limits, budget constraints, and leverage restrictions. Quantum annealing can explore feasible solutions without getting bogged down by the overwhelming number of combinations that classical methods would have to evaluate.
High-Dimensional Solution Spaces: In a portfolio with hundreds of assets, the number of potential allocations is astronomically high. Quantum annealing can analyze this vast solution space to identify portfolios that meet the desired criteria.
Experiment Methodology: Quantum Annealing for Portfolio Optimization
Our goal was to test the effectiveness of quantum annealing against a classical approach in optimizing a portfolio of 100 assets under realistic investment constraints. Below is a detailed breakdown of the experimental design, data preparation, and optimization techniques we employed.
Step 1: Data Collection and Preparation
Asset Selection: We selected 100 diverse assets across multiple sectors to ensure the portfolio was both representative and diversified.
Historical Price Data: We gathered historical price data spanning six years (2019-2024), first 3 years (Jan 2019 Dec 2021) were used for in-sample and Jan 2022 - Nov 2024 for out of sample, which provided a robust dataset to estimate expected returns and asset volatilities.
Covariance Matrix Construction: Using daily returns, we built a covariance matrix, which captured correlations between assets. This matrix was essential for calculating portfolio volatility and risk.
Step 2: Setting Constraints and Optimization Criteria
For the experiment, we defined specific constraints and objectives to mimic real-world conditions:
Return Objective: The primary objective was to maximize risk-adjusted returns (Sharpe ratio).
Volatility Cap: We set a cap on portfolio volatility to limit risk exposure.
Sector Allocation Constraints: Each sector’s weight was capped to prevent overexposure, with no sector exceeding 20% of the total portfolio.
Minimum Expected Return: A minimum expected return threshold was applied to avoid overly conservative portfolios.
Problem Formulation
Our primary objective in portfolio optimization was to maximize the Sharpe Ratio—the risk-adjusted return of the portfolio. However, maximizing the Sharpe Ratio directly is complex, so we reformulated the objective to:
Maximize Expected Return: Aim to select assets that maximize the portfolio’s expected return.
Minimize Portfolio Risk: Based on the covariance matrix, ensure that the chosen assets yield low volatility, thereby balancing the return-risk trade-off.
Thus, the objective function was expressed as a linear combination of returns and a quadratic term representing risk.
Further we added constraints.
Step 3: To compare performance, we used two distinct optimization techniques:
A. Classical Optimization (Markowitz Model):
Technique: For the baseline, we used a classical Markowitz mean-variance optimization approach, which minimizes portfolio variance while aiming to achieve a target return.
Solver: We employed a traditional quadratic programming solver that iteratively adjusted asset weights within the constraints, searching for the highest Sharpe ratio.
Limitations: Classical optimization, while effective for small portfolios, tends to struggle with convergence when the number of assets and constraints increase. We observed that the solver took a considerable time to process the 100-asset portfolio under the imposed constraints.
B. Quantum Annealing:
Technique: We formulated the portfolio optimization problem as a quadratic unconstrained binary optimization (QUBO) problem. Quantum annealers are particularly suited for QUBO formulations, where the problem is represented by a cost function that the quantum annealer minimizes.
Problem Mapping: Using the covariance matrix and expected returns, we mapped our objective function (risk-adjusted return maximization) and constraints onto a QUBO matrix. The quantum annealer seeks to minimize the matrix by adjusting asset weights within the set constraints.
Annealing Process: During annealing, the quantum processor explores various configurations, "tunneling" through possible solutions to escape local minima and find the global minimum. This is particularly effective for high-dimensional, non-linear problems like ours.
Step 4: Execution of the Optimization
Classical Optimization: Given the high dimensionality and constraints, it produced solutions with moderate stability, but some runs showed variance in the final asset allocation, reflecting a struggle to handle the complexity efficiently.
Quantum Annealing: After mapping the portfolio optimization problem onto the QUBO formulation, we ran multiple iterations on the quantum annealer to ensure solution consistency. The annealer rapidly evaluated numerous configurations and yielded stable, high-quality solutions in a fraction of the time taken by the classical approach.
Step 5: Evaluation of Results
After generating optimized portfolios from both methods, we compared the performance metrics on Out of sample period :
Risk-Adjusted Return (Sharpe Ratio): The quantum-optimized portfolio achieved a Sharpe ratio of 1.76, surpassing the classical model’s 1.38.
Return and Volatility: The quantum-optimized portfolio had a return of 9.7% with a lower volatility of 5.5%, compared to the classical portfolio's 8.4% return and 6.1% volatility.
Solution Stability: Quantum annealing demonstrated high solution stability across runs, while the classical approach occasionally produced slight variations due to its struggle with the constraints and non-linearity.
Key Takeaways
Effectiveness in Constrained Environments: Quantum annealing showed a strong capacity for handling multiple constraints and non-linear relationships, producing a more optimized portfolio that respected sector caps, volatility limits, and minimum return requirements.
Computational Efficiency: The faster processing time suggests that quantum annealing could be highly beneficial in dynamic markets where portfolios need frequent rebalancing.
Higher Sharpe Ratio: The quantum-optimized portfolio’s higher Sharpe ratio indicates better risk-adjusted performance, suggesting that quantum annealing can uncover allocations that classical methods might miss.
Quantum Hardware Used
For this experiment, we used D-Wave’s Quantum Annealing hardware, accessible through the D-Wave Leap cloud platform. This platform provides access to D-Wave's quantum annealers, which are specifically designed to handle complex combinatorial optimization tasks, making it ideal for our portfolio optimization problem.
Programming Language and Environment
We used Python as the primary programming language due to its strong support for scientific computing, its compatibility with D-Wave’s SDK, and the availability of extensive libraries for data handling, optimization, and machine learning. Here are the core components of our setup:
D-Wave Ocean SDK: This Python SDK provides tools to formulate optimization problems in a way that the quantum annealer can solve, particularly through its dimod library for representing QUBO (Quadratic Unconstrained Binary Optimization) problems. Ocean also facilitates sending QUBO models to the D-Wave hardware and retrieving results.
Classical Optimization Solver (SciPy): For the classical benchmark, we used SciPy’s optimize module, specifically the minimize function, to implement the Markowitz model. This allowed us to compare the results of the quantum approach against a classical optimization baseline.
Why does Quantum Annealing give different solution than Markowitz's classical mean-variance optimization (MVO)?
Quantum annealing and Markowitz's classical mean-variance optimization (MVO) approach can produce different solutions for portfolio optimization, primarily due to their distinct methodologies and ways of handling constraints. Here’s why:
Objective Function Differences:
Markowitz’s MVO minimizes risk for a given level of return, typically working with a continuous set of weights for assets and relying on quadratic programming. It assumes a convex problem space, which makes it effective for simpler cases but less adaptable when numerous, complex constraints are involved.
Quantum annealing, on the other hand, solves optimization as a discrete QUBO (Quadratic Unconstrained Binary Optimization) problem. This difference in formulation can lead to variations in asset selection, particularly when non-linear constraints are applied.
Constraint Handling:
Quantum annealing can explore solution spaces with non-linear and complex constraints more freely due to its inherent ability to handle combinatorial, binary-based choices. When constraints are imposed in quantum annealing, the solution often differs because quantum annealing can evaluate configurations that might violate classical convexity assumptions.
Markowitz’s approach, being continuous, may struggle or require additional heuristics to address constraints like sector limits or minimum/maximum holdings, potentially leading to different portfolio compositions.
Optimality and Global vs. Local Solutions:
Markowitz optimization, if the problem is convex, will generally yield a globally optimal solution within its assumptions. However, in cases of high non-linearity or discrete constraints, it might converge to local optima or be constrained in finding solutions that meet all conditions simultaneously.
Quantum annealing's probabilistic approach to seeking global optima across a non-convex landscape can yield alternative solutions that may be better suited for highly constrained or complex cases but are not guaranteed to align with the classical MVO solution.
Asset Selection and Diversification:
Due to these differences, quantum annealing may select assets in a way that results in slightly higher or lower exposure to certain sectors or asset classes compared to the MVO solution, even when optimizing for similar objectives like the Sharpe ratio.
In summary, while both approaches seek to balance risk and return, quantum annealing may produce a different asset allocation than Markowitz’s MVO, especially in scenarios with high complexity or non-linear constraints. Quantum annealing has the potential to find solutions that classical methods cannot.
Real-World Implications for Asset Managers
For asset managers, quantum annealing offers several practical advantages:
Speed in High-Dimensional Analysis: Faster computation times can free up resources, allowing managers to adjust portfolios in response to rapidly changing market conditions.
Improved Compliance with Constraints: Quantum annealing handles complex, layered constraints more effectively, providing solutions that classical methods struggle to identify.
Competitive Edge: By adopting quantum techniques early, asset managers can position themselves at the forefront of technology-driven investing.
The Future of Quantum Annealing in Finance
While still in its early stages, quantum annealing is rapidly evolving. As quantum hardware becomes more accessible and sophisticated, the potential applications in finance—from more efficient portfolio optimization to real-time arbitrage—will expand. Asset managers who adopt quantum techniques now may find themselves better equipped to navigate the complexities of modern markets, delivering optimized portfolios that align with investor goals.
Conclusion
Our experiment demonstrates that quantum annealing can provide meaningful improvements over classical optimization methods in portfolio management. With its ability to tackle non-linearity, complex constraints, and large solution spaces, quantum annealing is poised to become a valuable tool in the asset manager’s toolkit. At QFINTEC, we are committed to staying at the cutting edge of these advancements, helping our clients optimize portfolios for the next generation of financial challenges.
As always, we welcome questions and discussions about the intersection of quantum computing and finance. Reach out to learn more about how QFINTEC is using quantum annealing and other AI-driven techniques to transform portfolio optimization and empower asset managers.
References:
D-Wave Systems Documentation: Quantum Annealing and Optimization
Markowitz, H. (1952). Portfolio Selection. Journal of Finance.
About QFINTEC:
QFINTEC empowers asset managers across the globe to deliver superior fund performance by applying machine learning and data science to portfolio construction and management.
Thematic Model portfolios (i.e. Equities (long/short/market neutral), FX, Futures, Global Macro, Sector Rotation, Pairs Trading
Institutional Portfolio + Extending your investment with uncorrelated Smart Indexes/ETFs or Assets for multi-strat performance and diversification
Bespoke Model portfolios (Implementing your vision), customized hedging baskets, additive uncorrelated portfolios.
Comments