In coding theory, a cyclic code is a block code, where the circular shifts of each codeword gives another word that belongs to the code. They are error-correcting codes that have algebraic properties that are convenient for efficient error detection and correction.
Definition Let 𝒞 be a linear code over a finite field (also called Galois field) GF(q) of block length n. 𝒞 is called a cyclic code if, for every codeword c=(c1,…,cn) from 𝒞, the word (cn,c1,…,cn−1) in GF(q)n obtained by a cyclic right shift of components is again a codeword. Because one cyclic right shift is equal to n−1 cyclic left shifts, a cyclic code may also be defined via cyclic left shifts. Therefore, the linear code 𝒞 is cyclic precisely when it is invariant under all cyclic shifts. Cyclic codes have some additional structural constraint on the codes. They are based on Galois fields and because of their structural properties they are very useful for error controls. Their structure is strongly related to Galois fields because of which the encoding and decoding algorithms for cyclic codes are computationally efficient.
Algebraic structure Cyclic codes can be linked to ideals in certain rings. Let R=A[x]/(xn−1) be a quotient of a polynomial ring over the finite field A=GF(q). Identify the elements of the cyclic code 𝒞 with polynomials in R such that (c0,…,cn−1) maps to the polynomial c0+c1x+⋯+cn−1xn−1: thus multiplication by x corresponds to a cyclic shift. Then 𝒞 is an ideal in R, and hence principal, since R is a principal ideal ring. The ideal is generated by the unique monic element in 𝒞 of minimum degree, the generator polynomial g. This must be a divisor of xn−1. It follows that every cyclic code is a polynomial code. If the generator polynomial g has degree d then the rank of the code 𝒞 is n−d. If 𝒞 is a cyclic code, the dual code 𝒞⊥ is also a cyclic code. The generator polynomial h(x) for 𝒞⊥ is also called the parity-check polynomial or simply check polynomial for 𝒞. It can also be shown that g(x)h∗(x)=xn−1, where h∗(x) denotes the reciprocal polynomial of h(x). The idempotent of 𝒞 is a codeword e such that e2=e (that is, e is an idempotent element of 𝒞) and e is an identity for the code, that is e⋅c=c for every codeword c. If n and q are coprime such a word always exists and is unique; it is a generator of the code. An irreducible code is a cyclic code in which the code, as an ideal is irreducible, i.e. is minimal in R, so that its check polynomial is an irreducible polynomial.
Examples For example, if A=𝔽2 and n=3, the set of codewords contained in the cyclic code generated by (1,1,0) is precisely {(0,0,0),(1,1,0),(0,1,1),(1,0,1)}. This code corresponds to the ideal in 𝔽2[x]/(x3−1) generated by (1+x). The polynomial (1+x) is irreducible in the polynomial ring, and hence the code is an irreducible code. The idempotent of this code is the polynomial x+x2, corresponding to the codeword (0,1,1).
Trivial examples Trivial examples of cyclic codes are An itself and the code containing only the zero codeword. These correspond to generators 1 and xn−1 respectively: these two polynomials must always be factors of xn−1. Over GF(2) the parity bit code, consisting of all words of even weight, corresponds to generator x+1. Again over GF(2) this must always be a factor of xn−1.
Other examples Many types of commonly used error-correcting codes can be represented as cyclic codes, including BCH codes, Reed-Solomon codes, and some classes of low-density parity-check codes defined from finite geometries.
For correcting errors Cyclic codes can be used to correct errors, like Hamming codes as cyclic codes can be used for correcting single error. Likewise, they are also used to correct double errors and burst errors. All types of error corrections are covered briefly in the further subsections. The (7,4) Hamming code has a generator polynomial g(x)=x3+x+1. This polynomial has a zero in Galois extension field GF(8) at the primitive element α, and all codewords satisfy 𝒞(α)=0. Cyclic codes can also be used to correct double errors over the field GF(2). Blocklength will be n equal to 2m−1 and primitive elements α and α3 as zeros in the GF(2m) because we are considering the case of two errors here, so each will represent one error. The received word is a polynomial of degree n−1 given as v(x)=a(x)g(x)+e(x) where e(x) can have at most two nonzero coefficients corresponding to 2 errors. We define the syndrome polynomial, S(x) as the remainder of polynomial v(x) when divided by the generator polynomial g(x) i.e. S(x)≡v(x)≡(a(x)g(x)+e(x))≡e(x)modg(x) as (a(x)g(x))≡0modg(x).
For correcting two errors Let the field elements X1 and X2 be the two error location numbers. If only one error occurs then X2 is equal to zero and if none occurs both are zero. Let S1=v(α) and S3=v(α3). These field elements are called "syndromes". Now because g(x) is zero at primitive elements α and α3, so we can write S1=e(α) and S3=e(α3). If say two errors occur, then S1=αi+αi′ and S3=α3i+α3i′. And these two can be considered as two pair of equations in GF(2m) with two unknowns and hence we can write S1=X1+X2 and S3=(X1)3+(X2)3. Hence if the two pair of nonlinear equations can be solved cyclic codes can used to correct two errors.
Hamming code The Hamming(7,4) code may be written as a cyclic code over GF(2) with generator 1+x+x3. In fact, any binary Hamming code of the form Ham(r, 2) is equivalent to a cyclic code, and any Hamming code of the form Ham(r,q) with r and q-1 relatively prime is also equivalent to a cyclic code. Given a Hamming code of the form Ham(r,2) with r≥3, the set of even codewords forms a cyclic [2r−1,2r−r−2,4]-code.
… excerpt ends here. Continue reading the full article.

