This is now Ticket #7890:
http://trac.sagemath.org/sage_trac/ticket/7890

Thanks for volunteering to work on this, Dmitri! It would be awesome
to be able to access all that gap functions from sage.
Skimming a bit at the conversion code, it looks like the function
"sage" is called on the gap string representing the gap object. A big
part of the problem seems to be deciding what to do with that string
(i.e. to what type of sage object is it converted). For instance if
you create a gap matrix (with integral coefficients) it gets converted
back into a list of lists and not into a sage matrix:

sage: A = gap([[1,2],[2,3]])
sage: A.IsMatrix()
true
sage: B = A.sage()
sage: B
[[1, 2], [2, 3]]
sage: type(B)
<type 'list'>

Maybe the best place to start is to look at any objects that can be
successfully converted back and forth and see what is going on there.

Cheers
J

On Jan 10, 7:43 am, Alex Ghitza <aghi...@gmail.com> wrote:
> On Sat, 9 Jan 2010 21:35:31 -0800 (PST), Dima Pasechnik <dimp...@gmail.com> 
> wrote:
>
> > from what I gather, it asks first of all for a consistent way to
> > handle GAP's field elements. A field can be finite, as here in this
> > thread, or, say, cyclotomic, as it would happen, e.g., when dealing
> > with character tables (or representations of finite groups over C).
> > And there seems to be no functionality whatsoever for this in Sage. Am
> > I correct?
>
> What is "this" in your sentence?  Finite fields?  Cyclotomic fields?
> Both of these are definitely in Sage, have a look at
>
> sage: FiniteField?
>
> sage: CyclotomicField?
>
> > Actually, I particularly badly need a way to convert GAP's cyclotomics
> > into Sage's data, so I might like to pick this up, although this would
> > be my very 1st Sage coding project, and I would need a lot of pointers
> > of how to start...
>
> You can start by having a look at interfaces/gap.py in the Sage library,
> for instance at the GapElement class.  You would want something like
> this to work:
>
> sage: a = gap('E(9)')
> sage: a.sage()
>
> At the moment, that raises a NotImplementedError.
>
> You also want to look at the CyclotomicField class in
> rings/number_field/number_field.py, more particularly at its __call__()
> method which converts various things into elements of a cyclotomic
> field.
>
> I don't have time to give more details now, but it should help you to
> start.  Let us know how it's going!
>
> Best,
> Alex
>
> --
> Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
> -- Australia --http://www.ms.unimelb.edu.au/~aghitza/
-- 
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