All published worksheets from http://sagenb.org
Image: ubuntu2004
Cyclic Codes
A right cyclic shift is where each entry of a vector is shifted one place to the right, and the last entry is shifted to the first position.
Right cyclic shift
An linear code is CYCLIC if , that is, for all , the right cyclic shift of is also in .
Polynomials modulo ()
We can represent codewords of length by polynomials of degree .
Polynomial Representation
.
Algebra Addition is as usual. We can now also multiply words (modulo ).
Example:
Ex 1 Let and , then
Ex 2 Let and , then
We have now defined a multiplication operation on codewords. This is not an inner product.
In Ex 2 vw=0, and we can see that we now have zero divisors.
A cyclic shift corresponds to multiplication by x.
Classifying Cyclic Codes
Theorem A linear code is cyclic if and only if for every codeword and every word , we have .
Theorem A linear code is cyclic if and only if for every and every .
cyclic code over is an ideal of .
Creating Cyclic codes
To create a cyclic code as words we can do the following:
Let and let .
In general the elements of are not all distinct. Then is the cyclic code genreated by .
To create a cyclic code as polynomials:
.
The codewords are exactly the polynomial multiples of .
is the cyclic code generated by .
The word or its polynomial version is called a generator for .
There can be several generators for a code, but we are concerned with finding the generator of .
Theorem
Let be a cyclic code over . There exists a unique monic polynomial in with minimal degree.
This polynomial is called the generator of .
Theorem
.
Proof: () is obvious. Now let . By the Division Algorithm, with degdeg, but
So and is a multiple of so .
Theorem
If is a generator for a cyclic code of length , then is the generator for the code.
Proof: Since then .
Since divides , . Now assume is the generator polynomial of .
Then divides , and degdeg. Hence by minimality, .
Theorem
There is a one-to-one correspondence between cyclic codes of length and the monic divisors of in .
If in is the factorization into irreducible monic polynomials, then there are different cyclic codes over .
Properites of Cyclic Codes
1. If the generator polynomial for a cyclic code is of degree , then the dimension of is .
2. If is the generator polynomial for a code of degree , the set is linearly indedependent where . In fact, it is a basis for .
3. A cyclic code of length and dimension exists if and only if there is a polynomial of degree which divides .
4. A generator matrix for is
Constructing Cyclic Codes From Polynomials in Sage
It is easy to construct cyclic codes in Sage. First you construct the polynomial ring over the field you are working in. Then you name your generator polynomial, and finally, you construct your code.
You can still get a generator matrix for your code, but Sage will give it to you in terms of words and not polynomials. You can easily convert back and forth however.
If your generator does not divide where is the length of your code, Sage will find the gcd of your generator and , which is one. Consequently, Sage will use 1 as the generator polynomial. To avoid this, add the parameter ignore=false. Then if your generator does not divide you will get the following error message:
You can also determine if a poynomial divides by dividing. If you get a quotient then it is divisible. If Sage presents the answer as a fraction, then it isn't. You must have already defined your polynomial ring. Sage will also factor for you.
To find all of the generators of cyclic codes over of length , you need to the factorization of over . This can be done in the way that we did it when studying minimal polynomials. On pages 140 and 141 of the text, there are tables of the factorization of for over and .
Encoding
Non-systematic encoding is an easier method of encoding than systematic encoding, but systematic encoding makes decoding easier.
Non-systematic Encoding
Generator Polynomial of degree , for an -code .
.
Let be the original message of length , which is a polynomial of degree .
Encoding : .
This is easy encoding, but can you see or ?
Systematic Encoding
We build a generator matrix in the form .
Let for .
Then . In fact, they are linearly independent.
.
where are the rows of .
The original message is of length , and is a polynomial of degree .
Encoding : . is the remainder when dividing by .
Advantage: Original message appears on the last positions of .
Example:
Let .
, so to make the generator matrix for the code in symmetric form, we need to compute the remainders when , , and are divided by .
For that purpose, we can set up a polynomial ring modulo .
To make the generator matrix for the code in symmetric form,
the rows , of the matrix are for . as shown above.
Thus they are
So to encode the message 2010, we mulitply the message by and get:
Note that the message is on the last four digits.
Now to encode via polynomials:
So the encoded message is 1 2 2 2 2 2 1 0.
Homework #6
1. Describe all of the ternary cyclic codes of length 4 by giving its generator polynomial and its parameters.
2. Assume and are cyclic codes of the same length with generator polynomials , respectively. Show that if and only if divides .
3. Problem 7.1
4. Problem 7.6
5. Problem 7.9
6. Problem 7.13
7. Problem 7.23
If you are taking Math 527 then do Problem 7.24.
If you are not taking Math 527 you can do Problem 7.24 for extra credit.