Hi
I am using SAGE to interface with GAP. (I don't really know GAP, just playing
with the SAGE interface to it).
My problem is that I am trying to efficiently enumerate the group elements (and
get their matrix representations) of various permutation groups. Now, of
course this problem quickly blows up due to the factorial growth of group
elements, but I am trying to see how far I can go. At the moment this is my
current toy solution:
def symmetricGroupElements(n):
i_max = SymmetricGroup(n).order()
libgap.eval("G := Iterator(Enumerator(SymmetricGroup({0})))".format(n))
nxtStr = "NextIterator(G)"
for x in xrange(1,i_max+1):
yield libgap.eval(nxtStr).sage().matrix()
This produces a generator that returns a matrix representation of an element of
the group S_n. The reason I am not using the list() function on a group is
because GAP builds up an entire list, blowing through all my (or the known
universe?) memory. On my current modern'ish Xeon machine, I can run through
that entire generator for S_10 in about 2 hours. My question is:
Can I do better? Memory and/or computation time wise. Should I rather be
interacting with libGAP on a more low level? I would imagine a lot of type
casting is going on between libGAP wrapper objects and the underlying C code. I
only need the matrices one at a time for further manipulation with SAGE.
(My GAP knowledge is very limited, it might just be that I am doing this in a
really stupid way...)
Karl
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.