[top][index]
search for:

GF ZZ -- make a finite field of a given order

Synopsis:

  • Function: GF -- make a finite field
  • Input:
  • an instance of class ZZ.
  • Output:
  • an instance of class GaloisField.
  • Optional arguments :
  • GF(..., PrimitiveElement) -- specify a primitive element
  • GF(..., Variable) -- specify a name for the generator of a Galois field
  • GF(q) -- make a Galois field with q elements, where q is a power of a prime.

    i1 : k = GF(8)

    o1 = k

    o1 : GaloisField
    i2 : x = k_0

    o2 = $a

    o2 : k
    i3 : x+x^2

           4
    o3 = $a

    o3 : k

    Code:

         -- ../../../Macaulay2/m2/galois.m2:66-70
         GF(ZZ) := GaloisField => options -> (q) -> (
              factors := factor q;
              if #factors =!= 1 or factors#0#0 === -1
              then error "expected a power of a prime";
              GF(factors#0#0,factors#0#1,options))

    [top][index]
    search for: