Hi all
I work a lot with finite fields and polynomials over these, and the
standard string representation of finite field elements as polynomials
is not very convenient for me; I would much prefer to represent each
non-zero element as a power of the field's generator. I am having
trouble making the Sage Notebook do this for me.

Givaro fields support in their constructor an argument repr which
should set the standard representation of the elements. The
possibilities are log, int and poly. poly is the standard and log is
close to what I want. However, there are some issues with log: it
makes the str representation of a field element be just an integer
representing the power of the field generator (with the convention
that 0 is the 0 element and F.cardinality -  1 is the 1 element),
while I would like a string like "generator^power" and "0" for the
zero element. I have written a small patch to make it work like I
want.

More importantly, though, it seems that the Notebook does not use this
representation hint at all when showing field elements!
I have tried writing a patch for
sage.rings.finite_rings.element_givaro adding a str-method and repr-
methods with both one and two underscores around the name, but that
does not help. It works in the shell. Which method does the Notebook
call for representing finite field elements?

If someone can help me find this function so I can write a patch on my
machine, we could take up the discussion on whether it could be
sensible to let the above representation of finite fields be the
standard when specifying "repr = 'log'".  Or even the standard
representation when not specifying repr?

Thanks and regards,
Johan

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to