[GAP Forum] Coefficients of finite field element

Ángel del Río adelrio at um.es
Sun Sep 30 10:35:27 BST 2018


Hi,

How can I get the coefficients of an element of a finite field in a basis?
For example, I would like to obtain the coefficients of z^189 in the 
canonical basis of GF(2^32) with z a primitive element of F. The 
following calculation shows that GAP knows them and I could manually 
read it but I would like to have an automatic way to obtain the 
coefficients.

gap> F:=GF(2^32);
GF(2^32)
gap> CB:=CanonicalBasis(F);
CanonicalBasis( GF(2^32) )
gap> Elements(CB);
[ z0, z31, z30, z29, z28, z27, z26, z25, z24, z23, z22, z21, z20, z19, z18,
   z17, z16, z15, z14, z13, z12, z11, z10, z9, z8, z7, z6, z5, z4, z3, 
z2, z ]
gap> z := PrimitiveElement(F);
z
gap> z^189;
1+z3+z5+z11+z12+z13+z14+z15+z17+z22+z23+z24+z25+z28+z30

Thanks,

Ángel

-- 
Ángel del Río Mateos
Dep. Matemáticas
Universidad de Murcia
30100 Murcia, Spain
adelrio at um.es
Phone: +34 868 88 3537
Fax:   +34 868 88 4182



More information about the Forum mailing list