then the Galois field package is ready to use. Next, you have to declare a Galois field which you want to use.<<GaloisField.m GaloisField.m was loaded.
There are four types of declarations for finite fields in this package depending on different constructions of finite fields.
This example declares a prime field of order 5, GF(5). Then we can use the algebra name K5 and constants K5[i] for i=0,1,...,4.DeclareGaloisField[K5,5] K5 was declared. Order is 5 Characteristic is 5
K5[3] + K5[4] K5[2]
If the object GF16 does not exist, you get the following message:DeclareGaloisField[GF16] GF16 was declared. Order is 16 Characteristic is 2 Irreducible Polynomial is {1, 1, 0, 0, 1} Base Field is GF2 Extension Degree is 4 GF2 was declared. Order is 2 Characteristic is 2
Galois field object, GF16, does not exist.
Then you can make a type II object with the following function:
The first argument is the name of the object (also used as algebra name), the second is the order of the base field (must be a prime number), the third is the extension degree and the fourth argument is the coefficient list of a primitive irreducible polynomial over the base field. The function saves the object as a file with the name of the first argument.MakeGaloisField[GF16,2,4,{1,1,0,0,1}]
When you make a type III object, the second argument of MakeGaloisField must be an algebra name of the base field.
Of course, the base field must be declared before executing this function. The base field for type III dose not have to be a prime field.MakeGaloisField[F16,GF4,2,{2,2,1}]
Since the fields of this type do not have any table for computations, in each computation on type IV finite field, elements are reformed to polynomials over the base field and compute under the modulo of the irreducible polynomial. Therefore the irreducible polynomial dose not have to be a primitive. So, if you use a reducible polynomial instead of an irreducible polynomial, you can declare a polynomial ring.DeclareGaloisField[K16,GF4,2,{2,2,1}] GF4 has already been declared. K16 was declared. Order is 16 Characteristic is 2 Irreducible Polynomial is {2, 2, 1} Base Field is GF4 Extension Degree is 2
Type IV Galois fields are not recommended for fields of an order less than 1000, because of the computations are very slow.