ZKSF logo, a neon quantum brainZKSF
← All applications

Finance and trading

Portfolio optimisation: QAOA against the provable optimum

Choose exactly k assets from a universe of N to minimise risk against expected return. It is the Markowitz objective under a cardinality constraint, it is what a desk actually faces when a mandate caps the number of holdings, and unlike the unconstrained continuous version it is genuinely hard.

The ZKSF console program picker with Optimisation problem selected, the program kind a cardinality-constrained portfolio becomes

A portfolio is submitted as a Hamiltonian, not a circuit. Open the console

The short version

  • Enumeration returns a proof, QAOA returns a sample. A risk committee asking whether an allocation is the best available gets an answer from one and a shrug from the other
  • More qubits alone do not produce a win here. A few hundred assets is a size mixed-integer solvers already handle comfortably
  • Unlike chemistry, the classical cost does not blow up. So hardware progress never crosses it the way it eventually could for molecules

Run on our engines

A 12-asset portfolio choosing exactly 4 holdings, seed 20260902, whose provable optimum is 0.199796. On 25 September the same instance ran on exact.tpu, a Google TPU, which found that optimum. Submitted to each kind of compute we offer, on 16 and 25 September 2026 at 500 shots. Every figure below is a real job on the service, priced as any customer would be priced.

DeviceEngineKindQubitsResultCost
CPUmps.quimb.cpuCPU120.199796, the optimum certificatebest outcome$0.0001
CPUexact.cpuCPU120.247259, beats 97.6% certificate$0.0001
NVIDIAexact.gpuGPU120.251747, beats 96.4% certificate$0.0001
Rigettiqpu.rigettiQPU120.247730, beats 97.4% * certificate$0.5125
IQMqpu.iqm.garnetQPU120.221427, beats 99.2% certificate$1.025
IQMqpu.iqm.emeraldQPU120.245130, beats 98.0% certificate$1.100
Google Cloud TPUexact.tpuTPU120.199796, the optimum certificate$0.0776
Google Cloud TPUneural.tpuTPU—the penalised QUBO is diagonal, which is not the shape a neural ansatz is for—

Two superconducting quantum processors from IQM ran this portfolio optimisation: Garnet, a 20-qubit device, returned 0.221427, and Emerald, at 54 qubits, returned 0.245130. A tensor-network simulator on CPU found the provable optimum of 0.199796. Exact statevector simulation returned 0.247259 on CPU and 0.251747 on an NVIDIA GPU in our 24 GB tier.

Read the control before the comparison. The CPU and GPU statevector engines compute the identical distribution, so the gap between them contains no physics and is roughly half the spread across the whole table. On this draw IQM Garnet placed above both, which is consistent with sampling variation rather than evidence that quantum hardware outperforms exact simulation on cardinality-constrained portfolio selection.

* The Rigetti row is a separate sample of ours on this same instance, with the QAOA angles re-optimised for it. The steps are in the docs.

A note on the hardware certificates: they state Hellinger fidelity against the exact distribution. For an optimisation circuit that distribution is spread across many outcomes rather than concentrated on one, so the figure is low by construction and is not a measure of whether the device found a good answer. The result column above is.

The same problem is yours to run: every instance here is seeded, so it rebuilds exactly. Open the console and a cost estimate is free before anything executes.

Open in Colab

Run this benchmark yourself. The notebook rebuilds the exact seeded instance behind every figure on this page, in a browser tab, with nothing to install and no account. Read it on GitHub

Then run it on our engines

The notebook proves the numbers on free public packages. This is the step it does not cover: the same circuit on a certified engine, with a public certificate you can cite instead of citing ours.

pip install qsim-sdk

import qsim_sdk
client = qsim_sdk.Client(token="...")     # free account at app.zksf.org

client.estimate(circuit, shots=512)       # free, before you spend anything
job = client.run(circuit, shots=512)      # $0.0001 on CPU
job.certificate()                         # a public, verifiable URL

Here is one we ran, so you can see what comes back before signing up: 8d1d8b5f1e3042e3. It opens without an account. Note what it does and does not assert: it certifies that the simulation was exact and only shot noise applies, which is a statement about the engine. Whether the method found a good answer is settled by the comparison against enumeration above, not by the certificate.

The problem

