<- all posts
Directive 2026-07-22

Simulating the Tour de France on a 127-Qubit Quantum Processor

A Velogames roster is a multidimensional 0-1 knapsack, and knapsack is one of the benchmark problems QAOA is meant to own. The classical ILP solved it in 40ms. Real IBM hardware got to roughly 91% of optimal, and why it fell short is the actual result.

By AP39 / / 7 min read

Every July, the same optimization problem shows up disguised as a hobby: pick a Velogames roster of riders, stay under a 100-credit budget, maximize points across three weeks of racing. It's a constrained combinatorial optimization problem wearing a cycling jersey, and constrained combinatorial optimization problems have a very specific, very tempting property. They map almost directly onto the exact class of problem quantum annealing and gate-based quantum optimization were theoretically built to attack. So instead of doing what every sane fantasy cycling player does, guessing based on form and parcours, I formulated the entire roster selection as a 0-1 knapsack problem and ran it on a 127-qubit IBM quantum processor to see if the universe's most exotic computing hardware could out-draft a spreadsheet.

The honest answer, up front, is more interesting than a clean victory for quantum supremacy. But getting to that answer required actually building the thing, not just gesturing at it.

The Roster Problem, Stated as Math

Velogames constrains you to a fixed credit budget (100 credits) spread across a fixed roster size, drawing from a pool of riders each assigned a credit cost and, retrospectively, a points total based on real race results. Strip away the cycling-specific framing and the structure underneath is textbook 0-1 knapsack: a set of items (riders), each with a weight (credit cost) and a value (projected points), select a subset that maximizes total value subject to a total weight constraint, where each item is either fully included or fully excluded.

The multidimensional part comes from Velogames' actual rules, which don't just cap total credits, they also require specific slot categories to be filled (a mix of All-Rounders, Climbers, Sprinters, Unclassed riders, and a mandatory pick from one of the weaker teams). That turns a single-constraint knapsack into a multidimensional one: every rider carries not just a cost and a value, but a category vector, and the optimizer has to satisfy the budget constraint and every category-count constraint simultaneously.

Classically, this is expressed as an integer linear program:

maximize:   sum(value[i] * x[i] for i in riders)
subject to: sum(cost[i] * x[i] for i in riders) <= 100
            sum(x[i] for i in category[c]) == slot_count[c], for each category c
            x[i] in {0, 1}

That formulation, handed to a classical ILP solver, is not hard. It's the kind of problem branch-and-bound solvers chew through in well under a second for a rider pool in the low hundreds. Which raises the obvious question of why bother with a quantum processor at all, and the honest answer is curiosity plus the fact that this exact problem class, constrained knapsack, is one of the standard benchmark problems the quantum optimization community itself uses to demonstrate QAOA. If it was going to prove itself anywhere, it was going to be here.

From Knapsack to QUBO to a Hamiltonian

Gate-based quantum optimization via QAOA doesn't take a linear program as input. It needs the problem reformulated as a QUBO, a quadratic unconstrained binary optimization problem, which then maps onto an Ising Hamiltonian the quantum circuit can actually encode as qubit interactions. That reformulation is where most of the real engineering effort went, not in the quantum circuit itself.

Constraints in a QUBO aren't enforced structurally, the way they are in an ILP solver. They're enforced by penalty terms added into the objective function, weighted heavily enough that any solution violating a constraint scores worse than any valid solution, no matter how good its raw point total looks. The budget constraint became a penalty term:

penalty_budget = lambda_budget * (sum(cost[i] * x[i] for i in riders) - 100) ** 2

Squaring the constraint violation is what turns a linear inequality into a quadratic penalty a QUBO can express, and choosing lambda_budget correctly turned out to be its own delicate balancing act: too small, and the optimizer happily blows the budget in exchange for a few extra points; too large, and the penalty term dominates the landscape so completely that the optimizer stops caring about maximizing points at all, it just desperately avoids the penalty. Each category slot constraint needed its own analogous quadratic penalty term, and getting five or six of these penalty weights tuned relative to each other, and relative to the actual point-value scale of the objective, ate more debugging time than the quantum circuit itself.

