Quantum Portfolio Optimisation Explained

Educational Content: The information provided here is for educational purposes only and should not be considered financial advice. Always consult with qualified financial professionals before making investment decisions.

What is Quantum Portfolio Optimisation?

Quantum portfolio optimisation applies quantum algorithms to the hardest part of building a portfolio: choosing which assets to hold. The choice is written as a QUBO (quadratic unconstrained binary optimisation) problem. Each asset becomes a yes or no decision, and the cost combines expected return, risk from the covariance matrix and a penalty for holding the wrong number of assets.

There are two main quantum routes. Gate-based quantum computers and their simulators run QAOA, the Quantum Approximate Optimisation Algorithm. Quantum annealers search the same QUBO by slowly evolving a physical system. Quantum-inspired methods such as simulated annealing borrow the idea but run entirely on classical computers. QuantumFira runs QAOA on Amazon Braket and compares every result with a classical Markowitz portfolio.

QUBO Formulation

Each asset is a binary variable. The QUBO matrix holds risk (covariance), expected return and the budget penalty, so the best selection is the one with the lowest cost.

QAOA (Gate-Based)

Alternates cost and mixer layers on qubits, with gate angles tuned by a classical optimiser. Measuring the circuit gives candidate asset selections to evaluate.

Quantum Annealing

Starts in a simple ground state and slowly changes it into the QUBO's energy landscape, aiming to finish in the lowest-cost selection.

Simulated Annealing

A classical, quantum-inspired heuristic that "cools" gradually and sometimes accepts worse moves (the Metropolis rule) to escape local optima.

Modern Portfolio Theory and the Efficient Frontier

Modern Portfolio Theory (MPT), developed by Harry Markowitz in 1952, is a framework for constructing portfolios to maximise expected return for a given level of risk.

Core Principles:

  • Diversification: Spreading investments across different assets reduces overall portfolio risk without sacrificing expected returns.
  • Risk-Return Tradeoff: Higher potential returns typically come with higher risk. The goal is to optimise this tradeoff.
  • Efficient Frontier: The set of optimal portfolios that offer the highest expected return for a defined level of risk.
  • Correlation: Assets that don't move together (low correlation) provide better diversification benefits.
The Optimisation Problem: Finding the best weights for a fixed set of assets is a smooth problem that classical solvers handle well. Choosing which assets to hold is harder: 20 stocks already give over a million possible selections. That combinatorial step is what quantum methods such as QAOA target.

Portfolio Risk Metrics: Volatility, Drawdown, VaR and Beta

Understanding and managing risk is crucial for long-term investment success. Here are key risk metrics:

Metric Description Interpretation
Volatility Standard deviation of returns Lower is generally better (less uncertainty)
Max Drawdown Largest peak-to-trough decline Shows worst-case historical loss
VaR (95%) Value at Risk at 95% confidence Maximum expected loss 95% of the time
Beta Sensitivity to market movements >1 means more volatile than market

QAOA Portfolio Optimisation: How the Algorithm Works

QAOA (the Quantum Approximate Optimisation Algorithm) is the core algorithm behind QuantumFira's quantum portfolio optimisation. Developed by Farhi, Goldstone and Gutmann in 2014, it is designed to find good approximate solutions to combinatorial optimisation problems such as asset selection.

In QuantumFira, the QAOA circuit for your stock list runs on Amazon Braket's SV1 quantum circuit simulator. The most promising selections are then given weights by a classical maximum Sharpe ratio step, and the result is shown beside a classical mean-variance portfolio.

How QAOA Works

QAOA alternates between two operations: a "cost" layer that encodes the optimisation objective, and a "mixer" layer that explores different solutions. The depth (p) controls solution quality vs. computation time.

Variational Parameters

QAOA uses classical optimisation to tune quantum gate angles (γ and β). These parameters control how much the cost function influences the state and how much mixing occurs.

Cost Hamiltonian

For portfolio optimisation, the cost encodes expected return, risk from the covariance matrix and a budget penalty. Better selections correspond to lower energy states, which the algorithm seeks.

Measurement & Sampling

After applying QAOA layers, we measure the qubits multiple times. The most frequently observed states typically correspond to good portfolio allocations.

Why QAOA for Finance? Choosing which assets to hold under a budget can be written as a quadratic unconstrained binary optimisation (QUBO) problem. QAOA is built for exactly this kind of binary problem, which is why it is the most studied gate-based approach to portfolio optimisation.

Understanding Qubits

Unlike classical bits (0 or 1), qubits can exist in superposition, representing multiple portfolio weights simultaneously until measured.

Superposition

A qubit can be in a combination of |0⟩ and |1⟩ states. This allows exploring many portfolio combinations in parallel before collapsing to a single answer.

Entanglement

Qubits can be correlated so measuring one affects others. This encodes relationships between assets, like how tech stocks tend to move together.

Quantum Interference

Probability amplitudes can add (constructive) or cancel (destructive). QAOA uses this to amplify good solutions and suppress bad ones.

Decoherence

