"letsimp" honors "modulus" only partially?



Hi,

there is the package "gf" which would do all of this ---
unfortunately it is broken, and only some of the functions
work.

The package-functions are also very slow.

To work with finite fields in the context of AES (Rijndael),
we found it finally much easier (and computationally much
faster) to develop our own simple system:

See the Internet mirror

http://cs.swan.ac.uk/~csoliver/ok-sat-library/internet_html/doc/doxygen_html/de/ddc/ByteField_8mac_source.html

for the basic functions regarding "the" finite field with 256 elements.

We do not use "let" or something like that, but explicit representations
and explicit computations.

Oliver

P.S. The code of the above module is not stand-alone but includes
other modules as stated by the include-commands. But they
are only simple tools, and they are all available via the
Internet mirror. You can also get the OKlibrary
http://www.ok-sat-library.org/
which installs everything for you (on a Linux system), Maxima,
gcc, SAT solvers, R, Sage, ..., but you should also find
everything on the Internet. Or you just download it, without
installing, and then you have all our Maxima-code locally.

On Sun, Nov 20, 2011 at 10:09:58PM +0100, Lutz Euler wrote:
> 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
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima

-- 
Dr. Oliver Kullmann
Department of Computer Science
College of Science, Swansea University
Faraday Building, Singleton Park
Swansea SA2 8PP, UK
http://cs.swan.ac.uk/~csoliver/