The running of a quantum algorithm must be restricted to a carefully chosen sub-space of some larger Hilbert space. The trick is to detect and undo unintended anomalies as they develop in the chosen sub-space without upsetting intended computations. Fortunately, some useful correction algorithms are now known. Further, a theory of quantum error-correction has also developed which allows quantum computers to compute effectively in the presence of noise and allows communications over noisy quantum channels to take place reliably.

The interaction of the computational Hilbert space with the environment (e.g., ambient heat bath, cosmic rays, stray gas molecules, etc.) can be broadly placed under the headings dissipation and decoherence.^{7}

**Dissipation** is a process by which a qubit loses energy to its environment. For example, if an excited state is used to represent a |1〉 and a lower energy state as |0〉, a qubit might spontaneously transition from |1〉 to |0〉 emitting a photon in the process. To see that dissipation is non-unitary, consider the following description of the bit-flip process:

*D*|1〉 = |0〉

*D*|0〉 = |0〉.

Here, the matrix *D* is

which is clearly not a unitary matrix since

**Decoherence:** Decoherence is more insidious. It is a coupling between two initially isolated quantum systems (say, the qubits and the environment) that tends to randomize the relative phases of the possible states of memory registers. This destroys the planned interference effects of a computational algorithm and entangles the state of the quantum computer with the environment. Decoherence usually occurs on a faster time-scale than dissipation.

In decoherence, information encoded in a quantum state “leaks out” to the environment. If the effects of the environment are not explicitly modeled, it would appear as if the logical qubits are no longer evolving in accordance with the Schrödinger equation. In fact, it is this coupling between a quantum system and its environment, and the resulting loss of coherence that prevents quantum effects from being evident at the macroscopic level. When that happens, that state will look locally like a classical state. Therefore, as far as a local observer is concerned, there is no difference between a classical bit and a qubit that has become hopelessly entangled with the rest of the universe.^{8} For example, suppose we have a qubit in the state

(|0〉 + |1〉)/√2 and further suppose that this qubit gets entangled with a second qubit so that the joint state of the two qubits is (|00〉 + |11〉)/√2. If we now ignore the second qubit, the first qubit will be in the *maximally mixed state*, i.e., no matter what measurement you make on it, you will get a random output. You will never see interference between the |00〉 and |11〉 branches of the wave function, because for interference to occur the two branches must be identical in *all* aspects and this cannot happen by changing the first qubit alone to make |00〉 identical to |11〉. To see an interference pattern it is necessary to perform a joint measurement on the two qubits together.

^{7}Williams & Clearwater (1998), p. 214.

^{8}See, e.g., Aaronson (2006).