On Tuesday, March 22, 2016 at 1:09:07 PM UTC, Dima Pasechnik wrote: > > use libgap: > > sage: g=libgap.SymmetricGroup(7) > sage: g.Orbits(tuples([1..7],2),libgap.OnTuples) > [ [ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ], [ 4, 4 ], [ 5, 5 ], [ 6, 6 ], [ 7, 7 ] > ], [ [ 1, 2 ], [ 2, 3 ], [ 2, 1 ], [ 3, 4 ], [ 1, 3 ], [ 3, 2 ], [ 4, 5 ], > [ 2, 4 ], [ 4, 3 ], [ 3, 1 ], [ 5, 6 ], [ 3, 5 ], [ 1, 4 ], [ 5, 4 ], [ 4, > 2 ], [ 6, 7 ], [ 4, 6 ], [ 2, 5 ], [ 6, 5 ], [ 5, 3 ], [ 4, 1 ], [ 7, 1 ], > [ 5, 7 ], [ 3, 6 ], [ 1, 5 ], [ 7, 6 ], [ 6, 4 ], [ 5, 2 ], [ 7, 2 ], [ 6, > 1 ], [ 4, 7 ], [ 2, 6 ], [ 1, 7 ], [ 7, 5 ], [ 6, 3 ], [ 5, 1 ], [ 6, 2 ], > [ 3, 7 ], [ 1, 6 ], [ 2, 7 ], [ 7, 4 ], [ 7, 3 ] ] ] > > if you only need representatives, you can just use map:
map(lambda x: x[0], g.OrbitsDomain(tuples([1..7],2),libgap.OnTuples)) (Here I used OrbitsDomain, which you should use for efficiency if you know that your set is invariant under your group) > On Tuesday, March 22, 2016 at 9:19:18 AM UTC, Jernej wrote: >> >> Hello! >> >> I have a few questions concerning GAP interface in Sage 7.x. >> >> I have a permutation group G acting on a set S and I would like to >> compute the representatives of the orbits of G acting on k-sets of S. >> >> I recall that a while ago I could do the following (as seen on this >> example >> http://ask.sagemath.org/question/9652/orbits-on-group-actions-acting-on-sets/?answer=14470#post-id-14470 >> ) >> >> ==== >> sage: g=SymmetricGroup(7) >> sage: gap("Orbits("+str(g._gap_())+","+str(tuples([1..7],2))+",OnTuples)") >> ==== >> >> and yes, it works in Sage 6.x. However, in Sage 7.x one gets the >> following error >> >> ==== >> TypeError: Gap terminated unexpectedly while reading in a large line: >> Gap produced error output >> Error, Permutation: cycles must be disjoint and duplicate-free >> ==== >> >> Given this, I have the following questions >> >> - What is the proper way to call gap in Sage 7x t obtain the orbits of a >> group G acting on k-sets of a set S? >> - (GAP question) I recall there is a way to return only the >> representatives of the orbits? Anyone happens to recall the right GAP >> command for that? >> - Does it make sense to add an option for various group actions to Sage >> directly (as is already done for specific orbits ) ? >> >> Best, >> >> Jernej >> > -- 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 sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.