Real quantum hardware suffers from noise that degrades qubits over time. Circuit depth must balance solution quality against error accumulation.

Quantum Portfolio Optimisation on IBM Quantum Hardware

Simulators such as Amazon Braket's SV1 compute a circuit exactly, which makes them the right place to compare methods. Real quantum processors, such as those on the IBM Quantum Platform, add gate noise, limited qubit connectivity and queue times, so a portfolio circuit has to be adapted before it runs on hardware.

Fira Software's quantum portfolio research has been validated on IBM Quantum hardware. Quantum reinforcement learning agents for portfolio rebalancing were run through Qiskit Runtime on ibm_fez, a 156-qubit IBM Heron r2 superconducting processor, and compared with the same circuits on a noise-free simulator.

Transpilation

Before a circuit runs on an IBM processor, Qiskit rewrites it into the device's native gates and maps each logical qubit onto physical qubits that are wired together. Deep QAOA circuits grow during this step, so the depth p is kept small on hardware.

Qiskit Runtime

IBM's service for running circuits. The Sampler primitive returns measured bitstrings, which for a portfolio QUBO are candidate asset selections; the Estimator primitive returns expectation values for training variational circuits.

Noise and Error Mitigation

Hardware results carry readout and gate errors. Measurement twirling and readout error mitigation reduce their effect without full quantum error correction.

Simulator First, Hardware Second

Each hardware run is checked against the same circuit on a simulator, so any difference in Sharpe ratio, return or drawdown can be traced to noise rather than to the model.

Portfolio Optimisation Strategies

Understanding different investment approaches helps you make informed decisions about portfolio construction and optimisation objectives.

Portfolio Construction Approaches

Mean-Variance Optimisation

The classic Markowitz approach: maximise expected return for a given risk level. Forms the basis of Modern Portfolio Theory and the efficient frontier.

Risk Parity

Allocate so each asset contributes equally to portfolio risk. Often results in higher bond allocations than traditional 60/40 portfolios.

Maximum Sharpe Ratio

Find the portfolio with the highest risk-adjusted return. This is QuantumFira's default objective, as it balances return and risk optimally.

Minimum Variance

Minimise portfolio volatility regardless of return. Useful for conservative investors or uncertain market conditions.

Black-Litterman Model

Combines market equilibrium with investor views. Allows you to tilt the portfolio based on your beliefs while staying diversified.

Factor Investing

Target specific return drivers like value, momentum, quality, or low volatility. Factors have historically provided excess returns over market cap weighting.

Rebalancing Strategies

Strategy Description Best For
Calendar Rebalance on fixed schedule (monthly, quarterly) Simplicity, low monitoring
Threshold Rebalance when weights drift beyond tolerance (e.g., ±5%) Volatile markets, tax efficiency
Tactical Adjust based on market conditions or signals Active management, momentum
Buy-and-Hold No rebalancing, let winners run Tax-sensitive accounts, long horizons

Backtesting a Portfolio Optimisation

Backtesting applies a strategy to historical data to evaluate how it would have performed. It's essential for validating optimisation results before real deployment.

In-Sample vs Out-of-Sample

In-sample data trains the model; out-of-sample data tests it. Never evaluate performance on training data, as this overstates results.

Walk-Forward Analysis

Rolling window approach: optimise on past N months, test on next month, then roll forward. More realistic than single train/test split.

Transaction Costs

Real trading incurs costs: commissions, spreads, slippage. A backtest without costs overstates performance, especially for frequent rebalancing.

Survivorship Bias

Using only current stocks ignores delisted companies. This makes backtests look better than reality, as failures are excluded.

Key Backtest Metrics

Metric What It Measures Watch Out For
CAGR Compound annual growth rate Can be skewed by start/end dates
Max Drawdown Worst peak-to-trough decline Single worst period may not recur
Calmar Ratio CAGR divided by max drawdown Combines return and tail risk
Win Rate Percentage of profitable periods Ignores magnitude of wins/losses
Profit Factor Gross profits / gross losses >1 needed to be profitable
Overfitting Warning: A strategy that performs amazingly in backtests but fails live is likely overfit. Use out-of-sample testing, limit free parameters, and be skeptical of Sharpe ratios above 2.0 without clear economic rationale.

Glossary of Terms

Sharpe Ratio
Definition: A measure of risk-adjusted return, calculated as (Return - Risk-Free Rate) / Standard Deviation.

Example: A Sharpe ratio of 1.5 means the portfolio earns 1.5 units of return for each unit of risk taken.

Good Value: Generally, above 1.0 is considered good, above 2.0 is very good.
Sortino Ratio
Definition: Similar to Sharpe ratio but only penalizes downside volatility.

Why it matters: Investors typically care more about downside risk than upside volatility.

Calculation: (Return - Target Return) / Downside Deviation
Alpha
Definition: The excess return of an investment relative to a benchmark index.

Example: An alpha of 2% means the portfolio outperformed its benchmark by 2%.

