## 13.6 The classical repetition code

To give a sense of how quantum error correction actually works, we first need a brief detour to introduce some concepts and methods from the classical theory of error correction.^{265}
In this particular case, once we have digitised quantum errors, we can see that quantum decoherence is a bit like classical noise (i.e. bit-flips), except that we have *two* types of errors: bit-flips and phase-flips; the former essentially classical, the latter purely quantum.
But we also know that phase-flips can be turned into bit-flips if sandwiched between Hadamard transforms:

Suppose you want to send a **codewords**.
Beforehand, Alice and Bob agree that, from now on, each time you want to send a **logical** **logical**

Here’s an example.
Say that Alice wants to send the message *twelve* physical bits.
This is more costly (in terms of time or energy, or maybe even money), but might be worth it to ensure a more reliable transmission.
Let’s say that Bob then receives the message

110 is decoded as1 010 is decoded as0 101 is decoded as1 100 is decoded as0 .

As we can see, if a triplet contains either zero or one errors then the decoding returns the correct bit value, otherwise it errs.
In our example, the first three triplets are correctly decoded, but the fourth suffered two errors and is thus wrongly decoded as

We can make a simple estimate on how good this scheme will be.
Assuming that the errors are independent^{266} then, for any given triplet,
**binomial coefficient**.
Given that the scheme decodes correctly exactly when we have at most one error, the net probability of errors is just the probability that either two or three errors occur, which is

This simple repetition code encoded one bit into three bits, and corrected up to one error.
In general, there are classical codes that can encode **distance** of such an encoding, which is defined to be the minimum number of errors that can pass undetected (or, equivalently, the minimum Hamming distance^{267} between two codewords).
Looking back at Figure 13.6, we see that if exactly one or two errors occur then we can detect that an error has occurred, since we will have a string where not all of the bits are the same, which means that it is definitely not one of our code words.
However, if three errors occur then the errors are not only impossible to correct, but they are also *impossible to detect*.
So the code that we have described has

A code that encodes ** [n,k,d]-code**.

The **rate** of an

In an

Even though quantum problems often require innovative solutions, it is always a good idea to look at the classical world to see if there is anything analogous there, and how it is dealt with.↩︎

The assumption that the errors are independent is very important, but not always physically realistic!↩︎

That is, the number of bit-flips required to move from one to the other; recall Section 12.1.↩︎