What is this?
We take a classic "pick the best 3 stocks out of 36" portfolio problem
(maximize return, penalize risk) and encode it as a QUBO — a grid of yes/no decisions with
rewards and penalties that a quantum computer can chew on directly. QAOA (Quantum Approximate
Optimization Algorithm) prepares a quantum state where good portfolios are more likely to be measured, then
samples it. The classical brute-force answer is AMD + DE + PTC — so every run below tells
you honestly whether the quantum(-simulated) sampler found the same optimum, and what it cost.
Run Parameters
$0.00
estimated cost this run
loading budget…
Job History
| When (UTC) | Device | Shots | p | Status | Portfolio | Optimal? | P(opt) | Cost |
|---|---|---|---|---|---|---|---|---|
| loading… | ||||||||
Classical screen: best 3 of the S&P 500
Brute force — no quantum needed at this size; shown for scale contrast. Same objective as the QAOA demo above (maximize return, penalize risk, pick exactly 3, λ=5.0, 6 months of daily closes) — but run over the whole S&P 500 instead of 36 tickers, by exhaustively scoring every possible triple on a laptop CPU.
ALL + DELL + HUM
winning basket
20,833,250
triples evaluated — all C(501,3)
0.497 s
brute-force runtime (numpy, 1 core)
501 / 503
constituents covered
Winner stats (window 2026-02-09 → 2026-08-07, 125 trading days): equal-weight basket ran at +175.9% annualized return vs 34.6% annualized vol — Allstate (steady, 25.7% vol) ballasting Dell (+308% ann., 89.4% vol) and Humana (+155% ann., 43.6% vol). Backward-looking momentum + covariance, not investment advice.
Runners-up & method detail
| # | Basket | Objective | Ann. return | Ann. vol |
|---|---|---|---|---|
| 1 | ALL + DELL + HUM | 0.004609 | +175.9% | 34.6% |
| 2 | DELL + HUM + PYPL | 0.004605 | +182.1% | 36.4% |
| 3 | DELL + GRMN + HUM | 0.004535 | +185.4% | 37.7% |
| 4 | DELL + HUM + TRV | 0.004468 | +174.3% | 35.1% |
| 5 | DELL + HUM + PANW | 0.004458 | +211.8% | 44.6% |
| 6 | DELL + HUM + VLO | 0.004431 | +184.2% | 38.1% |
| 7 | DELL + HUM + TGT | 0.004430 | +175.0% | 35.6% |
| 8 | DELL + HUM + MPC | 0.004415 | +182.9% | 37.9% |
| 9 | DELL + GL + HUM | 0.004363 | +173.3% | 35.6% |
| 10 | DELL + HUM + MET | 0.004361 | +173.2% | 35.6% |
Universe: Wikipedia's S&P 500 constituent list (503 symbols; FDXF and HONA dropped — too little
trading history in the window). Objective per triple:
mean_return @ w − 5.0 · w @ cov @ w with w = 1/3 on the selected names —
identical to the 36-ticker QUBO, so scores are comparable. The exhaustive search is vectorized
per leading asset (numpy), single core. Full result:
quantum-lab-sp500.json · code: sp500_screen.py.
For contrast: a QAOA statevector over 501 assets would need 2501 amplitudes — the classical
screen is done before a quantum job would clear the queue. Quantum only gets interesting when the
constraint structure kills classical shortcuts, not at C(N,3).
Notes & method
Jobs are picked up by the lab runner (usually within a few minutes) — the page polls automatically.
QAOA is approximate: it boosts the probability of good portfolios rather than guaranteeing the best one,
so we post-select the lowest-energy valid sample and report
P(opt), the raw probability of
measuring the exact optimal bitstring. The QAOA instance uses a deterministic 12-asset subset of the
36-ticker universe (one qubit per asset) that contains the full-universe optimum, so the brute-force
benchmark is unchanged. Toy scale; not investment advice.