Appendix F - Classical Error Correcting Codes

From Qunet
Revision as of 18:58, 12 July 2011 by Mbyrd (talk | contribs)
Jump to: navigation, search

Introduction

Classical error correcting codes are in use in a wide variety of digital electronics and other classical information systems. It is a good idea to learn some of the basic definitions, ideas, methods, and simple examples of classical error correcting codes in order to understand the (slightly) more complicated quantum error correcting codes. There are many good introductions to classical error correction. Here we follow a few sources which also discuss quantum error correcting codes: the book by Loepp and Wootters, an article in Lo, Popescu, and Spiller by Steane, Gottesman's Thesis, and Gaitan's Book on quantum error correction, which also discusses classical error correction.

Binary Operations

The set is a group under addition. (See Section D.2.8 of Appendix D.) The way this is achieved is by deciding that we will only use these two numbers in our language and using addition modulo 2, meaning, and . If we also include the operation of multiplication, the set, with the two operations, becomes a field (a Galois Field) and that field is denoted GF. Since one often works with strings of bits, it is very useful to consider the string of bits to be a vector and use vector addition (which is component-wise addition) and a vector multiplication which is the inner product. For example, the addition of the vector and is . The inner product between these two vectors is .

Definitions and Basics

Definition 1

The inner product is also called a checksum or parity check since it shows whether or not the first and second vectors agree have an even number of 1's at the positions specified by the ones in the other vector. We may say that the first vector satisfies the parity check of the first vector, or vice versa.

Definition 2

The weight or Hamming weight is the number of non-zero components of a vector or string. The weight of a vector is denoted wt().

Definition 3

The Hamming distance is the number of places where two vectors differ. Let the two vectors be and , then the Hamming distance is also equal to wt(). The Hamming distance between and will be denoted .

Definition 4

We use denote the set of all binary vectors of length . A code of length is any subset of that set. The set of all elements of is called the set of codewords. We also say there are -bit words in the space.

Suppose bits are used to encode logical bits. We use the notation do denote such a code.

Definition 5

The minimum distance of a code is the smallest Hamming distance between any two non-equal vectors in a code. This can be written


(F.1)

For shorthand, we also use or if is understood.

When that code has a distance , the notation is used.

Example 1

It is interesting to note that if we encode redundantly using and as our logical zero and logical one respectively, then we could detect single bit errors, but not correct them. For example, if we receive , we know this cannot be one of our encoded states. So an error must have occurred. However, we don't know whether the sender sent or . We do know that an error has occurred though, as long as we know only one error has occurred. Such an encoding can be used as an error detecting code. In this case there are two code words, and , but four words in the space. The minimum distance is 2 which is the distance between the two code words.

Example 2

The three-bit redundant encoding was already given in Chapter 7. One takes logical zero and logical one states to be the following


(F.2)

where the subscript is used to denote a "logical" state, that is, one which is encoded. Recall that this code is able to detect and correct one error. In this case there are two code words out of eight possible words and the minimal distance is 3.

Definition 6

The rate of a code is given by the ration of the number of logical bits to the number of bits, .

Definition 7

A linear code is a code which is closed under addition.

Linear Codes

Linear codes are particularly simple codes with extra features. These codes are important for their simplicity as well as the added structure.

Generator Matrix

For linear codes, any linear combination of codewords is a codeword. One key feature of a linear code is that it can be specified by a ''generator matrix'' [1]. For an code, the generator matrix is an matrix with columns that form a basis for the -dimensional coding sub-space of the -dimensional binary vector space. In other words, the vectors comprising the rows form a basis which will span the code space. (Note that one may also use the transpose of this matrix as the definition for .) Any code word , described by a vector can be written in terms of the generator matrix as . Note that is independent of the input and output vectors. In addition, is not unique. If columns are switched, or even added to produce a new vector which replaces a column, the generator matrix is still valid for the code. This is due to the requirement that the columns be linearly independent which is still satisfied if these operations are performed.

Parity Check Matrix

Once is obtained, one can calculate another useful matrix . is an matrix which has the property that


(F.3)

The matrix is called the parity check matrix or dual matrix. The rank of is at most and has the property that it annihilates any code word. To see this, recall any code word is written as , so since . Also, due to the rank of , it can be shown that only if is a code word. That is to say, if and only if is a code word. This means that can be used to test whether or not a word is in the code.

Suppose an error occurs on a code word to produce . Now consider


(F.4)

since . This result, is called the error syndrome and the measurement to identify is called the syndrome measurement. Therefore, the result depends only on the error and not on the original code word. If the error can be determined from this result, then it can be corrected independent of the code word. However, in order to have be unique, two different results and must not be equal. This is possible if a distance code is constructed such that the parity check matrix has linearly independent columns. This enables the errors to be identified and thus corrected.

