## 13.6 The classical repetition code

We have now essentially met all the concepts of quantum error correction, but everything has been phrased in terms of correctable isometries.
Now we need to repeat much the same information from a slightly different perspective, including a brief detour to introduce some concepts and methods from the classical theory of error correction.
Even though quantum problems often require novel solutions, it is always a good idea to look at the classical world to see if there is anything equivalent there, and, if so, how people deal with it.
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: these classical bit-flips, and then the purely quantum phase-flips.
But there’s one key thing that we know relating these two types of errors, namely that phase-flips can be turned into bit-flips by sandwiching then 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
**error threshold** of the code, and is a good judge of how useful a code actually is.
When

In this example, we can see that if one or two errors occur, then the resulting bit string will no longer be a valid codeword, which makes the error detectable.
For example, if the bit string *which* error has occurred, since it could have been a single bit-flip on *one of these two* went wrong.
In the worst case scenario, where three bit-flips happen, the error will be undetectable: it will turn **logical error**, where the corrupted string is also a codeword, leaving us with no indication that anything has gone wrong.

Below a certain error threshold, the three-bit code improves the reliability of the information transfer.
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).
More generally, the distance

Looking back again at Figure 13.5, we see that if exactly one or two errors occur in our three-bit code 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