New: the online library.·Start reading

← Essays
May 3, 2026·5 min

Superposition as `while(true)`: quantum mechanics through an engineer's eyes

A generative loop in code gives a surprisingly precise intuition for wave function collapse and the delayed-choice quantum eraser. Where the metaphor stops and physics begins.

Anyone who has ever run a generative loop knows the feeling. While the loop runs, every possible continuation lives in it at the same time. Step in — drop a print, take a return, read a value — and from the whole bundle of branches only one survives. The others simply do not get recorded as "what happened."

That picture sits so close to what physics calls wave function collapse that the question suggests itself: is it a metaphor, or a hint about how the world is built?

What the formalism actually says

The Schrödinger equation evolves a state unitarily. That means that as long as nobody "looks," the system sits in a linear combination of possible outcomes with known amplitudes. Measurement is the only step that converts amplitudes into probabilities and lets one branch persist.

The equation does not describe that step; this is what is called the measurement problem. The Copenhagen interpretation (Bohr, Heisenberg) takes collapse as a primitive. Many-worlds (Everett, 1957) claims there is no collapse, only branching of the observer. Decoherence theory (Dieter Zeh in 1970, then Wojciech Zurek) gives a quantitative mechanism: interaction with the environment suppresses the off-diagonal entries of the density matrix and effectively "selects" a measurement basis. To the question "what is left after," decoherence is silent; it explains why we see definite states rather than their superpositions.

An engineer will recognise the mechanics of distributed systems here. While a transaction is running, the state is undefined. The commit fixes one slice. All other branches that opened along the way are discarded and never reach the final database. Decoherence is the analogue of losing transactional isolation: an external observer "sees" one branch because the intermediate states have ceased to be reachable.

That is still metaphor. From here it gets more interesting.

The delayed-choice quantum eraser

There is an experiment where the metaphor starts to crowd reality.

Scully and Drühl proposed the scheme in 1982. It uses pairs of entangled photons: one flies to the main screen, the second carries a "tag" — information about which slit the first went through. While the tag exists there is no interference at the main screen. Erase the tag and the interference returns. The erasure can be performed after the main photon has already hit the screen.

Kim and colleagues (Phys. Rev. Lett. 84, 1, 2000) built it in the lab. It has since been repeated in many variants, including on the superconducting qubits of cloud quantum computers, where the program itself decides whether to erase the tag after the main qubit has been "measured".

The experiment does not send information backward in time, and this is exactly where popular retellings go wrong. Erasing the tag regroups data already recorded: it changes the joint distribution between main screen and which-path channel, and interference appears in the subset selected by the new condition.

In machine-learning terms, measurement is the loss function and erasing the tag is a backward pass. Nothing arrives "from the future"; the pass recomputes joint statistics over a different dependency graph. The forward pass already happened; its raw outputs do not change. What changes is how we group them.

That is the engineering content of collapse. A quantum system behaves as a distributed statistical structure in which the choice of measurement determines which joint distributions are accessible to us. The image of "reality waiting for an observer" only gets in the way.

"It from bit": a blueprint instead of a slogan

John Wheeler in 1989 wrote down the line "it from bit": every physical quantity, at bottom, derives its value from binary yes/no answers — that is, from informational events. For years it sounded like a philosophical flourish without technical content.

Holographic codes (Pastawski, Yoshida, Harlow, Preskill, 2015 — the so-called HaPPY code) gave the first concrete model: spacetime as a network of tensors, with "deep" degrees of freedom reconstructible from "boundary" ones via specified unitary rules. If that picture is right, the physics of bulk objects is literally operations on a graph of pointers: add a node, rewrite an edge, repackage a codeword.

Holographic codes are a concrete mathematical object on which predictions can be tested: about reconstruction, about error tolerance, about entropy relations. Talk of resemblance ends here and engineering physics begins. The question is no longer whether the universe is "like" a computer: part of its formalism coincides with the formalism of a specific class of computations.

Where the metaphor stops

Your while(true) does not, of course, literally generate quantum states. Decoherence on an ordinary chip is instantaneous because the environment is rigidly coupled to it through heat exchange. To preserve coherence long enough for a measurable quantum effect you need cryogenic conditions, isolation, specially engineered degrees of freedom — exactly what quantum-computing labs spend their lives on.

And no metaphor turns measurement into magic. Bell experiments (Delft, Vienna and NIST, all in 2015) showed that local realism is dead, which means a quantum correlation is far stranger than a "hidden parameter tucked inside the system". The generative-loop image helps catch the shape of that strangeness, but it cannot stand in for the physics.

Why this parallel is worth drawing

The engineering view is useful because it makes quantum mechanics discussable for people who already have a working intuition about distributed systems, transactions and gradient descent; it does not pretend to explain the whole subject. There are millions of such people now, and for foundational physics that is a huge new audience.

The Pointer Architecture programme behind this site works right at that seam. Its claim is narrow and testable: certain formal structures describe computation and physics at once, and testable predictions follow from that. There is no "everything is code" slogan in it.

The preprint builds that loop into a working substrate, the Sixth language. The companion book, The Celestial Code, walks the intuition from while(true) to information geometry. This essay is about the cheapest bridge between the two languages. Anyone who wants to argue seriously about how reality is built should be willing to walk that bridge in both directions.

quantum-mechanicsinformationmeasurementWheeler