Hi Simon,

On Jan 10, 7:57 pm, Simon King <simon.k...@nuigalway.ie> wrote:
> Is it possible to chose take the same name that GAP uses?

In GAP the generator of (the multiplicative group of) say GF(16) is
called "Z(2^4)", so I guess the answer is no, we cannot use GAP name.
We can go for something like Z16, or z_16 or anything like that.

I have been trying some code to convert elements of gap finite fields
into the corresponding elements of sage finite fields. The sort of
straightforward manner fails because of this behavior:

sage: a = gap("Z(2^4)")
sage: a^5
Z(2^2)

and apparently sage has no way of coercing finite fields into bigger
finite fields (in this example a coercion map from GF(4) to GF(16)
would send z4 to z16^5):

sage: A = GF(4, "z4")
sage: B = GF(16, "z16")
sage: x = A.gen()
sage: B(x)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/Users/javier/<ipython console> in <module>()

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/
finite_field_givaro.so in
sage.rings.finite_field_givaro.FiniteField_givaro.__call__ (sage/rings/
finite_field_givaro.cpp:4466)()

TypeError: unable to coerce from a finite field other than the prime
subfield


 I can find a way around this by parsing the GAP strings with a lot of
care, but that is going to be an ugly piece of code and I'd rather
avoid it. Is there an easy way of getting the coercion maps for finite
fields, or maybe a way of regularizing the GAP output so that
everything is written in terms of the generator?

Cheers
J
-- 
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