Note: Positive alpha suggests skill or superior strategy.
Covariance Matrix
Definition: A matrix showing how different assets move together.

Usage: Essential for portfolio optimisation, helps identify diversification opportunities.

Reading it: High positive values indicate assets move together; negative values indicate inverse movement.
Efficient Frontier
Definition: The set of optimal portfolios offering the highest expected return for each level of risk.

Visualization: Typically shown as a curve on a risk-return plot.

Goal: Portfolios below this curve are suboptimal.
Beta
Definition: Measures an asset's sensitivity to market movements.

Interpretation: Beta of 1.0 = moves with market. Beta > 1 = more volatile. Beta < 1 = less volatile. Beta < 0 = moves opposite to market.

Example: A stock with beta 1.5 tends to rise 15% when the market rises 10%.
Treynor Ratio
Definition: Measures excess return per unit of systematic (market) risk.

Formula: (Portfolio Return - Risk-Free Rate) / Beta

Use case: Best for comparing portfolios that are part of a larger diversified portfolio.
Information Ratio
Definition: Measures risk-adjusted return relative to a benchmark.

Formula: (Portfolio Return - Benchmark Return) / Tracking Error

Interpretation: Higher is better. Above 0.5 is good, above 1.0 is excellent.
QAOA
Definition: Quantum Approximate Optimization Algorithm. A hybrid quantum-classical algorithm for combinatorial optimisation.

How it works: Alternates between quantum "cost" and "mixer" layers, with classical optimisation tuning the parameters.

Application: Ideal for portfolio optimisation as it naturally maps to QUBO problems.
Qubit
Definition: The fundamental unit of quantum information, analogous to a classical bit.

Key property: Can exist in superposition of |0⟩ and |1⟩ states simultaneously.

Portfolio context: Each qubit can represent a binary decision (e.g., include asset or not).
Superposition
Definition: A quantum state that is a combination of multiple basis states at once.

Advantage: Allows exploring many portfolio combinations simultaneously before measurement collapses to one answer.

Analogy: Like spinning a coin that is both heads and tails until it lands.
Maximum Drawdown
Definition: The largest peak-to-trough decline in portfolio value before a new peak.

Example: If portfolio goes from $100K to $70K then recovers to $120K, max drawdown is 30%.

Why it matters: Shows the worst historical loss an investor would have experienced.
VaR (Value at Risk)
Definition: The maximum expected loss over a time period at a given confidence level.

Example: 95% VaR of $10,000 means there's a 5% chance of losing more than $10,000.

Limitation: Doesn't tell you how bad the loss could be in that 5% of cases.
Correlation
Definition: A measure of how two assets move together, ranging from -1 to +1.

Values: +1 = perfect positive correlation, 0 = no correlation, -1 = perfect negative correlation.

Diversification: Lower correlations between assets provide better diversification benefits.
Rebalancing
Definition: Adjusting portfolio weights back to target allocations.

Why needed: Asset price changes cause weights to drift from optimal levels.

Trade-off: More frequent rebalancing maintains targets but incurs transaction costs and taxes.
Benchmark
Definition: A standard against which portfolio performance is measured.

Examples: S&P 500 for US equities, Bloomberg Aggregate for bonds, 60/40 for balanced portfolios.

Purpose: Determines whether active management adds value vs. passive investing.
Tracking Error
Definition: Standard deviation of the difference between portfolio and benchmark returns.

Interpretation: Higher tracking error = more deviation from benchmark. Low = closely follows benchmark.

Active vs Passive: Index funds target low tracking error; active managers accept higher for potential alpha.
CAGR
Definition: Compound Annual Growth Rate. The smoothed annual return that would produce the same total return.

Formula: (Ending Value / Beginning Value)^(1/years) - 1

Advantage: Accounts for compounding, making it easier to compare investments of different durations.
Risk-Free Rate
Definition: The theoretical return of an investment with zero risk, typically US Treasury bills.

Usage: Baseline for calculating excess returns (Sharpe ratio, alpha, etc.).

Current: Varies with monetary policy; check current Treasury yields for accurate calculations.

QAOA Portfolio Optimisation on Amazon Braket SV1

QuantumFira runs QAOA circuits on Amazon Braket's SV1 quantum circuit simulator. The workflow combines simulated quantum asset selection with classical weight allocation and a Markowitz baseline.

1. QUBO asset selection

The QUBO model encodes asset selection using expected returns, covariance and a selection constraint. QAOA searches for candidate selections on the SV1 simulator.

2. Classical weight allocation

A classical maximum Sharpe ratio step assigns weights to the selected assets. Asset selection and weight allocation are separate stages, so the final portfolio is a hybrid result.

3. Markowitz comparison

Compare the QAOA-based allocation with the classical mean-variance baseline. Review the Sharpe ratio, volatility and weights together, using the same inputs and historical period.

These simulator results do not establish quantum advantage or predict future returns. Historical estimates depend on the chosen assets, period and assumptions. Explore the quantum portfolio optimisation example, then compare QAOA and Markowitz allocations in the portfolio optimiser.