Minimise x'Sx - lambda*mu'x over binary x with exactly k assets selected, where S is the covariance matrix and mu the vector of expected excess returns. The binary selection is what makes this NP-hard in general. The continuous version has a closed-form solution and needs no quantum computer, or indeed any solver.

Instances come from a seeded single-factor market model, so every asset loads on a common factor plus idiosyncratic noise, which reproduces the correlation structure real equity covariance has rather than an unrealistic random matrix. Seed 20260902, lambda = 1.0.

The classical baseline

Exhaustive enumeration of every k-subset. This is deliberately the strongest possible baseline rather than a heuristic. It returns the provable optimum, so the quantum method is measured against the best answer that exists. It also yields the full distribution of feasible portfolios, which lets us score the quantum result on a scale that stays meaningful when the optimum sits near zero.

The quantum method

QAOA at depth p = 1, 2 and 3, with the cardinality constraint imposed as a quadratic penalty, run on our exact statevector engine at 512 shots. Variational parameters were optimised by COBYLA with three restarts of 150 iterations each. Every circuit evaluation inside that loop is counted below, because the optimiser is the real cost of a variational algorithm and a benchmark that reports only the final circuit understates it by two orders of magnitude.

Results

Measured 2 September 2026. norm is where the answer sits between the best and worst feasible portfolio, so 0.0000 is the optimum. beats is the percentage of all feasible portfolios it beats.

NkpPortfoliosClassicalTimeQAOATimeEvalsnormbeats
1031120-0.1747160.001 s-0.1220696.2 s500.077298.3%
1032120-0.1747160.002 s-0.17471615.5 s1090.000099.2%
1033120-0.1747160.002 s-0.17471622.5 s1410.000099.2%
12414950.1997960.006 s0.20103111.2 s800.001799.6%
12424950.1997960.006 s0.19979618.2 s1130.000099.8%
12434950.1997960.011 s0.20103126.5 s1580.001799.6%
14411,0010.0004950.007 s0.00049510.2 s780.000099.9%
14421,0010.0004950.007 s0.00049516.5 s1100.000099.9%
14431,0010.0004950.006 s0.03852031.8 s1570.042799.8%
16514,368-0.0162670.056 s0.19113215.4 s850.099599.7%
16524,368-0.0162670.054 s0.19165823.1 s1060.099799.6%
16534,368-0.0162670.062 s-0.01626738.1 s1530.0000100.0%

The same circuit on five engines

Those are the runs in the table at the top of this page: the p=2 circuit above, submitted unchanged to three simulators and two real superconducting processors at 500 shots each. Two things about them are worth drawing out.

Read the control before the ranking. exact.cpu and exact.gpu compute the identical distribution, so the gap between them, 0.2473 against 0.2517, contains no physics at all. It is one 500-shot draw against another, and it is about half the spread across the whole table. Most of what you see here is sampling, not the machine.

What survives that caveat is worth stating plainly. A 12-qubit, depth-39 circuit with dense couplings ran on real superconducting hardware and came back usable, and IQM Garnet returned roughly twice as many feasible portfolios as the simulators did. We expected hardware noise to dominate at this depth and it did not. We have no explanation for the feasibility difference that we would stand behind, so it is reported rather than accounted for.

What the numbers say

QAOA found the provable optimum in 6 of 12 runs, and in every single run it returned a portfolio in the top 2 percent of all feasible portfolios. As a heuristic it works.

It is also roughly a thousand times slower. At N = 16 exhaustive enumeration returns the proven optimum in 0.06 seconds. QAOA takes 15 to 38 seconds and between 85 and 153 circuit evaluations to reach an answer that is sometimes optimal and sometimes 10 percent of the way toward the worst portfolio available.

And it cannot prove anything. This is the distinction that matters most for a mandate. Enumeration returns the optimum and a proof that nothing better exists.

QAOA returns a good portfolio with no certificate of optimality, so a risk committee asking "is this the best allocation available" gets an answer from one method and a shrug from the other.

Depth did not reliably help. Higher p contains lower p as a special case, so p = 3 scoring worse than p = 2 at N = 12 and N = 14 is the classical optimiser failing to converge in a larger parameter space, not a property of the algorithm. That fragility is itself a finding: QAOA quality here is governed by parameter optimisation rather than by circuit depth.

Where the classical method stops

The interesting question is not which method scores better at N = 16, where enumeration returns a proof. It is how far enumeration goes before it becomes impossible.

