Help! There’s A Demon In My RAM!

by Carlota Figueroa

Maxwell’s Demon (image obtained from this Trinity College Dublin post)

Picture this: it’s Friday at 10:30 pm, and you have an 11:59 pm deadline that you thought was much easier than it actually is. I’m sure if you think back to your university days, you can think of at least a couple of instances when this happened. As the kids would say nowadays, you have to “lock in” and put all your attention into completing this very important assignment. Then, all of a sudden, you discover there’s a little demon playing tricks with your computer’s memory, deciding what information is stored and what information isn’t – and you have no say in it.

I know, this sounds incredibly inconvenient. Thankfully for us, there isn’t an actual demon deciding what information our computer stores and what information gets irreversibly thrown out. However, we need to be grateful for the fact that someone, a long time ago, thought that a very similar demon could exist. Does the name James Clerk Maxwell ring a bell? He birthed one of the most significant thought experiments of theoretical physics and information theory. Maxwell pondered the existence of a small finite being (which was later, in all its glory, categorized as a demon) that could separate molecules according to their speed. Such a demon sat on the barrier between two boxes, each containing gas molecules following random thermal motion. What this means is that although you can determine an average speed at which the molecules are moving, each individual molecule will move with a random speed and in a random direction. Hence, we have faster molecules, and we have slower molecules. Our Maxwellian demon acted as a traffic officer, opening a little window so that fast molecules were allowed to move from the box on the left to the box on the right, and vice versa for the slow molecules. Finally, we’d end up with a box of fast molecules and a box of slow molecules. Although a molecule should be judged by the content of its character and not its speed, this doesn’t sound too harmful, right?

Wrong. The faster the molecules, the hotter the gas, so we end up with one box much hotter than the other. With such a temperature difference, it would be possible to run a heat engine between both halves, extracting work. After letting the system reset, you’d just repeat the process, perpetually extracting useful work, and this is a direct violation of the Second Law of Thermodynamics: no such machine can exist. If Maxwell’s demon truly existed, thermodynamics would find itself in a pickle. Another way of looking at this is by considering that, when you are able to sort out molecules based on their speeds, you are decreasing the randomness (or “chaos”) in the system, at absolutely no cost. Hence, we would be decreasing the entropy (which is another name for this “chaos” I previously mentioned) in the universe, which, according to the Laws of Thermodynamics, is simply impossible.

Luckily for us, Leó Szilárd, Léon Brillouin and Charles Bennett, through their combined efforts, came up with an explanation for Maxwell’s little evil friend. At first, Szilárd and Brillouin argued that the demon would have to spend some kind of energy in learning which molecule was faster than the others, and that the gas was not an isolated system alien to the demon. Thus, the energy expenditure in measuring molecular speed must’ve caused a larger increase in entropy than the decrease arising from the molecular sorting, overall increasing the entropy of the system as expected. Nevertheless, there seemed to be an exception to this rule: measuring processes don’t need to increase the entropy of the system as long as they are reversible. Deleting a piece of information is an irreversible process (think back to the times before auto-save and all those Word documents you lost), so as long as the demon didn’t erase any of the molecules’ velocities from his memory, he could keep sorting out molecules for free. The issue is that a demon, no matter how many sudokus he has done throughout his life, cannot retain any and all pieces of information indefinitely. It was then Rolf Landauer who realized that deleting a “bit” of information required an energy expenditure of at least kT ln 2. Afterwards, Bennett connected the dots and realized that the demon must pay the cost of erasure, thus yielding the entropy increase we were expecting.

However, the most crucial implication of Landauer’s principle was that information is physical. If information is physical, then the thing that stores it matters, and so does the physics of that storage space. A normal, classical “bit” lives in some physical space (like the magnetized patch of a disk) that exists in a given state, regardless of whether someone is there to look at it or not. If things were classical, then measuring a property of the system would be equivalent to reading something that was already there. At the end of the day, the gas molecule was already either on the left or the right side of the box with its given velocity – the only thing that changed is that Maxwell’s friend actually bothered to measure it.

