Chapter 00 · Bits
From bits to vectors
Before the qubit there was the bit. Rewriting classical computation as linear algebra (bits as vectors, logic gates as matrices, randomness as probability vectors) reveals exactly what quantum mechanics changes: one norm for another.
In this chapter
In 1937 a 21-year-old MIT student, Claude Shannon, showed in his master's thesis that the relay circuits of telephone exchanges obey the algebra George Boole had invented in 1854 to formalize logic. Every computer since then manipulates bits, quantities that are either 0 or 1, with logic gates. To understand what is new about quantum computing we first have to look at the classical bit with different eyes: as a vector.
Boolean circuits
A gate takes bits and returns bits: , , . A circuit wires gates together, and computes a function . A single type of gate is enough to build all of them.
Every Boolean function can be computed by a circuit made only of NAND gates.
Proof
Write in disjunctive normal form: an OR, over the inputs with , of the AND of literals or that is true only at . So NOT, AND and OR suffice. And each of them is made of NANDs: , , (De Morgan).
The proof hides a warning that will matter later: the normal form can have exponentially many terms. Being able to compute a function says nothing about computing it efficiently. Whether quantum computers can compute efficiently what classical ones cannot is the question running through this whole site.
Information is physical
An AND gate destroys information: from the output 0 you cannot tell whether the input was 00, 01 or 10. In 1961 Rolf Landauer, at IBM, showed that this has an unavoidable physical price.
Erasing one bit of information in an environment at temperature dissipates at least
of heat, where is Boltzmann's constant (about joules at room temperature).
In 1973 Charles Bennett showed that this cost is not inevitable: every computation can be done reversibly, without erasing anything, by keeping enough extra bits and “uncomputing” the intermediate results at the end. In 1980 Tommaso Toffoli found the gate that makes it practical.
The Toffoli gate is reversible (it is its own inverse) and, with auxiliary bits fixed to 0 or 1, every Boolean function can be computed by a circuit of Toffoli gates.
Proof
Applying twice gives , so is its own inverse. With the third output is , and with it copies (fan-out). By the universality of NAND, every circuit can be simulated.
This detail is crucial: as we will see, the evolution of a quantum system is always reversible. Toffoli's theorem guarantees that a quantum computer can do at least everything a classical one does.
Bits as vectors
Now the change of perspective. Represent the bit 0 by the vector and the bit 1 by (the notation , due to Dirac, will reappear constantly). Then NOT is a matrix:
With bits there are possible configurations, and each one is a basis vector of a space of dimension . A deterministic reversible circuit is a permutation matrix that shuffles those basis vectors. It sounds like an extravagant way of describing something simple, until we add randomness.
Probabilistic bits
A coin in the air is a bit we do not know. We describe it with a probability vector , with and . In other words, a vector with non-negative entries and 1-norm equal to 1: . Random operations are matrices too.
A matrix maps every probability vector to a probability vector if and only if it is stochastic: non-negative entries and each column summing to 1.
Proof
Applying to the basis vector gives column , which must be a probability vector. Conversely, is a convex combination of the columns, which are probability vectors, and the set of probability vectors is convex.
A stochastic matrix can only mix: it takes points of the segment towards its interior and, unless it is a permutation, cannot be undone without losing the guarantee of non-negativity. Uncertainty grows; it never shrinks. Is there something smoother, which allows us to go from 0 to 1 continuously and reversibly? Here is the first surprise.
There is no stochastic matrix such that .
Proof
Write with . The top-left entry of is , which must be 0. Both terms are non-negative, so and . But then and .
With the 2-norm the story is different. If instead of probabilities we use vectors with , a 45° rotation applied twice is a 90° rotation, which takes to . This is not an accident: of all the ways of measuring length, only one allows continuous reversible transformations.
Let and with . Every linear map that preserves the norm is a signed permutation matrix. For , on the other hand, the isometries are all the orthogonal matrices (all the rotations and reflections), a continuous family.
Quantum mechanics is, at its mathematical core, what you get by taking that step: describe the state of a bit by a vector of 2-norm 1, with entries that may be negative and even complex. Those entries are not probabilities but amplitudes, and the probabilities are their squared moduli. That is the qubit.
References
- C. E. Shannon (1938). “A Symbolic Analysis of Relay and Switching Circuits”. Transactions of the AIEE, 57(12).
- R. Landauer (1961). “Irreversibility and Heat Generation in the Computing Process”. IBM Journal of Research and Development, 5(3).
- C. H. Bennett (1973). “Logical Reversibility of Computation”. IBM Journal of Research and Development, 17(6).
- T. Toffoli (1980). “Reversible Computing”. ICALP, LNCS 85.
- S. Aaronson (2013). Quantum Computing Since Democritus. Cambridge University Press.