
Portfolio optimization asks how to allocate capital across a set of assets to balance return against risk. The mathematical shape of that question changes with the constraints: continuous allocation weights call for one kind of solver, discrete asset selection under a hard cap calls for another. Quantum portfolio optimization applies three distinct families of quantum and quantum-inspired algorithms to three distinct formulations of the same underlying problem, so the right algorithm depends on how your portfolio problem is actually constrained.
Continuous allocation weights w that hit a target monthly return while minimizing portfolio variance wᵀΣw, subject to a budget constraint. Solved as a linear system with HHL.
Choose exactly K of N assets to balance expected return against risk, with the K-of-N constraint folded into a QUBO objective as a penalty term. Solved with quantum annealing.
Choose the subset of assets that maximizes value under a hard budget or risk-capacity cap, with each asset carrying its own value and weight. Solved with constrained QAOA and a Quantum Walk Mixer.
When the constraint is a hard budget or risk-capacity cap rather than a target return, portfolio selection is a knapsack problem: choose the subset of assets that maximizes value without exceeding the cap, with optional group caps on top. The quantum approach encodes the binary include/exclude decision as constrained QAOA — a Quantum Approximate Optimization Algorithm cost function whose Quantum Walk Mixer keeps the search inside the constraint-preserving subspace, instead of penalizing violations after the fact.
Dataset and setup: on a 5-asset instance, constrained QAOA runs on 11 qubits on a simulator, with parameter schedules and mixer depth logged for reproducibility. The same instance is benchmarked against MILP and heuristic baselines.
Instance
5 assets
Qubits
11
Execution
Simulator
Results: the platform returns a feasible constrained-QAOA solution with an objective value comparable to the MILP and heuristic baselines, per-constraint feasibility-violation reporting, and seed-controlled reproducibility.
When to pick it: choose QAOA with a quantum walk mixer when your constraint is a hard cap that must never be violated — a knapsack-style budget or risk-capacity limit, optionally with group caps — rather than a continuous risk-return trade-off. See how constrained QAOA compares against a classical solver in QAOA vs. MILP.
Mean-variance optimization looks for continuous allocation weights w that hit a target monthly return while minimizing portfolio variance, subject to a budget constraint:
Adding Lagrange multipliers turns the constrained optimization into a linear system Ax = b, where A packs the covariance matrix \Sigma and the return vector r together with the constraint rows. The HHL (Harrow–Hassidim–Lloyd) algorithm solves that system on a quantum computer by preparing a state proportional to the solution.
Dataset and setup: three assets (AAPL, GOOGL, MSFT), 1,258 rows of historical daily closing prices from 2020–2025, reduced to roughly 60 monthly observations to estimate the expected-return vector and covariance matrix. The target was at least 2.0% expected return per month (≥26.8%/year) with risk capped at 0.5% per month (≤1.8%/year) and no single asset above 40% of the portfolio. The linear system runs on 11 qubits on a simulator, with no training step.
Assets
3 (AAPL, GOOGL, MSFT)
Qubits
11
Execution
Simulator
Expected Return
\approx 2.06\%/ month
Risk
\approx 0.43\%/ month
Feasibility (return constraint)
\|r^\top w - \mu\| \approx 2.0 \times 10^{-6}
Budget
\|\mathbf{1}^\top w - 1\| \approx 1.0 \times 10^{-3}
Classical residual (LU solve check)
\|Ax - b\| \approx 6.2 \times 10^{-5}
When to pick it: choose HHL when the decision variable is continuous allocation weights rather than a discrete selection, and when you mainly need risk/return functionals — not every coordinate of the weight vector — at scale.
Cardinality-constrained selection asks for exactly K of N assets — a binary decision per asset, \mathbf{x}\in\{0,1\}^N, with \sum_i x_i = K — that balances expected return against risk. The objective folds risk, return and the K-of-N constraint into a single quadratic unconstrained binary optimization (QUBO):
The first term penalizes portfolio variance, the second rewards expected return, and the third is a penalty that enforces the exact count. QUBO maps directly onto an Ising Hamiltonian, which quantum annealing hardware is built to minimize by slowly interpolating from an easy driver Hamiltonian to the problem Hamiltonian, using quantum tunneling to escape the local minima that stall classical heuristics on rugged energy landscapes.
Dataset and setup: ten large-cap tickers (AAPL, MSFT, GOOGL, AMZN, META, NVDA, JPM, XOM, V, PG), daily prices from 2018–2024, with the cardinality constraint set to K = 6 of N = 10. The QUBO runs on 10 logical qubits, executed on a simulator in about two minutes.
| Parameter | Value |
|---|---|
| Universe | 10 tickers, daily prices 2018–2024 |
| Constraint | K = 6 (cardinality, penalty-encoded in the QUBO) |
| Logical qubits | 10 |
Sharpe
0.123
Annual return
40.4%
Annual volatility
18.25%
Results: the annealing-driven portfolio placed 2nd of 4 strategies on the out-of-sample test window, with a Sharpe ratio comparable to the top classical baseline — ahead of the Equal-Weight-All baseline's 36.9% return and 14.6% volatility, and close to Top-K-Mean's 49.6% return at a materially higher 22.3% volatility.
When to pick it: choose quantum annealing when the constraint is an exact K-of-N count rather than a soft budget cap, and you want a single tunable QUBO formulation that can run on hybrid or fully classical samplers today and move to QPU hardware later.
The three algorithms answer different constraint shapes, not different levels of maturity — picking the right one starts with how your portfolio problem is actually constrained.
| Approach | Problem type | Constraints handling | Qubits / size used | Result vs. classical baseline | Hardware today |
|---|---|---|---|---|---|
| QAOA + Quantum Walk Mixer | Knapsack selection (hard budget/risk cap) | Mixer keeps the search inside the feasible subspace | 11 qubits / 5-asset instance | Feasible; objective comparable to MILP & heuristic baselines | Simulator today |
| HHL | Mean-variance (continuous weights, linear system) | Budget & return constraints folded into the linear system via Lagrange multipliers | 11 qubits / 3-asset instance | Risk ≈0.43%/mo; ≈6.2×10⁻⁵ residual vs. a classical LU solve | Simulator; ~100–500 logical qubits estimated for a practical edge |
| Quantum annealing | Cardinality-constrained selection (K-of-N QUBO) | Exact-count penalty term inside the QUBO objective | 10 qubits / 10-asset universe | Sharpe 0.123, ranked 2nd of 4 vs. classical baselines | Simulator; D-Wave LeapHybrid/QPU samplers available |
Whichever formulation you start from, portfolio construction is only half the risk picture — pair the resulting allocation with VaR/CVaR risk estimation to quantify tail risk on the finished portfolio.
The business case differs by formulation, but the pattern repeats: a single reproducible solver replaces slow, ad hoc screening, whether the output is continuous allocation weights or a discrete asset selection.
More scenario runs per day at large asset counts, when state preparation and time evolution are efficient.
HHL, mean-variance allocation
Projected annual value add vs. an Equal-Weight benchmark on a $5M AUM book, for a 287% ROI.
Quantum annealing, cardinality-constrained selection
Efficiency gain in candidate selection and rebalancing cycles versus manual screening.
Quantum annealing, cardinality-constrained selection
One platform, three formulations: from your portfolio brief to quantum results, code, and a report
Describe your portfolio problem — target return, a hard budget cap, or an exact K-of-N count — and we map it to a formulation
Confirm the matching algorithm — QAOA with a quantum walk mixer, HHL, or quantum annealing — and its key assumptions
Download the ready-to-run code; execute the chosen algorithm on a simulator with a fixed seed
Review allocation weights or selections, feasibility checks, and reproducible logs
Compare against the matching classical baseline — MILP, a direct linear solve, or Equal-Weight/Top-K — before moving to quantum hardware
Not yet, in production. Across all three formulations here, the quantum or quantum-inspired result lands close to — not clearly ahead of — the best classical baseline: quantum annealing placed 2nd of 4 strategies with a Sharpe ratio comparable to the top classical baseline, and HHL's own analysis recommends classical solvers for production today, using HHL on a simulator as a verification tool.
It depends on the constraint, not on which algorithm is faster. QAOA with a quantum walk mixer fits a hard knapsack-style budget or risk-capacity cap, where the mixer keeps the search inside the feasible subspace. Quantum annealing fits an exact K-of-N cardinality constraint expressed as a QUBO penalty term.
Today's simulator runs on this platform are sized to what current qubit counts and noise levels support: 3 assets on 11 qubits for the HHL mean-variance case, 5 assets on 11 qubits for the QAOA knapsack case, and 10 assets on 10 qubits for the quantum-annealing cardinality case. A practical edge on larger universes is estimated to need roughly 100–500 logical qubits for HHL.
HHL solves a linear system and returns continuous allocation weights — it fits mean-variance optimization, where the answer is how much of each asset to hold. QAOA solves a combinatorial optimization problem and returns a discrete selection — it fits knapsack-style problems, where the answer is which assets to hold, under a hard capacity constraint.
No. Every result on this page runs on a simulator today — statevector simulation for HHL and QAOA, and classical simulated-annealing or hybrid solvers for quantum annealing, which can also target a QPU directly as hardware matures. The platform can run every algorithm covered here, QAOA included.
Start from the constraint. A target return with continuous weights and a variance budget is mean-variance (HHL). An exact count of assets to hold is cardinality-constrained selection (quantum annealing). A hard budget or risk-capacity cap on a discrete subset is knapsack selection (QAOA with a quantum walk mixer). Describe your constraint on the platform and it maps to the right formulation.
Algorithms, applied use cases and benchmarks connected to this page
Algorithms
Explore the Quantum Approximate Optimization Algorithm for QUBO and Ising problems with reproducible benchmarks, parameter schedules, and hardware notes.
Algorithms
Explore the Harrow-Hassidim-Lloyd algorithm for quantum linear systems, portfolio optimization examples, and reproducible benchmark pipelines.
Algorithms
Map combinatorial optimization problems to QUBO and Ising form and benchmark quantum annealing with reproducible runs, baselines, and hardware notes.
Finance
Estimate Value at Risk and Conditional Value at Risk with Iterative Quantum Amplitude Estimation, Monte Carlo benchmarks, and reproducible reports.
Comparisons
Compare constrained QAOA with MILP on a 5-asset portfolio knapsack PoC using an 11-qubit simulator run, feasibility checks, and objective-quality audits.
Comparisons
Compare quantum amplitude estimation (IQAE) with classical Monte Carlo for VaR/CVaR risk estimation, an 11-qubit benchmark, and when each wins.
Run QAOA with a quantum walk mixer, HHL, or quantum annealing on your own portfolio problem and get transparent, reproducible results in minutes.
Try your first case for free