Subject: "letsimp" honors "modulus" only partially?
From: Lutz Euler
Date: Sun, 20 Nov 2011 22:09:58 +0100
Hi,
I am trying to calculate x^31 in the finite field with 125 elements,
(Z/5Z)[x]/(x^3 - x - 2). I don't know the canonical way to deal with
fields of this kind in Maxima, but I found "letsimp" and the variable
"modulus" and that nearly works. This is Maxima 5.25.1:
(%i1) display2d:false$
(%i2) let (x^3, x + 2);
(%o2) ?mtext(x^3,?\ \-\-\>\ ,x+2)
First, without "modulus" to show the unreduced coefficients:
(%i3) letsimp (x^31);
(%o3) 75020*x^2+114205*x+98642
Trying the reduction modulo 5 in one go:
(%i4) letsimp (x^31), modulus:5;
(%o4) 400*x^2-135*x+2
The coefficients are different but Maxima didn't notice that the
first two are zero. This is no problem as I can use "ratsimp" to
finish the job:
(%i5) ratsimp(%), modulus:5;
(%o5) 2
So, although I got my result, I would like to ask:
1. Shouldn't "letsimp" honor "modulus" either completely or not at all?
Is this documented somewhere?
2. Is this the best way to work in finite fields constructed as
quotient rings?
Thanks in advance,
Lutz