Once assembled, the full QUBO for even a modestly-sized rider pool, around 80 real riders considered for selection, required one qubit per rider as a binary decision variable, comfortably within the 127-qubit budget of the processor, at least in terms of raw qubit count.

Running QAOA on Real Hardware

QAOA works by alternating layers of a "cost" unitary, derived directly from the QUBO's Hamiltonian, with a "mixer" unitary that lets the quantum state explore across different candidate solutions, repeated for p layers, with 2p classical parameters tuned by a classical optimizer running alongside the quantum circuit in a hybrid loop.

from qiskit_optimization.applications import Knapsack
from qiskit_algorithms import QAOA
from qiskit_algorithms.optimizers import COBYLA
from qiskit.primitives import Sampler

qaoa = QAOA(sampler=Sampler(), optimizer=COBYLA(maxiter=200), reps=3)
result = qaoa.compute_minimum_eigenvalue(qubo_hamiltonian)

reps=3 (three QAOA layers, p=3) was already a compromise. More layers generally improve the quality of the approximation the circuit can reach, but every additional layer adds circuit depth, and circuit depth on real NISQ-era hardware is where the entire experiment's honesty gets tested. Each additional layer means more two-qubit gates, and every two-qubit gate on current superconducting hardware carries a non-trivial error rate, somewhere in the range of a fraction of a percent per gate depending on which physical qubits are involved. Stack enough of them across 80 problem qubits worth of interaction terms and the cumulative decoherence across the circuit's depth starts eating into the signal before the algorithm ever gets a chance to converge on a good answer.

Getting an 80-variable QUBO's interaction graph mapped onto the actual physical qubit connectivity of the processor required transpilation with substantial SWAP gate insertion, since the QUBO's interaction graph (every rider potentially penalized against every other rider sharing a category constraint) is far denser than the physical hardware's native qubit-to-qubit connectivity. Every inserted SWAP gate is itself built from multiple two-qubit gates, meaning the effective circuit depth actually executed on hardware ballooned well past the "3 layers" the algorithm nominally specified.

The Result, Honestly Reported

The classical ILP solver found the provably optimal roster, the mathematically best possible combination under every constraint, in about 40 milliseconds. The QAOA run on real IBM hardware, after roughly 200 hybrid optimization iterations and a meaningful queue wait for hardware time, returned a sampled distribution over candidate bitstrings, and the best bitstring pulled from that distribution scored approximately 91% of the classically optimal roster's projected points, while occasionally sampling constraint-violating solutions that had to be discarded entirely.

That's not a quantum failure in any deep sense, it's exactly the outcome the current state of NISQ-era hardware predicts. QAOA on a problem this size, at this circuit depth, on hardware with today's gate error rates, isn't trying to prove it can beat a 40-millisecond classical solve. Nobody serious in the field currently claims it can, for a problem this small. The actual research value of running combinatorial optimization on near-term quantum hardware lives in a different place: characterizing exactly how solution quality degrades as problem size and circuit depth scale, and how far current hardware still sits from the fault-tolerant regime where these algorithms are expected to eventually matter.

The Actual Takeaway

Running a Velogames roster through a genuine 127-qubit quantum processor wasn't really a story about beating a spreadsheet. A spreadsheet, or more precisely a well-implemented branch-and-bound ILP solver, remains the objectively correct tool for this exact problem today, by a margin measured in orders of magnitude, both in solve time and in guaranteed optimality. Nothing about that changes because the quantum run was novel.

What it did produce was a very concrete, hands-on encounter with the actual gap between where quantum optimization theory currently stands and where fault-tolerant, error-corrected hardware would need to be for that theory to translate into a practical advantage on a problem this size. The QUBO formulation was clean. The Hamiltonian mapping was correct. The circuit ran, sampled, and converged toward a decent, non-trivial answer. It just wasn't a better answer, and understanding precisely why, gate error rates compounding across transpiled circuit depth, penalty term tuning fighting against a shallow variational landscape, is a far more honest and far more useful result than pretending the quantum processor won a race it was never actually equipped to enter yet.

The peloton, for now, remains more efficiently optimized by branch-and-bound than by superposition.