UniversePortfolios to checkEnumeration time
N = 30, k = 85,852,9250.59 s
N = 40, k = 10847,660,5281.4 min
N = 50, k = 12121,399,651,1003.4 h
N = 60, k = 1553,194,089,192,72062 days
N = 80, k = 203.5 x 10^1811,000 years

Estimated at 10 million subset evaluations per second.

The caveat, and it is a large one

Enumeration dying around N = 50 does not mean quantum computing has an opening at N = 50. No desk enumerates. Production practice is mixed-integer quadratic programming with branch and bound, which prunes the search tree and handles universes in the hundreds or thousands routinely, returning either the optimum or a bound on how far from it you are.

We use enumeration here precisely because it proves optimality at sizes we can also run on a quantum engine, which makes the comparison exact. The real classical frontier sits far beyond it. Any argument that quantum computing is about to become useful for portfolio construction has to beat Gurobi or CPLEX at N in the hundreds, not enumeration at N = 50.

Meanwhile the quantum side has its own ceiling. QAOA at N = 50 needs 50 qubits, which is past exact statevector simulation, and hardware at that width today carries error rates that would swamp the objective differences we are resolving here at the fifth decimal place.

What would have to change

For this to become a real decision rather than an experiment, three things need to happen together: hardware wide enough for the universe you actually trade, error rates low enough that the objective function survives the circuit, and a parameter optimisation strategy that does not degrade as the problem grows. None of the three is close today, and the third is a software problem that could be solved before the hardware arrives.

The number to watch is not qubit count. It is two-qubit gate fidelity, because that is what determines whether a deep enough QAOA circuit returns signal or noise. On that measure the field has moved: the best reported two-qubit fidelity is now 99.99 percent, and 96 logical qubits have been demonstrated from 448 physical ones.

Even so, more qubits alone do not produce a win here, and this is the part worth being clear about. The 2029 roadmaps target hundreds of logical qubits, which would allow QAOA on a few hundred assets. A few hundred assets is a size mixed-integer solvers handle comfortably today.

Unlike chemistry, where the classical cost grows exponentially and hardware progress eventually crosses it, portfolio optimisation has a classical method that scales with the problem. The quantum side has to overtake a moving target rather than a stationary one.

What you can run here

A cardinality-constrained selection becomes a QUBO and then a Pauli Hamiltonian, which Optimisation problem takes directly and solves with its own loop. If you would rather keep your optimiser, send each step as one job with run_sweep instead of one submission per evaluation. The evaluation count, not the circuit, is what a variational run actually costs. Twenty-four qubits is twenty-four assets, which is why the study above is a method comparison rather than a portfolio you would trade.

For context: where the hardware actually is

Gaps on this page are quoted against the processors ZKSF can run. That is not the frontier. Quantinuum, IBM, Atom Computing and QuEra’s newest systems are not available through us, and those machines are considerably further along. As of September 2026:

Physical qubits built

Infleqtion Sqale1,600Neutral atom
Atom Computing1,180Neutral atom, 1,225 sites
IBM Condor1,121Superconducting, 2023
IBM Heron R2156Superconducting, ~99.5% two-qubit fidelity
Rigetti Cepheus108The largest available through ZKSF

Two-qubit gate fidelity

The number that actually governs what a circuit can do.

IonQ99.99%Trapped ion, first past four nines
Silicon Quantum Computing99.99%Silicon spin
Quantinuum99.97%Trapped ion, all-to-all
IQM99.91%Superconducting, available through ZKSF

Logical qubits demonstrated

Published results, not roadmap targets.

QuEra96 logical / 448 physicalNeutral atom
Quantinuum48 logical / 98 physicalTrapped ion, iceberg code
Atom Computing24 logicalOn the 1,180-qubit system
Google1 logical / 105 physicalSurface code, below threshold

Announced roadmap

Targets. Roadmaps slip, and these are not results.

Quantinuum Sol, 2027192 physical, ~100 logicalIceberg code, distance 2. Error detection with postselection, not correction
IBM Starling, 2029~200 logicalBivariate bicycle qLDPC, 100 million gates
Quantinuum Apollo, 2029hundreds of logicalThousands of physical, logical error 1e-6 or better

Run this on your own universe.

Load the QAOA template into the console, replace the instance with your own covariance and returns, and export a certificate for your own run. The estimate is free and shows the cost before anything executes.

Related reading: QAOA explained, QAOA at 100 qubits, and what a quantum run actually costs.