Hi Jason,

On Nov 23, 3:42 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
> I'm trying to get a list of all groups of order 60.  After searching for
> a bit, I see in Gap that (if I install the optional spkg
> database_gap-4.4.12.p0.spkg) we have the AllSmallGroups command, which
> seems to do what I want.  But then I'm having problems converting those
> groups to Sage groups:
>
> sage: gg=gap.AllSmallGroups(60)
> sage: gg[1]._sage_()
> ---------------------------------------------------------------------------
> NotImplementedError                       Traceback (most recent call last)
>
> /Users/grout/<ipython console> in <module>()
>
> /Users/grout/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
> in _sage_(self)
>     1709             return sage.misc.sage_eval.sage_eval(self._sage_repr())
>     1710         except:
> -> 1711             raise NotImplementedError
>     1712
>     1713
>
> NotImplementedError:

That is a common thing. Gap-to-sage conversion relies more often than
not on trying to parse the gap string of the object, if sage doesn't
understand the string the conversion will fail. In general gap-to-sage
conversion is hard because gap objects don't have a "type". However,
since in gap there are a lot of Is* functions, one could just develop
a consistent way of checking gap objects until it is clear what they
are, and program specific "to-sage" conversion functions like the one
done for matrices over finite groups.

>
> Question 1: Is there a command in Sage that will give all groups of a
> certain order (maybe just the orders covered by the small group database
> in GAP)?

I am afraid not.

> Question 2: Is there an easy way to convert a GAP group to a Sage group?

I don't know if I'd call it "easy" but one thing you can do is to
transform your group to a permutation group and the translate that
into sage:

sage: gg = gap.AllSmallGroups(60)
sage: gg1 = gg[1]
sage: iso = gg1.IsomorphismPermGroup()
sage: gg2 = iso.Image()
sage: gens = gg2.GeneratorsSmallest()
sage: G1 = PermutationGroup(gens)
sage: type(G1)
<class
'sage.groups.perm_gps.permgroup.PermutationGroup_generic_with_category'>
sage: G1.order()
60

this can be useful for small groups, but I am afraid it would be
terribly inefficient for large ones. A better way would be
implementing general groups with generators and relations in sage, but
I don't know if any work has been done along these lines.

Cheers
Javier

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