[Next] [Prev] [Right] [Left] [Up] [Index] [Root]
Creation Functions

Creation Functions

Subsections

Creation of Structures

FiniteField(q) : RngIntElt -> FldFin
GaloisField(q) : RngIntElt -> FldFin
GF(q) : RngIntElt -> FldFin
    Optimize: BoolElt                   Default: true
Given q = p^n, where p is a prime, create the finite field GF(q). If p is very big, it is advised to use the form FiniteField(p, n) described below instead, because Magma will first attempt to factor q completely.

The primitive polynomial used to construct GF(q) when n > 1 will be a Conway polynomial, if it is available. If the parameter Optimize is false, then no optimized representation (i.e. by using Zech logarithm tables or internal multi-step extensions) will be constructed for the new field which means that the time to create the field will be trivial but arithmetic operations in the field may be slower -- this is useful if say one wishes to just compute a few trivial operations on a few elements of the field alone.

FiniteField(p, n) : RngIntElt, RngIntElt -> FldFin
GaloisField(p, n) : RngIntElt, RngIntElt -> FldFin
GF(p, n) : RngIntElt, RngIntElt -> FldFin
    Check: BoolElt                      Default: true
    Optimize: BoolElt                   Default: true
Given a prime p and an exponent n >= 1, create the finite field GF(p^n). The primitive polynomial used to construct GF(q) when n > 1 will be a Conway polynomial, if it is available.

By default p is checked to be a strong pseudoprime for 20 random bases b with 1 < b < p; if the parameter Check is false, then no check is done on p at all (this is useful when p is very large and one does not wish to perform an expensive primality test on p).

If the parameter Optimize is false, then no optimized representation (i.e. by using Zech logarithm tables or internal multi-step extensions) will be constructed for the new field which means that the time to create the field will be trivial but arithmetic operations in the field may be slower -- this is useful if say one wishes to just compute a few trivial operations on a few elements of the field alone.

ext<F | n> : FldFin, RngIntElt -> FldFin, Map
    Optimize: BoolElt                   Default: true
Given a finite field F and a positive integer n, create an extension G of degree n of F, as well as the embedding map phi : F -> G. The parameter Optimize has the same behaviour as that for the FiniteField function.
ext<F | P> : FldFin, RngPolElt(FldFin) -> FldFin, Map
    Optimize: BoolElt                   Default: true
Given a finite field F and a polynomial P of degree n over F, create an extension G=F[alpha] of degree n of F, as well as the natural embedding map phi : F -> G; the polynomial P must be irreducible over F, and alpha is one of its roots. Thus the defining polynomial of G over F will be P. The parameter Optimize has the same behaviour as that for the FiniteField function.
ExtensionField<F, x | P> : FldFin, RngIntElt -> FldFin, Map
Given a finite field F, a literal identifier x, and a polynomial P of degree n over F presented as a (polynomial) expression in x, create an extension G=F[x] of degree n of F, as well as the natural embedding map phi : F -> G; the polynomial P must be irreducible over F, and x is one of its roots. Thus the defining polynomial of G over F will be P. The parameter Optimize has the same behaviour as in the FiniteField function.
SplittingField(P) : RngPolElt(FldFin) -> FldFin
Given a univariate polynomial P over a finite field F, create the splitting field of P, that is, the smallest-degree extension field G of F such that P factors completely into linear factors over G.
SplittingField(S) : RngPolElt(FldFin) -> FldFin
Given a set S of univariate polynomials each over a finite field F, create the splitting field of S, that is, the smallest-degree extension field G of F such that for every polynomial P of S, P factors completely into linear factors over G.
sub<F | d> : FldFin, RngIntElt -> FldFin, Map
    Optimize: BoolElt                   Default: true
Given a finite field F of cardinality p^n and a positive divisor d of n, create a subfield E of F of degree d, as well as the embedding map phi : E -> F. The parameter Optimize has the same behaviour as in the FiniteField function.
sub<F | f> : FldFin, RngPolElt(FldFin) -> FldFin, Map
    Optimize: BoolElt                   Default: true
Given a finite field F and an element f of F, create the subfield E of F generated by f, together with the embedding map phi : E -> F. The map and field are constructed so that phi(w)=f, where w is the generator of E (that is, E.1). The parameter Optimize has the same behaviour as in the FiniteField function.
GroundField(F) : FldFin -> FldFin
Given a finite field F, return its ground field. If F was constructed as an extension of the field E, this function returns E; if F was not explicitly constructed as an extension then the prime field is returned.
PrimeField(F) : FldFin -> FldFin
The subfield of F of prime cardinality.
F meet G : FldFin, FldFin -> FldFin
Given finite fields F and G of the same characteristic p, return the finite field that forms the intersection Fintersect G.

Example FldFin_Extensions (H27E1)

To define the field of 7 elements, use

> F7 := FiniteField(7);
We can define the field of 7^4 elements in several different ways. We can use the Conway polynomial:

> F<z> := FiniteField(7^4);
> F;
Finite field of size 7^4
We can define it as an extension of the field of 7 elements, using the internal polynomial:

> F<z> := ext< F7 | 4 >;
> F;
Finite field of size 7^4
We can supply our own polynomial, say x^4 + 4x^3 + 2x + 3:

