Skip to content
Front pageRaman Lamba

Finance · Quantum

Quantum Portfolio Optimization

Solo entry · Winner, Qiskit Fall Fest 2026

QAOA that picks stocks under a sector cap, checked against brute force and classical methods, and run on real IBM hardware.

Key figures

By the numbers

  • 3.7-20xvs penalty QAOA (12 stocks)
  • 184,756portfolios brute-forced (20 stocks)

The problem

Pick the best set of stocks for a portfolio: high return, low risk, a fixed number of stocks and, at the top level, a cap per sector. The search space grows quickly: 4,096 bitstrings at 12 stocks and 184,756 portfolios at 20.

The approach

QAOA with a mixer that keeps the number of stocks fixed and a start state made only of valid portfolios, so every sample is a valid answer. At 20 stocks a second design keeps both the count and the sector rule inside the circuit. Every result was checked against brute force, and the fast simulator was checked against the real Qiskit circuit.

The result

At 12 stocks the mixer beat penalty-based QAOA by 3.7 to 20 times and a random valid pick by 57 times, while greedy search stayed far cheaper, which the write-up says plainly. On the real ibm_fez chip, with error suppression, the 12-stock circuit gave a clear signal above noise.

Built with

Figures

Bar chart of the valid-portfolio rate on the ibm_fez chip for 8 and 12 stocks: pure noise against hardware runs with and without error suppression. At 12 stocks, p=1: 5.3% noise, 14.3% without, 15.2% with XY4 decoupling.
Share of hardware shots that were a valid portfolio, on IBM's ibm_fez chip. At 12 stocks (p=1) the rate was 15.2% with XY4 error suppression, about three times the 5.3% expected from pure noise; a noiseless simulator is 100% by construction.

Source code on GitHub