Patch submitted at http://sagetrac.org/sage_trac/ticket/7890
the conversion of matrices only works when the conversion of the gap ring works. In particular, it fails for cyclotomic fields, cyclotomic rings, and finite fields of non-prime order. I have also modified the _matrix_ method so that if no ring is given it tries to pick it up from the first matrix entry. To make this patch *really* useful conversion for all the missing kinds of rings and fields should be implemented. For GF(p^x) the only thing that needs to be done is to expand the p^x part (gap actually returns something like "GF(2^4)" rather than "GF(16)" into a number and then call the sage conversion specifying a generator name. For cyclotomic and other kinds of fields some more work is needed. Since GAP has two methods (Ring() and Field()) that are relevant here, it would be great to have a way of deciding which one should be called. Any further work along these lines will be most welcome! Cheers J On Jan 10, 2:37 pm, Dima Pasechnik <dimp...@gmail.com> wrote: > Javier, > > [...] > > > So, it wasn't that hard (for matrices) after all. > Good! > > I don't know whether/ > > how this can be applied to the E(9) thing unless there is an > > IsSomething gap method that can be used for them. > > Sure, there is > IsCyclotomic > and IsIntegralCyclotomic > for cyclotomics, resp., cyclotomic integers: > > gap> IsIntegralCyclotomic(E(9)); > true > gap> Field(E(9)); > CF(9) > > and > > IsFFE for finite field elements: > > gap> IsFFE(Z(5)); > true > gap> Field(Z(5)); > GF(5) > > for more general fields and for rings it's also doable... > > Cheers, > Dima > > > > > I'll prepare some doctests and upload a first patch. > > > 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