> P<x> := PolynomialRing(F7);
> p := x^4+4*x^3+2*x+3;
> F<z> := ext< F7 | p >;
> F;
Finite field of size 7^4
We can define it as an extension of the field of 7^2 elements:

> F49<w> := ext< F7 | 2 >;
> F<z> := ext< F49 | 2 >;
> F;
Finite field of size 7^4

Creating Relations

Embed(E, F) : FldFin, FldFin ->
Given finite fields E and F of cardinality p^d and p^n, such that d divides n, assert the embedding relation between E and F. That is, an isomorphism between E and the subfield of F of cardinality p^d is set up, and can be used from then on to move between the fields E and F. If both E and F have been defined with Conway polynomials then the isomorphism will be such that the generator beta of F is mapped to alpha^((p^n - 1)/(p^d - 1)), where alpha is the generator of F.
Embed(E, F, x) : FldFin, FldFin ->
Given finite fields E and F of cardinality p^d and p^n such that d divides n, as well as an element x in F, assert the embedding relation between E and F mapping the generator of E to x. The element x must be a root of the polynomial defining E over the prime field. Thus an isomorphism between E and the subfield of F of cardinality p^d is set up, and can be used from then on to move between the fields E and F.

Creation of Elements

One(F) : FldFin -> FldFinElt
Identity(F) : FldFin -> FldFinElt
Zero(F) : FldFin -> FldFinElt
Representative(F) : FldFin -> FldFinElt
These generic functions create 1, 1, 0, and 0 respectively, in any finite field.
F . 1 : FldFin -> FldFinElt
The generator for F as an algebra over its ground field. Thus, if F was defined by the polynomial P=P(X) over E, so F isomorphic to E[X]/P(X), then F.1 is the image of X in F.

If F is a prime field, then 1=1_F will be returned.

elt<F | a> : FldFin, RngElt -> FldFinElt
F ! a : FldFin, RngElt -> FldFinElt
Given a finite field F create the element specified by a; here a is allowed to be an element coercible into F, which means that a may be
elt<F | a_0, ..., a_n - 1> : FldFin, [FldFinElt] -> FldFinElt
Given a finite field F with generator w of degree n over the ground field E, create the element a_0 + a_1w + ... + a_(n - 1)w^(n - 1) in F, where a_i in E (0 <= i <= (n - 1)). If the a_i are in some subfield of E or the a_i are integers, they will be coerced into the ground field.
Random(F) : FldFin -> FldFinElt
Create a `random' element of finite field F.

Special Elements

F . 1 : FldFin, RngIntElt -> FldFinElt
Generator(F) : FldFin -> FldFinElt
Given a finite field F, this function returns the element f of F that generates F over its ground field E, so F=E[f]. This is the same as the element F.1.
Generator(F, E) : FldFin, FldFin -> FldFinElt
Given a finite field F and a subfield E of F, this function returns an element f of F that generates F over E, so F=E[f]. Note that this element may be different from the element F.1, but if F.1 works it will be returned.
PrimitiveElement(F) : FldFin -> FldFinElt
Given a finite field F, this function returns a primitive element for F, that is, a generator for the multiplicative group F^ * of F. Note that this may be an element different from the generator F.1 for the field as an algebra. This function will return the same element upon different calls with the same field; the primitive element that is returned is the one that is used as basis for the Log function.
NormalElement(F) : FldFin -> FldFinElt
Given a finite field F=GF(p^n), this function returns a normal element for F over the ground field G, that is, an element alpha in F such that alpha, alpha^q, ..., alpha^(q^(n - 1)) forms a basis for F over G, where q is the cardinality of G, and n the degree for F over G. Two calls to this function with the same field may result in different normal elements.
NormalElement(F, E) : FldFin, FldFin -> FldFinElt
Given a finite field F=GF(q^n) and a subfield E=GF(q), this function returns a normal element for F over E, that is, an element alpha in F such that alpha, alpha^q, ..., alpha^(q^(n - 1)) forms a basis for F over E.

Sequence Conversions

SequenceToElement(s, F) : [ FldFinElt ] -> FldFinElt
Seqelt(s, F) : [ FldFinElt ] -> FldFinElt
Given a sequence s=[s_0, ..., s_(n - 1)] of elements of a finite field E, of length equal to the degree of the field F over its subfield E, construct the element s=s_0 + s_1w + ... + s_(n - 1)w^(n - 1) of F, where w is the generator F.1 of F over E.
ElementToSequence(a) : FldFinElt -> [ FldFinElt ]
Eltseq(a) : FldFinElt -> [ FldFinElt ]
Given an element a of the finite field F, return the sequence of coefficients [a_0, ..., a_(n - 1)] in the ground field E of F such that a=a_0 + a_1w + ... + a_(n - 1)w^(n - 1), with w the generator of F over E, and n the degree of F over E.
ElementToSequence(a, E) : FldFinElt, FldFin -> [ FldFinElt ]
Eltseq(a, E) : FldFinElt, FldFin -> [ FldFinElt ]
Given an element a of the finite field F, return the sequence of coefficients [a_0, ..., a_(n - 1)] in the subfield E of F such that a=a_0 + a_1w + ... + a_(n - 1)w^(n - 1), with w the generator of F over E, and n the degree of F over E.
[Next] [Prev] [Right] [Left] [Up] [Index] [Root]