Overview of the GF (Galois Field) Package - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Packages : GF

Overview of the GF (Galois Field) Package

Calling Sequence

GF(p, k, a)

Parameters

p

-

prime integer

k

-

positive integer

a

-

(optional) irreducible polynomial of degree k over the integers mod p

Description

• 

The GF command returns a module G of procedures and constants for doing arithmetic in the finite field GF(p^k), a Galois Field with pk elements. The field GF(p^k) is defined by the field extension GF(p)[x]/(a) where a is an irreducible polynomial of degree k over the integers mod p.

• 

If a is not specified, an irreducible polynomial of degree k over the integers mod p is chosen at random.  It can be accessed as the constant G:-extension.  The elements of GF(p^k) are represented using the modp1 representation.

• 

First, you need to define an instance of a Galois field using, for example, G := GF(2, 3). This defines all operations for G, the field of characteristic 2 with 8 elements.

• 

The G:-input and G:-output commands convert from an integer in the range 0..pk1 to the corresponding polynomial and back. Alternatively, G:-ConvertIn and G:-ConvertOut convert an element from GF(p^k) to a Maple sum of products, a univariate polynomial where the variable used is that given in the argument a. Otherwise the name `?` is used.

• 

Arithmetic in the field is defined by the following functions. G:-`+`, G:-`-`, G:-`*`, G:-`^`, G:-inverse, G:-`/`

G:`+`,G:``,G:``,G:`^`,G:inverse,G:`/`

• 

Field arithmetic can be written very naturally by using a use statement; see the examples below.

• 

The additive and multiplicative identities are given by G:-zero and G:-one.

• 

The G:-trace, G:-norm, and G:-order commands compute the trace, norm and multiplicative order of an element from GF(p^k) respectively.

• 

The G:-random command returns a random element from GF(p^k).

• 

The G:-PrimitiveElement command generates a primitive element at random.

• 

The G:-isPrimitiveElement command tests whether an element from GF(p^k) is a primitive element, being a generator for the multiplicative group GF(p^k) - {0}.

• 

For backwards compatibility, exports of the module returned by the GF command can also be accessed by indexed notation, such as G[':-ConvertIn']. However, using the more modern form G:-ConvertIn, you do not need to quote the name to avoid evaluation.

Examples

G16:=GF2,4,α4+α+1:

a:=G16:-ConvertInα

a:=α mod 2

(1)

G16:-`*`a,a

α2 mod 2

(2)

G16:-`^`a,4

α+1 mod 2

(3)

x:=G16:-`^`a,8

x:=α2+1 mod 2

(4)

G16:-outputx

5

(5)

G16:-ConvertOutx

α2+1

(6)

G16:-isPrimitiveElementa

true

(7)

x:=G16:-`^`a,1

x:=α3+1 mod 2

(8)

G16:-`*`a,x

1 mod 2

(9)

The use statement, if used carefully, can make arithmetic operations in the field much more natural.

useG16iny:=aa+x;z:=ay;z3+y2end use

y:=α2+1 mod 2

z:=α2+α+1 mod 2

α+1 mod 2

(10)

See Also

Domains, mod, modp1


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam