Toffoli gates are all you need
Energy limits for information have a habit of sounding abstract—until you connect them to real circuits and then suddenly it’s not so slippery. Misryoum newsroom reported on the familiar idea known as Landauer’s principle, which sets a lower bound on the energy needed to erase one bit of information: E ≥ log(2) kB T, where kB is the Boltzmann constant and T is the ambient temperature in Kelvin. The lower bound applies no matter how the bit is physically stored.
The catch, as Misryoum analysis indicates, is that erasing and manipulating information aren’t the same thing. There is no theoretical lower limit on the energy required to carry out a reversible calculation. And yet, in practice, the energy required to erase a bit is around a billion times greater than Landauer’s lower bound. You might reasonably conclude that reversible computing isn’t practical—since we’re nowhere near the Landauer limit. Actually… you could argue that, but in practice reversible circuits have been demonstrated to use less energy than conventional circuits. We’re far from the ultimate physical limit, but reversibility still provides practical efficiency gains today.
A Toffoli gate is the building block being discussed for that kind of reversible circuitry. A Toffoli gate takes three bits as input and returns three bits as output: T(a, b, c) = (a, b, c XOR (a AND b)). In words, a Toffoli gate flips its third bit if and only if the first two bits are ones. The simple part is that it is its own inverse, and so it is reversible. This is easy to prove—if a = b = 1, then the third bit is flipped. Apply the Toffoli gate again and it flips the bit back to what it was. If ab = 0 (meaning at least one of the first two bits is zero), then the Toffoli gate doesn’t change anything.
There’s also a bigger mathematical point underneath, which is where things start to feel less like a gadget and more like a language. Misryoum editorial desk noted that there is a theorem that any Boolean function can be computed by a circuit made of only NAND gates. The reasoning goes: if you can construct a NAND gate out of Toffoli gates, then any Boolean function can be computed by a circuit made of Toffoli gates. That’s the same as saying any Boolean function can be computed reversibly. The specific construction offered is pretty direct. To compute NAND, i.e. ¬ (a ∧ b), send (a, b, 1) to the Toffoli gate. The third bit of the output will contain the NAND of a and b:
T(a, b, 1) = (a, b, ¬ (a ∧ b))
It’s the kind of step where you nod and then double-check it, because it’s too neat not to. In the background, the room goes quiet—someone’s keyboard clicks faintly, and you can almost hear the logic settling into place.
Still, there’s a drawback that shows up immediately once you think about how circuits are usually built. Reversible computing is not free of tradeoffs; you may have to send in more input than you’d like and get back more output than you’d like, as the example above already shows. NAND takes two input bits and returns one output bit. But the Toffoli gate simulating NAND takes three input bits and returns three output bits. And that’s just one small illustration of the broader mismatch between everyday gate design and reversible gate design—maybe it’s a nuisance, maybe it’s manageable, depending on the larger architecture. Either way, it’s a reminder that “reversible” isn’t the same as “simple,” even if Toffoli gates really are all you need to start building.