Project Showcase: Quantum Market Game
Aadarsh Venkat Ramanan built a quantum twist on the prisoner's dilemma: two traders are two qubits, held in a superposition of buy and sell, and entangled into outcomes classical game theory cannot reach.

The Quantum Market Game takes the classic prisoner's dilemma and runs it on a quantum computer. Two traders each decide to buy or sell, but here they are qubits, held in a superposition of both at once.
Turn on entanglement and their choices become linked, so the game settles into outcomes that simply do not exist in classical game theory. It is built for students who know some math but have never touched quantum computing, and it is the work of Aadarsh Venkat Ramanan, a rising high-school senior in Frisco, Texas, who found his way into quantum through an unusually good introduction.
I got into quantum through a meeting with Marco Pistoia, who worked with my mom at JP Morgan Chase. He taught me the basics, I became really interested, and I did summer research at the University of Texas at Dallas.
Built by
A market in superposition
In the classical prisoner's dilemma, two players each make one discrete choice and a payoff table decides who wins. Aadarsh kept that skeleton but swapped the players for traders and the choices for quantum states. Each trader is a qubit, and instead of committing to buy or sell, they sit in a superposition of both, weighted by a probability the player controls.
You drive the game by setting those probabilities, then watching what the market does. Crucially, you can also flip entanglement on and off, and that switch is the whole point: with it on, one trader's leaning toward buying pulls on the other's outcome, producing correlations no pair of independent classical players could show.
The novelty comes from using quantum-mechanics principles in a classical prisoner's dilemma. It lets the players reach final outcomes that are not possible in classical game theory.
That makes the two hardest ideas in quantum computing something you can feel by playing. Superposition is the trader who has not decided yet; entanglement is the toggle that ties two traders' fates together.
Two qubits, two traders
The circuit underneath is small enough to read in one sitting, which is the point. Each trader gets one rotation that sets their buy/sell mix, an optional entangling gate links them, and a measurement opens the market. On Qollab it runs on a simulator or real IonQ hardware exactly as written:
# 'backend' is pre-created from the "Select QPU" dropdown below.
from qiskit import QuantumCircuit
from qiskit.providers.jobstatus import JobStatus
import numpy as np, time
# Payoff for (trader 1, trader 2) by outcome — 0 = sell, 1 = buy.
PAYOFF = {"00": (-1, -1), "01": (3, 1), "10": (1, 3), "11": (2, 2)}
def market(angle_1, angle_2, entangle):
qc = QuantumCircuit(2, 2)
qc.ry(angle_1, 0)?Superposition. Each trader is one qubit. The RY angle sets their mix of sell (0) and buy (1): 0 is a certain sell, π a certain buy, π/2 a 50-50 market. qc.ry(angle_2, 1)
if entangle:
qc.cx(0, 1)?Entanglement. The optional CNOT links the two traders, so one trader's outcome shifts the other's: the correlations classical game theory can't produce. qc.measure([0, 1], [0, 1])?Open the market. Measurement collapses the superposition to one outcome per shot: 00, 01, 10, or 11. return qc
qc = market(np.pi/2, np.pi/2, entangle=True) # both undecided, entangled
job = backend.run(qc, shots=1000)?Runs on a simulator or real IonQ hardware through Qollab. Aadarsh used IonQ credits to compare the clean simulator against hardware noise.while job.status() is not JobStatus.DONE:
time.sleep(2)
counts = job.result().get_counts()
# Expected payoff across every possible market
ep1 = ep2 = 0.0
for bits, c in counts.items():
p1, p2 = PAYOFF[bits]
ep1 += (c / 1000) * p1; ep2 += (c / 1000) * p2?A prisoner's-dilemma payoff scores each outcome: both buy (11) is the cooperative square, a lone move pays the most. The quantum game blends these across the whole distribution.print(f"Expected payoff — trader 1: {ep1:.2f}, trader 2: {ep2:.2f}")
The Quantum Market Game is open source, built to be forked and extended.
| Field | Detail |
|---|---|
| Frontend | Streamlit, a browser app where you set the probabilities and toggle entanglement. |
| Quantum | Qiskit, a two-qubit circuit, RY state prep plus an optional CNOT. |
| Backends | Aer simulator, with IonQ runs to compare against hardware noise. |
| Payoffs | A prisoner's-dilemma matrix scored over the measured distribution. |
It is deliberately a teaching object rather than a trading model. In the code, the thing a learner changes is the probability of buying or selling; under the hood, that probability becomes the rotation angle on the qubit, so playing with the game and reading the circuit teach the same idea from two directions.
Where it's headed
The current build is intentionally minimal: two traders, two qubits, one clean payoff table. Aadarsh sees it as a starting point rather than a finished thing.
Right now the game involves two traders and two qubits. In the future this could involve more complex market situations and more traders, and we could add real assets and information to make it more realistic.
That trajectory is also the argument for why a toy matters. A two-qubit market is small enough to understand completely and structured enough to grow, which makes it a clean baseline for thinking about where quantum methods might eventually touch real financial scenarios, the same territory Aadarsh has been exploring in his own research on option pricing and market-regime detection.
Make it yours
The game is open and forkable on Qollab, the full code is on GitHub, and you can play it in your browser right now. Change the probabilities, flip entanglement on and off, and watch the payoffs move, then open the circuit and rewrite the rules yourself.
People should care because this is a baseline for future quantum use cases in finance, and it lets people learn the basic principles of quantum mechanics in an intuitive way, creating curiosity and further learning.
Put two traders in superposition, then entangle them.
Fork the Quantum Market Game, set the odds, toggle entanglement, and run it on real hardware. Everything here is open and yours to build on.
More from the Qollab community
Browse all projectsStay in the loop.
Get the latest tutorials, demos, and project showcases straight to your inbox. No noise, just the good stuff.