Headline from a 1935 New York Times article on the EPR Paradox (image from Wikipedia)

But what happens if that “bit” is living within, for example, a spin-based system? Well, as is usually the case when quantum mechanics gets involved, things get a little complicated, mostly because we can no longer say with full certainty whether the information was there before we looked at it. Einstein, Podolsky and Rosen weren’t very big fans of this idea. For them, it was obvious that if our demon measured the molecule as traveling at 500 m/s on the left side of the box, it was because it had always existed on that side of the box with that velocity. To formalize this, they came up with a thought experiment, now known simply as the EPR paradox. They thought of preparing two particles together so that their total momentum was zero, then sending one to Amsterdam and the other to Barcelona. Suppose we look at the Dutch physicist: she now has a choice of what she can measure on her particle. If she measures the momentum, she will know exactly what the Spanish particle’s momentum is. On the other hand, if she measures its position instead, she will know the other particle’s position exactly. Quantum mechanics insists a particle cannot have a definite position and a definite momentum at once (Heisenberg’s uncertainty principle, anyone?). But nobody has touched the Spanish particle, and nothing done in Amsterdam can reach it faster than light. Thus, EPR argued, it must have had both its definite position and momentum all along, and it was quantum mechanics that was leaving something out and inaccurately describing reality. They came up with the theory that there must be hidden variables, or instructions written into the particles the moment they were prepared. Bohm later restated the argument with two spin-1/2 particles prepared with total spin zero. Measure one along any axis your heart desires and get +, and the other, wherever it is, gives − along that same axis. Same structure: we make a choice in Amsterdam and know with absolute certainty the result in Barcelona, even before it is measured.

Notice that for this argument to work, we need to make two assumptions which, albeit sounding like common sense, are unspoken assumptions after all. First, we are implicitly stating that the outcomes were decided at the source: the particles left carrying instructions for every measurement anyone might make, and looking merely reads what was already encoded there. We also assume that nothing done in Amsterdam changes anything in Barcelona: the only things that matter are the immediate surroundings and their shared past. I mean, after measuring the Dutch particle you knew what was going on in Spain only because you knew the particle had been prepared in a certain way and sent to a certain place. Physicists call the first assumption realism and the second locality. Put them together and we get a statement that sounds like simple everyday common sense: any correlation between the two cities must be explained by their common history.

In 1964 John Bell noticed that these two assumptions make a prediction of their own. We can think of this in terms of a game. Each round, Amsterdam and Barcelona receive one particle each. Then, each physicist flips a coin to decide along which of two predetermined axes they make a spin measurement. They win the round if their results agree, as long as they get two heads or a head and a tail. However, if two tails come out, then they win if their results disagree. They may plan together beforehand, but once the particles are sent they can no longer talk to each other. Imagine that the particles have the instructions encoded in them beforehand. Then (you can do the math) the best possible plan wins 75% of the rounds, no matter how incredible the instructions were. As you might have seen coming, quantum mechanics disagrees and predicts that, actually, it is possible to win about 85% of the time. A difference of ten percentage points might not be a lot in other contexts, but here it is more than enough to warrant building an experimental instrument to test this.

Maybe unexpectedly, nature sided with quantum mechanics. Alain Aspect achieved that 85% in 1982 by switching the settings in the detectors he used while some photons were already in flight. I know we’ve been talking about particles and their spins, but the same game works with photons and their polarization. There were some other loopholes and open questions that had to be closed one by one, and the 2022 Nobel Prize went to Aspect, Clauser and Zeilinger for the work that finished tying everything up. I need to warn you at this point: Amsterdam cannot send messages to Barcelona. If we just look at the Spanish results, they will look random and based on a coin flip. The physicists only see the correlation between their results after getting together to discuss them. Relativity is safe: we don’t have any information traveling faster than the speed of light. What is not safe, maybe more worryingly so, are the common-sense assumptions. The particles’ outcomes were not decided until they were measured. Yet they agreed more often than any pre-agreed plan could. This means there are no secret hidden variables, at least no local ones: the universe couldn’t have known what the results of the measurements were going to be until after they had been made.

