Tech 7 min read

Quandoom: DOOM E1M1 on 72,376 qubits with reversible Toffoli gates and no quantum speedup

IkesanContents

Quandoom encodes DOOM’s first level as a quantum circuit.
The paper version uses 72,376 qubits and at least 80 million gates.
The screen is 320x200 monochrome pixels, and the final 64,000 qubits are measured directly to produce the display.

The first question that came to mind was “aren’t quantum computers only faster for specific problems?”
That’s mostly right. Quandoom is not a story about quantum computers making DOOM run faster.
It’s a demo where classical game logic has been forcibly rewritten to fit inside a quantum circuit.

Game state as qubit registers

Qubits can exist in superposition, but they also work as plain 0/1 bits.
Quandoom starts by using that property: player HP, ammo count, position, angle, enemy states, and screen output are all stored as qubit register arrays.

From the paper, health takes 9 qubits, ammoBullets takes 8, cosTheta takes 23, and outputPixels takes 64,000.
Nothing mysterious here. It’s basically signed integers and fixed-point numbers stored as bit strings.

HP 100 in 9 bits, player angle cosine in 23 bits, one qubit per screen pixel.
Up to this point the idea is no different from ordinary computer memory.

Building classical computation with Toffoli gates

Quandoom’s basic operations are addition, subtraction, comparison, equality checks, multiplication, and division.
These are all built around Toffoli gates.

A Toffoli gate flips a target bit only when both control bits are 1.
In classical logic terms it’s close to a conditional NOT: check an AND condition, flip another bit.

Chain enough of these together and you can build classical Boolean computation in reversible form.
Where a normal CPU would write if hp <= 0 then dead = 1, Quandoom sets up a comparison register, subtracts to check the sign bit, and flips the output bit conditionally.

The game logic itself is unremarkable.
Accept input, handle movement, update enemy states, render walls and sprites.
The difference is that the target isn’t CPU instructions but a massive QASM circuit generated by QuandoomEngine.

Quantum circuits struggle with discarding intermediate values

Normal programs throw away intermediate values freely.
You can write x = min(x + 1, 5) without a second thought.

Quantum circuits can’t do this.
Quantum gates are fundamentally reversible; the output must be able to recover the input.
If 4 -> 5 and 5 -> 5 collapse to the same result, there’s no way to tell whether the original value was 4 or 5.

This constraint is why Quandoom’s visuals look oddly wireframe-like, with walls showing through each other.
Screen pixels aren’t “set to black” but “flipped.”
When lines overlap they flip again and vanish.
Cleanly culling occluded surfaces via a Z-buffer doesn’t mix well with reversibility.

The paper explains that drawing only the frontmost objects requires pre-rendering each object, outputting only visible ones, and then uncomputing the intermediate results.
Uncompute means running the circuit in reverse to erase intermediate values back to their original state.
In quantum computation this cleanup is expensive.

DOOM-likeness is heavily baked in

Quandoom is not a mechanical translation of DOOM’s source code into quantum gates.
The author writes that the original DOOM code was not used; instead, a rendering engine that works with reversible gates was built from scratch.

Not everything is computed at runtime either.
Sprite scaling is pre-baked: the drawing circuit for each size is generated ahead of time.
The enemy-to-player line-of-sight raycast divides rooms into a coarse 10x10 grid with precomputed results.

This is close to what game developers call baking.
Where dynamic computation would make the circuit too complex, the generator expands it at build time.
The resulting QASM file is enormous, but the runtime circuit is just a pile of conditional bit flips.

Because of this trade-off, Quandoom is less “the DOOM engine ported to a quantum computer” and more “DOOM E1M1 rebuilt as a different engine that happens to run as a quantum circuit.”

Superposition only shows up for randomness

The big question is superposition.
It’s not the case that every possible player position exists simultaneously, all routes are explored in parallel, and one DOOM frame pops out when you measure.

Quandoom’s game state proceeds as essentially one classical state.
Superposition appears only in random processes: hit detection, enemy behavior, stun rolls.
At the start of the circuit, a random register gets Hadamard gates applied, and probabilistic branches are derived from there.

A Hadamard gate puts a 0 or 1 qubit into an equal superposition of 0 and 1.
In Quandoom, those random-use qubits are placed in unused portions of the screen register and measured/reset each frame.

This is why “a quantum computer game can be simulated at 10-20 fps on a laptop.”
Hadamard and Toffoli together form a computationally powerful gate set in general, but Quandoom is carefully designed so that negative phases and interference almost never arise.
Without interference, there’s no need to hold the entire exponential state vector; you can just sample by rolling a random number when a Hadamard is encountered.

Quantum speedup doesn’t come from “trying everything via superposition.”
It requires algorithms that make the branches interfere, cancel the amplitudes of wrong answers, and amplify the right ones.
Shor’s algorithm works that way. The quantum attacks on RSA and elliptic curves mentioned in the PQC article are a completely different story from running DOOM.

Quandoom barely uses interference.
So there is no quantum advantage.
In return, it is a valid quantum circuit that a classical simulator can also execute.

Real quantum hardware can’t run this yet

The GitHub README jokes about “only 70,000 qubits and 80 million gates,” but for today’s quantum computers that’s not small at all.
The precise figure from the paper is 72,376 qubits.
Running it as a game means applying a massive circuit every frame and measuring 64,000 qubits to produce the screen.

Running this with error correction on real quantum hardware in 2026 is not feasible.
The distributed version of Quandoom actually runs on a classical computer via a roughly 150-line C++ QASM simulator.
According to the README, it uses around 5-6 GB of RAM at startup while loading the large circuit file.

Vacuum fluctuations vs. simulation

Digging a bit deeper into why real qubits break, vacuum fluctuations come into the picture.

In quantum field theory, even empty vacuum has virtual particle-antiparticle pairs constantly appearing and annihilating.
The Casimir effect (an attractive force that appears when two metal plates are placed extremely close together in a vacuum) is one experimental result demonstrating that vacuum fluctuations are real.
True emptiness doesn’t exist in quantum physics.

These fluctuations act as a noise source for qubits.
The phenomenon where a qubit loses its superposition state is called decoherence, and its causes range from thermal noise, electromagnetic interference, and imperfect control pulses, among others.
Vacuum fluctuations are one such cause: the electromagnetic field around a qubit fluctuating at zero-point energy disturbs the qubit’s state.
For superconducting qubits, coherence time is on the order of tens to hundreds of microseconds.
The computation must finish within that window or the result falls apart.

Real quantum computers deal with this through quantum error correction.
A single logical qubit is redundantly encoded across many physical qubits, detecting and repairing corrupted bits as computation proceeds.
A typical surface code needs roughly 1,000 physical qubits per logical qubit, so Quandoom’s 72,376 logical qubits would require over 70 million physical qubits.
The largest processors in 2026 are in the 1,000-qubit range, four orders of magnitude short.

In simulation this entire problem vanishes.
A classical simulator holds qubits as complex-number amplitudes, purely mathematically.
No physical medium means no vacuum fluctuations, no decoherence.
No error correction needed; the circuit produces perfect results by definition.
Quandoom running on a laptop comes down to two things: no interference means classical sampling suffices, and the qubit decay that would be fatal on real hardware simply doesn’t exist in simulation.


Nobody needs this to actually run on real hardware, so that’s fine.

References