James Clerk Maxwell had good reason to feel contented in 1867. That year the Scottish physicist explained how the properties of gases derive from the frenetic motions of their inscrutable molecular particles. Two years earlier he had published a theory that united electricity and magnetism, one of the supreme achievements of 19th-century science, and a foundational law of physics. Maxwell had even made the first-ever proper color photograph. He was arguably the most distinguished physical scientist in Great Britain. But something deep in the laws of physics was troubling him. To get around it, Maxwell enlisted the help of a demon.
The problem was the second law of thermodynamics. It was inferred in the mid-19th century by the German physicist Rudolf Clausius. In Clausius’s formulation, the second law insisted that heat can never spontaneously pass from a cold substance to a hotter one. This is what we know intuitively: Hot coffee always cools, but cold coffee never spontaneously gets hot again.
This story is from “The Hot Issue,” the latest from Nautilus.
To get it in print, join by Nov 30.
Clausius’ contemporaries were alarmed by what his second law implies. If heat is always passing from hot to cold, this means that all concentrations of heat are gradually dissipated and become a uniform thermal buzz in the background: Everything ends up at the same temperature. There must come a time when this is all there is. All pockets of energy will be dissipated, and no further change of any consequence can happen. The Scottish-Irish scientist William Thomson (later made Lord Kelvin) called this the heat death of the universe—not, as the name might imply, an infernal conflagration, but on the contrary an anticlimactic running down of everything.
The dreary end of all things may be a long way off, but for a devout Christian like Maxwell, the remoteness was no consolation. He believed in the eternal life promised by the scriptures. But he was also too much the scientist to accept that Christian doctrine could conflict with physical laws. And what about human free will, the means by which individuals could seek salvation? What could that mean in a world enslaved by the second law?
Theories in physiology then made the world and human behavior seem deterministic and inevitable, says historian of science Matthew Stanley of New York University, author of Huxley’s Church and Maxwell’s Demon. Maxwell, says Stanley, “was trying to figure out how there could be a ‘hole’ in theories that allowed for free will without giving up on laws of physics.” Stanley points out there was no great schism between theistic scientists like Maxwell and naturalists who saw no need for God’s involvement in the running of the universe. Both believed in natural laws like the second law and Isaac Newton’s laws of motion, and devout believers tended to feel sure these could be reconciled with an omnipotent God.
In 1867, Maxwell set about looking for a loophole that might safeguard his faith. He wrote to his friend Peter Guthrie Tait, who was preparing a book on thermo-dynamics, to say that he believed he had found one. In the “kinetic theory of gases” that Maxwell had just developed, the properties of gases—such as the fact that their pressure is proportional to their temperature—could be understood within a “microscopic” picture that considered the motions of the component molecules.
In this view, hotter gases have higher-energy and faster molecules on average than colder ones—but there is always a statistical spread of energies. If, Maxwell argued, you could measure the number of molecules with different energies in a gas at any given temperature, the graph would look like a sort of bell curve. If we raise the temperature of the gas, the peak of the bell curve shifts to higher energies, but also the hump itself flattens and broadens.
This, at any rate, is how things would look for a gas with an equal temperature everywhere—a gas at thermal equilibrium. But there’s not a lot you can do with a gas like that. If, on the other hand, you have a gas that is hotter in one region than another—if it’s out of equilibrium—you can extract useful work from it. The hotter region will have a higher pressure, and so it could push a piston into the colder region, driving some kind of engine. That was the basis of the steam engines of the Industrial Revolution, which had prompted the invention of the science of thermo-dynamics to predict and hopefully improve the efficiency of such devices.
But there is a bitter truth to the second law: It works to smooth away any such useful differences in temperature. In a gas with a hot region, the more energetic molecules will inevitably get spread out among the less energetic ones until energy is, on average, spread evenly. It’s just like stirring the cream in your coffee: The two will inevitably mix.
Once that has happened, there’s no going back. You can’t unstir the coffee. There is no physical law which says that the reverse is impossible—the chance that all the hotter molecules in a room might, just by chance, congregate in a hot cluster in one corner is not zero. But the chances of that happening are so astronomically small that it might as well be.
To defeat the second law, Maxwell needed to find some way of marshaling gas molecules so that the normal tendency for hot and cold regions to equalize would be reversed. If you could arrange for that, you could harness the temperature difference to do useful work. For this seemingly miraculous feat, the Christian physicist summoned a demon.
In truth, Maxwell himself never called it that. Heaven forbid! In his letter to Tait, he merely postulated a “finite being”—an “intelligent being endowed with free will”—small enough to “see” each molecule of the gas and able to keep track of it. When Thomson later mischievously dubbed this entity a demon, Maxwell grumbled to Tait: “Call him no more a demon but a valve.”
Why a valve? Because the demon’s job was to separate the hot molecules in a gas from the cooler ones by controlling their passage across a dividing wall between two compartments, using a trapdoor (assumed to be frictionless so that it takes essentially no energy to operate it). Whenever the demon sees a hot, fast-moving molecule coming toward the trapdoor from the left (say), it opens the door to let the molecule through. Whenever a cooler, low-speed molecule approaches from the right, the demon does likewise.
Gradually the demon segregates the hot and the cool molecules into the two compartments. From a gas with an initially uniform temperature on average, it creates one with a temperature difference—which can then be used to do work, such as pushing a piston. In fact, what the demon is using to reverse the second law is the information it collects about the gas molecules. It follows “that the dissipation of energy depends on the extent of our knowledge,” Maxwell wrote in his 1872 book Theory of Heat.
Maxwell’s theory seemed to some of his fellow Christians to justify belief in eternal life. In 1875, Tait published a book with fellow physicist Balfour Stewart titled The Unseen Universe, in which they argued that the immortality of the soul can be consistent with the laws of physics, thanks to the ability of providential beings with the abilities of Maxwell’s demon. These, Tait and Stewart wrote, “restore energy in the present universe without spending work,” and act as God’s agents of everlasting life after death.
The existence of a providential being, however, probably overstepped Maxwell’s intent. “I don’t have any reason to think that Maxwell was suggesting something like the demon actually existed,” Stanley says.
Nevertheless, the demon threw down a gauntlet to scientists to prove why it couldn’t exist, spurring generations of important insights into physics. “I feel like every generation of physicists feels the need to slay Maxwell’s demon again, with the best theories of their time,” says Stanley. “The fact that it keeps coming back suggests something about it remains persuasive.”
As the 20th century unfolded, breaking the second law might still have been good for the tenets of Christianity, but it was becoming a cardinal sin in science.
In 1929, the Hungarian physicist Leo Szilard, a friend of Einstein’s, reformulated Maxwell’s demon in search of an answer. Szilard reimagined the demon as a kind of machine—not unlike the refrigerator that he and Einstein designed and patented the following year. (Fridges appear to reverse the flow of heat from hot to cold, but only at the cost of consuming energy and dissipating some of it as heat.) Szilard thought the flaw lay in the energy the demon expended in collecting information about the molecules by measuring their speed. But it’s not obvious that this need be a problem in principle, since there’s no obvious limit to how small we can make that energy.
Scientists had also begun to wonder whether life itself works as a kind of Maxwell’s demon. After all, don’t living organisms seem to achieve something comparable?
Another way of stating the second law is in terms of changes in the quantity called entropy, which, loosely speaking, might be considered a measure of disorder. According to the second law, the total entropy of the universe must increase in every process of change. But for as long as living organisms remain alive, they maintain organization in the face of such entropic decay. Although they “pay” for this order by consuming energy and dissipating heat into their surroundings, increasing entropy overall, still this ability of life to resist the second law with their own boundaries seemed puzzling.
In 1924, the physiologist Archibald Hill, who won a Nobel Prize two years earlier for his work on how muscles produce work and heat, wondered whether living cells might, like the demon, “be able to sort molecules [and] to use the energy of the more rapidly moving”; in effect, mining their environment for heat, a molecule at a time. The Irish chemist Frederick Donnan agreed, saying that at the tiny scales of biological cells and molecules, the second law might not be binding.
It was a tempting idea, but scientists proved it doesn’t work. Biology does, at the molecular scale, seem to achieve things that run counter to what we’d naively expect: to pump ions and molecules in an “uphill” direction to make them more concentrated, say. But such processes, like fridges, consume energy, apparently undermining the second law in one region only by observing it overall. By the mid-20th century, scientists realized there were no real Maxwell’s demons that could undermine the second law.
Why not? The reason turned out to be subtle. In 1961, the German-American physicist Rolf Landauer, working at IBM’s research laboratory in Yorktown Heights, began thinking about Maxwell’s thought experiment from the perspective of the information theory devised in the 1940s by telephone engineer Claude Shannon to explain how information can be most efficiently encoded and transmitted in telecommunications.
The demon can, from this perspective, be thought of as carrying out a kind of computation: It gathers input data (about the molecules’ movements) and works out, based on that information, whether to perform an action (open the trapdoor). Landauer showed that any computation can in principle be done with zero energy consumption and dissipation, so long as it is fully reversible. This entails storing every bit of information involved in the calculation—all the 1s and 0s on a digital computer.
Landauer showed that if, on the other hand, all these bit values are erased—setting them all to zero, say, and thus throwing away the information they stored—then each bit of lost information has an unavoidable cost in energy dissipation and a corresponding boost in the total entropy.
So, here’s the problem for the demon: As a “finite being,” it has a finite brain. At some point, it can’t accumulate more information about the gas without freeing up memory by throwing away previous information: in other words, by forgetting. The reason Maxwell’s demon can’t undermine the second law in the long run is not because of any energy needed to collect the information and work the trapdoor, but because it must eventually forget information—and that costs entropy.
All the same, until it needs to wipe its memory, the demon can seem to be beating the second law, capturing energy from random molecular chaos and using it to do work, purely thanks to its information-gathering.
Today, then, we understand that Maxwell’s argument reveals a deep connection between energy and information. It suggests that knowledge itself can be harnessed as a kind of fuel, while pointing to fundamental limits in the energy efficiency of computation (a literally burning issue now that we are confronted with energy-voracious data centers feeding AI). The second law remains intact, but Maxwell’s argument shows how to put it to new uses.
In 2010, a team of physicists at the University of Tokyo, led by Shoichi Toyabe, reported a striking demonstration of that, by interconverting work and information experimentally. They could shunt a tiny polystyrene bead barely 300 nanometers across systematically in a particular direction, doing useful work, by taking advantage of the information they gathered about the bead’s position.
The researchers placed the bead in a fluid between two glass plates and tethered the bead to the upper plate using a polymer molecule. Left to its own devices, the bead jiggled around randomly in the fluid. The team used electrodes on the lower plate to create a kind of energy staircase for the bead so that, if it circulated in one direction it hopped between ever “higher” (greater energy) steps, whereas in the other direction it hopped to lower steps. These hops happened at random because of the thermal motion, but on average they moved the bead down the staircase because it will tend to head toward a lower energy, like water flowing downhill.
Now the physicists took on the role of the demon. They measured the bead’s position using a microscope and then applied an electrical barrier that acted like a trapdoor to prevent the bead from moving to lower steps. If the bead happened randomly to jump up a step, the barrier was moved to stop it subsequently tumbling back down. By taking advantage of information gathered about the bead’s position, the physicists forced the bead to move steadily uphill and gain energy. Although the whole experiment consumed and dissipated energy overall, nothing but random thermal jiggling, along with the information that informed the positioning of the barrier, drove the uphill motion. In other words, the team had converted information about the bead into energy.
A quantum version of Maxwell’s demon introduces a new wrinkle, because the rules of quantum mechanics make it possible to do things with information that are impossible with classical physics. Two quantum particles can be prepared in a so-called entangled state, meaning that their properties are interdependent and correlated. If one quantum bit, for example, is measured to have a value 1, the other of the entangled pair must be 0. They are said to share mutual information, so that we can find out about one particle by looking only at the other.
In 2008, physicist Hossein Partovi of California State University, Sacramento, showed how entanglement can be used to reverse the spontaneous flow of heat from a hot object to a cold one. That might seem to violate the second law, but in fact it reveals that the classical second law of regular thermodynamics is only an approximation to the full quantum second law that allows for the effects of mutual information in entanglement. In the latter case, the entanglement itself functions as a sort of fuel that can drive a reverse flow of heat, creating a sort of refrigeration that might be useful in devices like quantum computers. But again, it doesn’t come free. As the flow proceeds, the entanglement gets used up and destroyed, so that the quantum second law remains intact.
Today, we are still coming to grips with the implications of Maxwell’s pesky demon. There are profound implications of the fact that we can perform work simply by knowing about the fine details of the molecular world, that a thermodynamics of ignorance and forgetting exists. These things point to fundamental limits on the energy efficiency of manipulating information, whether that’s in computers or in our brains. And they help us to understand how life sustains itself in the face of entropic demands.
Whether they rescue the Christian faith from a conflict with physical law, as Maxwell hoped, is another matter. Yet, says Stanley, religion did not disappear from science because it was considered inconsistent with it. It was simply that they spoke to different concerns. Seen that way, Maxwell’s demon was one of the last ideas that bridged the two worlds. It was, Stanley says, “a thought experiment that was useful both for religion and science.”
Enjoying Nautilus? Subscribe to our free newsletter.