Errors

For any classical error correcting code, there are general conditions which must be satisfied in order for the code to be able to detect and correct errors. The two examples above show how the error can be detected, but here the objective is to give some general conditions.

Note that any state containing an error may be written as the sum of the original state (logical or encoded state) and another vector . The error vector has ones are in the places where errors are present and zeroes everywhere else. To ensure that the error may be corrected, the following condition must be satisfied for two states with errors occurring


(F.5)

This condition is called the disjointness condition. This condition means that an error on one state cannot be confused with an error on another state. If it could, then the state including the error could not be uniquely identified with an encoded state and the state could not be corrected to its original state before the error occurred. More specifically, for a code to correct single-bit errors, it must have distance at least between any two codewords, i.e., it must be a distance code, i.e., it must be true that . An code with minimal distance is denoted .


Example 3

An important example of an error correcting code is called the Hamming code. This code, as the notation indicates, encodes bits of information into bits. It also does it in such a way that one error can be detected and corrected since it has a distance of . The generator matrix for this code can be taken to be (see Loepp and Wootters)


(F.6)

From this the parity check matrix, can be calculated by finding a set of mutually orthogonal vectors which are also orthogonal to the code space defined by the generator matrix. Alternatively, one could find the generator matrix from the parity check matrix. A method for doing this can be found in Steane's article in Lo, Popescu, and Spiller. One first puts in the form where is the identity matrix. Then the parity check matrix In either case, one can arrive at the following parity check matrix for this code:


(F.7)

It is useful to note that the code can also be defined by the parity check matrix. The codewords are annihilated by the parity check matrix and only the codewords are annihilated by that matrix.

The Disjointness Condition and Correcting Errors

The motivation for the disjointness condition, Eq.(F.5), is to associate each vector in the space with a particular code word. That is, assuming that only certain errors occur, each error vector should be associated to a particular vector in the code space when the error is added to the original code word. This partitions the set into disjoint subsets each of which contains only one code vector. A message is decoded correctly if the vector (the one containing the error) is in the subset which is associated with the original vector (the one with no error). For example, if one vector is sent, say and an error occurs during transmission to produce , this vector must be in the subset containing .

A way to decode is to record an array of possible code words, possible errors, and the combinations of those errors and code words. The array can be set up as a top row of the code word vectors and a leftmost column of errors with the element of the first row and the first column being the zero vector and all subsequent entries in the column being errors. Then the element at the top of a column (say the jth column) is added to the error in the corresponding row (say the kth row) to get the j,k entry of the array. With this array one can associate a column with a subset that is disjoint with the other sets. Then identifying the erred code word in a column associates it with a code word and thus corrects the error.



The Hamming Bound

The Hamming bound is a bound that restricts the rate of the code. Due to the disjointness condition, a certain number of bits are required to ensure our ability to detect and correct errors. Suppose there is a set of bit vectors for encoding bits of information. There is a set of error vectors of weight that has elements[2]. So the number of error vectors, including errors of weight up to , is (Note that no error is also part of the set of error vectors. The objective is to be able to design a code which can correct all errors up to those of weight and this includes no error at all.) Since there are vectors in the whole space of bits, and assuming vectors are used for the encoding, the Hamming bound is


(F.8)

For linear codes, so


(F.9)

Taking the logarithm,


(F.10)

For large and , we can use Stirling's formula to show that


(F.10)

where and we have neglected an overall multiplicative constant which goes to 1 as (Again, see the article in Lo, Popescu, and Spiller by Steane.)

NOTES

As can be seen from the Hamming bound, there is a limit to rate of an error correcting code. This does not indicate whether or not codes satisfying these bounds exists, but it does tell us that no codes exist which do not satisfy these bounds. Encoding decoding and error detection and correction are all problems which can be difficult to solve in general. One of the advantages of the linear codes is that they provide a systematic method for identifying errors on a code through the use of the parity check operation. More generally, checking to see whether or not a bit string (vector) is in the code space would require a lookup table. This would be much more time-consuming that using the parity check matrix where matrix multiplication is quite efficient relative to the lookup table.

Many of these ideas and definitions will be utilized in Chapter 7 on quantum error correction. Some linear codes, including the Hamming code above, will have quantum analogues as do many quantum error correcting codes. In quantum computers, as will be discussed, error correction is necessary since the quantum information is delicate. Such discussions will be taken up in Chapter 7.


Footnotes

  1. Recall we are working with binary codes. So the entries of the matrix will also be binary numbers, i.e., 0's and 1's.
  2. That is choose vectors. The notation is