Quantum portfolio optimization visualization
    QAOA · HHL · Quantum Annealing

    Quantum Portfolio OptimizationThree Problems, Three Quantum Algorithms

    Knapsack selection with QAOA, mean-variance allocation with HHL, and cardinality-constrained selection with quantum annealing — one platform, three formulations, each benchmarked against a classical baseline.

    What you get: knapsack selection with QAOA and a quantum walk mixer, mean-variance allocation with HHL, and cardinality-constrained selection with quantum annealing — each run on a simulator with feasibility checks and a classical baseline.

    How it's delivered: a downloadable research-style report and run-ready code for whichever formulation matches your portfolio problem.

    Why trust it: seed-controlled reproducibility, documented parameter schedules, and hardware-readiness notes for every algorithm.

    What Is Quantum Portfolio Optimization?

    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.

    Mean-variance optimization

    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.

    Cardinality-constrained selection (QUBO)

    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.

    Knapsack selection

    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.

    QAOA with Quantum Walk Mixers (Knapsack)

    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.

    Strengths

    • The Quantum Walk Mixer keeps the search inside a constraint-preserving subspace instead of penalizing violations after the fact.
    • The same instance is benchmarked against MILP and heuristic baselines, so feasibility and objective value are comparable side by side.

    Watch-outs

    • This is a research-grade pipeline today, not a production one — hardware-readiness depends on instance size and device noise.
    • Supporting additional capacities (multiple budgets, group caps) means adding more constraint terms to the encoding.

    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.

    HHL (Mean-Variance, Linear System)

    Mean-variance optimization looks for continuous allocation weights w that hit a target monthly return while minimizing portfolio variance, subject to a budget constraint:

    \min_w \, w^\top \Sigma w \quad \text{s.t.} \quad r^\top w = \mu, \; \mathbf{1}^\top w = 1

    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}

    Strengths

    • Under standard assumptions (A sparse, Hermitian, well-conditioned), HHL's cost scales only poly-logarithmically in the number of assets N — qualitatively better than the O(N²)–O(N³) a dense classical solver needs.
    • HHL estimates risk and other functionals of the solution directly by measurement, without reconstructing every allocation weight.

    Watch-outs

    • The speedup applies to functionals of the solution, such as portfolio risk, not to reading out every individual weight.
    • Vector encoding and Hamiltonian simulation both need to stay efficient, which in practice means A has to be sparse and well-conditioned.

    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.

    Quantum Annealing (Cardinality-Constrained QUBO)

    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):

    \min_{\mathbf{x}\in \{0,1\}^N} F(\mathbf{x}) = \tfrac{1-\alpha}{K^2}\mathbf{x}^\top \Sigma \mathbf{x} - \tfrac{\alpha}{K} \boldsymbol{\mu}^{\top}\mathbf{x} + A\left(\sum_i x_i - K\right)^2

    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.

    ParameterValue
    Universe10 tickers, daily prices 2018–2024
    ConstraintK = 6 (cardinality, penalty-encoded in the QUBO)
    Logical qubits10

    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.

    Strengths

    • QUBO maps directly onto an Ising Hamiltonian, letting quantum tunneling escape the local minima that stall classical heuristics on rugged landscapes.
    • Hybrid annealing workflows (annealer plus classical pre/post-processing) return good low-energy solutions quickly under a fixed wall-time budget.

    Watch-outs

    • Performance hinges on penalty calibration and anneal schedules; mis-tuning can cause infeasibility or stagnation.
    • Mapping dense logical graphs onto sparse hardware connectivity can require long qubit chains, increasing sensitivity to noise.

    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.

    Comparing the Three Approaches

    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.

    ApproachProblem typeConstraints handlingQubits / size usedResult vs. classical baselineHardware today
    QAOA + Quantum Walk MixerKnapsack selection (hard budget/risk cap)Mixer keeps the search inside the feasible subspace11 qubits / 5-asset instanceFeasible; objective comparable to MILP & heuristic baselinesSimulator today
    HHLMean-variance (continuous weights, linear system)Budget & return constraints folded into the linear system via Lagrange multipliers11 qubits / 3-asset instanceRisk ≈0.43%/mo; ≈6.2×10⁻⁵ residual vs. a classical LU solveSimulator; ~100–500 logical qubits estimated for a practical edge
    Quantum annealingCardinality-constrained selection (K-of-N QUBO)Exact-count penalty term inside the QUBO objective10 qubits / 10-asset universeSharpe 0.123, ranked 2nd of 4 vs. classical baselinesSimulator; 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.

    Business Impact

    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.

    Faster scenario iteration

    5–20×

    More scenario runs per day at large asset counts, when state preparation and time evolution are efficient.

    HHL, mean-variance allocation

    Annual value vs. baseline

    $174,000

    Projected annual value add vs. an Equal-Weight benchmark on a $5M AUM book, for a 287% ROI.

    Quantum annealing, cardinality-constrained selection

    Research time saved

    60%

    Efficiency gain in candidate selection and rebalancing cycles versus manual screening.

    Quantum annealing, cardinality-constrained selection

    How it works

    One platform, three formulations: from your portfolio brief to quantum results, code, and a report

    01

    Describe

    Describe your portfolio problem — target return, a hard budget cap, or an exact K-of-N count — and we map it to a formulation

    02

    Confirm

    Confirm the matching algorithm — QAOA with a quantum walk mixer, HHL, or quantum annealing — and its key assumptions

    03

    Run

    Download the ready-to-run code; execute the chosen algorithm on a simulator with a fixed seed

    04

    Review

    Review allocation weights or selections, feasibility checks, and reproducible logs

    05

    Benchmark

    Compare against the matching classical baseline — MILP, a direct linear solve, or Equal-Weight/Top-K — before moving to quantum hardware

    Frequently Asked Questions

    Is quantum portfolio optimization better than classical optimization?

    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.

    QAOA vs. quantum annealing for portfolio optimization — which should I use?

    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.

    How many assets can a quantum computer optimize today?

    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.

    What is the difference between HHL and QAOA for portfolio problems?

    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.

    Do I need real quantum hardware to see these results?

    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.

    How do I decide which formulation fits my portfolio?

    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.

    Run Quantum Portfolio Optimization Now

    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