Creation Functions

Contents

Creation of Structures

GaloisRing(q, d) : RngIntElt, RngIntElt -> RngGal
GR(q, d) : RngIntElt, RngIntElt -> RngGal
Given integers q, d≥1, where q = pa for prime p and a≥1, create the default Galois ring GR(pa, d). The defining polynomial used to construct the ring will be that used for GF(pd), lifted to Zpa. If p is very large, it is advised to use the next function instead, because Magma must first factor q completely.

The angle bracket notation can be used to assign names to the generator; e.g.: R<w> := GaloisRing(2, 3).

GaloisRing(p, a, d) : RngIntElt, RngIntElt, RngIntElt -> RngGal
GR(p, a, d) : RngIntElt, RngIntElt, RngIntElt -> RngGal
    Check: BoolElt                      Default: true
Given a prime p and integers a, d≥1, create the default Galois ring GR(pa, d). The defining polynomial used to construct the ring will be that used for GF(pd), lifted to Zpa.

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).

GaloisRing(q, D) : RngIntElt, RngUPol -> RngGal
GR(q, D) : RngIntElt, RngUPol -> RngGal
Given an integer q, where q = pa for prime p and a≥1, and a monic polynomial D over Z such that D is irreducible mod p, create the Galois ring R = GR(pa, D). The coefficients of D are reduced modulo pa, and R is constructed to behave like the polynomial quotient ring Z_(p^a)[x]/<D>. If p is very large, it is advised to use the next function instead, because Magma must first factor q completely.
GaloisRing(p, a, D) : RngIntElt, RngIntElt, RngUPol -> RngGal
GR(p, a, D) : RngIntElt, RngIntElt, RngUPol -> RngGal
    Check: BoolElt                      Default: true
Given a prime p, an integer a≥1, and a monic polynomial D over Z such that D is irreducible mod p, create the Galois ring R = GR(pa, D). The coefficients of D are reduced modulo pa, and R is constructed to behave like the polynomial quotient ring Z_(p^a)[x]/<D>. The parameter Check is as above.

Names

AssignNames(~R, [f]) : RngGal, [ MonStgElt ]) ->
Procedure to change the name of the generating element in the Galois ring R to the contents of the string f. When R is created, the name will be R.1.

This procedure only changes the name used in printing the elements of R. It does not assign to an identifier called f the value of the generator in R; to do this, use an assignment statement, or use angle brackets when creating the ring.

Note that since this is a procedure that modifies R, it is necessary to have a reference ~R to R in the call to this function.

Name(R, 1) : RngGal, RngIntElt -> RngGalElt
Given a Galois ring R, return the element which has the name attached to it, that is, return the element R.1 of R.

Creation of Elements

One(R) : RngGal -> RngGalElt
Identity(R) : RngGal -> RngGalElt
Zero(R) : RngGal -> RngGalElt
Representative(R) : RngGal -> RngGalElt

These generic functions create 1, 1, 0, and 0 respectively, in any Galois ring.

R . 1 : RngGal -> RngGalElt
Generator(R) : RngGal -> RngGalElt
The generator for R as an algebra over its base ring {Z_(p^a)}. Thus, if R is viewed as {Z_(p^a)[x]/<D>}, then R.1 corresponds to x in this presentation.
R ! a : RngGal, RngElt -> RngGalElt
Given a Galois ring R create the element specified by a; here a is allowed to be an element coercible into R, which means that a may be
(i)
An element of R;
(ii)
An integer, to be identified with a modulo the characteristic pa of R;
(iii)
An element of the base ring {Z_(p^a)} of R, to be identified with the corresponding element of R.
(iv)
A sequence of elements of the base ring {Z_(p^a)} of R. In this case the element a0 + a1w + ... + an - 1wn - 1 is created, where a=[a0, ... an - 1] and w is the generator R.1 of R over {Z_(p^a)}.
Random(R) : RngGal -> RngGalElt
Create a pseudo-random element of Galois ring R.

Sequence Conversions

ElementToSequence(a) : RngGalElt -> [ RngIntResElt ]
Eltseq(a) : RngGalElt -> [ RngIntResElt ]
Given an element a of the Galois ring R, return the sequence of coefficients [a0, ..., an - 1] in the base ring {Z_(p^a)} of R (where R is Z_(p^a)[x]/<D>), such that a=a0 + a1w + ... + an - 1wd - 1, with w the generator of R, and d the degree of D.

Example RngGal_Create (H54E1)

We can define the Galois ring GR(23, 2) using the default function:
> R<w> := GaloisRing(2^3, 2);
> R;
GaloisRing(2, 3, 2)
We note that R has characteristic 8 and that w2 + w + 1 = 0 in R.
> R!8;
0
> R!9;
1
> w;
w
> 4*w;
4*w
> 4*w + 4*w;
0
> w^2;
7*w + 7
> w^2 + w + 1;
0
We can list all the elements of R by simply looping over R:
> [x: x in R];
[ 0, 1, 2, 3, 4, 5, 6, 7, w, w + 1, w + 2, w + 3, w + 4, w + 5, w + 6,
    w + 7, 2*w, 2*w + 1, 2*w + 2, 2*w + 3, 2*w + 4, 2*w + 5, 2*w + 6, 2*w
    + 7, 3*w, 3*w + 1, 3*w + 2, 3*w + 3, 3*w + 4, 3*w + 5, 3*w + 6,
    3*w + 7, 4*w, 4*w + 1, 4*w + 2, 4*w + 3, 4*w + 4, 4*w + 5, 4*w +
    6, 4*w + 7, 5*w, 5*w + 1, 5*w + 2, 5*w + 3, 5*w + 4, 5*w + 5, 5*w
    + 6, 5*w + 7, 6*w, 6*w + 1, 6*w + 2, 6*w + 3, 6*w + 4, 6*w + 5,
    6*w + 6, 6*w + 7, 7*w, 7*w + 1, 7*w + 2, 7*w + 3, 7*w + 4, 7*w +
    5, 7*w + 6, 7*w + 7 ]
We see that the elements of R can be considered as polynomials of degree at most 1, with coefficients in the range { 0 ... 7}.

We can easily create elements of R also using the ! operator, and use the Eltseq function to recover the corresponding sequence of coefficients.

> R ! [1, 2];
2*w + 1
> Eltseq(2*w + 1);
[ 1, 2 ]
> Eltseq(w);
[ 0, 1 ]
V2.28, 13 July 2023