[Math] computer algebra system for polynomial algebras over finite fields

computer-algebrafinite-fields

Is there a computer algebra system that can do arithmetic over polynomial algebras over finite fields where I can specify the extension?

Exempli gratia, if $f(x), g(x) \in \mathbb{F}_p[\mu]/(m(\mu))[x]$, I'd like the CAS to be able to compute things like $f(x + \mu) + g(x)$ where I specify the polynomial $m(\mu)$.

Thanks

Best Answer

You can do these things in Sage quite easily. Here is an example (using Sage 5.2):

sage: Fp.<mu>=GF(5)[]
sage: Fp
Univariate Polynomial Ring in mu over Finite Field of size 5
sage: m=mu^5-mu+1
sage: K.<y>=GF(5^5, name='y', modulus=m) # your mu becomes y
sage: A.<x>=K[]
sage: A
Univariate Polynomial Ring in x over Finite Field in y of size 5^5
sage: f=x^7-1
sage: f(x+y)
x^7 + 2*y*x^6 + y^2*x^5 + (y + 4)*x^2 + (2*y^2 + 3*y)*x + y^3 + 4*y^2 + 4
sage: g=x^2+x+1
sage: f(x+y)+g(x)
x^7 + 2*y*x^6 + y^2*x^5 + y*x^2 + (2*y^2 + 3*y + 1)*x + y^3 + 4*y^2

Another option is to use GAP (kindly provided by A.Konovalov)

gap> R:=PolynomialRing(GF(5),"mu"); mu:=Indeterminate(GF(5));;
GF(5)[mu]
gap> m:=mu^5-mu+1;
mu^5-mu+Z(5)^0
gap> T:=AlgebraicExtension(GF(5),m); a:=RootOfDefiningPolynomial(T);;
<field of size 3125>
gap> A:=PolynomialRing(T,"x"); x:=Indeterminate(T);;
<object>[x]
gap> f:=x^7-1;
x^7-!Z(5)^0
gap> Value(f,x+a);
x^7+Z(5)*a*x^6+a^2*x^5+(a-Z(5)^0)*x^2+(Z(5)*a^2+Z(5)^3*a)*x+(a^3-a^2-Z(5)^0)
gap> g:=x^2+x+One(T); 
x^2+x+!Z(5)^0 
gap> Value(f,x+a)+g; 
x^7+Z(5)*a*x^6+a^2*x^5+a*x^2+(Z(5)*a^2+Z(5)^3*a+Z(5)^0)*x+(a^3-a^2)