This takes us back to Maxwell’s little friend: the universe may not have had some secret pre-written result encoded, but the demon did. His RAM was a list of facts about molecules that existed before anyone looked: the molecules were in their respective boxes, and they would’ve been there even if the demon hadn’t spawned. Bennett’s sort of exorcism worked because the list of facts was a physical reality, and erasing it had a real entropy cost. But what happens if we build the demon’s memory from these spin-based systems? Imagine that the bit to be erased is one particle of an entangled pair, and that the demon’s RAM is the other. In the classical sense of things, there is no hidden variable encoding a secret reality we cannot see: there is nothing written because there simply isn’t anything to write. And yet, the demon’s memory and the bit to be erased are intrinsically intertwined.

Let us take the cost of erasing a bit, when you hold a memory of it, to be proportional to a value, S, that measures how uncertain the bit still is once you know what the memory says. A demon that has no record has the maximum uncertainty he can have, S = 1, and pays Landauer’s entropy price which we mentioned at the beginning of the article. If the demon operated on a perfect classical record of the bit, then erasure would be free. But nothing in life is ever free: the bill hasn’t disappeared – it has just moved somewhere else. A demon with an entangled memory knows without knowing it knows: the memory holds no record of the bit’s value, yet it is so tightly bound to the bit that the uncertainty comes out negative, S = −1. You might protest and tell me that this makes absolutely no sense: you cannot know something better than perfectly. In 2011 Lídia del Rio and colleagues showed that this negative sign means that erasing the bit actually yields kT ln 2 of work. The demon doesn’t pay to clean his RAM: he gets paid. We don’t have a violation of the Second Law of Thermodynamics in this case either: the work comes out of the entangled pair. After the pair is used, the memory becomes scrambled. Hence, to repeat the process, the demon would have to clean his useless mixed-up memory, and therefore pay the entropy price himself. What does any of this have to do with Einstein? Well, the correlations that seemed to be a flaw in the theory turned out to have a real, physical price in joules.

In a quantum computer, every operation performed is reversible: information is encoded by rotating its qubits, which can be easily un-rotated. Remember that we said that reversible processes (thermodynamically speaking) are free: nothing is erased, so nothing is paid. So who gets the bill to maintain order in the universe? The machine that actually measures the state and produces the readout we can use. Essentially, entanglement is fuel. But that isn’t why quantum-based computing systems are so powerful. In a classical computer, every computation comes from a predetermined list of 0s and 1s. In the quantum case, there’s no list of definite values that tells us what each qubit is worth: they live in states that violate Bell’s inequalities, and we can only know what information they hold after performing a measurement, but never before that. That is exactly what your laptop is: a list of values that describes what the bits are doing. See? This is where the power and efficiency gap is coming from.

Maxwell and Einstein, nearly 70 years apart, both realized that physics was missing something: one thought it was an evil little demon that defied the Second Law of Thermodynamics. The other thought it was a set of secret instructions encoded into the universe. Were they right? Partly. Yes, something was missing in physics, but it wasn’t either of these things. Maxwell failed to realize that the demon has a real, physical memory. Einstein, on the other hand, didn’t conceive that the universe doesn’t have one. As for the devil in your RAM: he’s real, his name is Landauer, and he charges kT ln 2 per bit, which at 11:58 pm is a price worth paying. And to end on a high note, do you know what else is inevitably entangled? Physics and philosophy. We can actually extrapolate everything I’ve talked about in this article to our daily lives: your past doesn’t have to define you – we just saw that the universe isn’t keeping count.

***

Enjoying the content on 3QD? Help keep us going by donating now.