New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating and passing permutation groups and their elements in libgap #26960
Comments
comment:1
copying from my sage-devel post:
Unfortunately Also, currently this is done via strings, and there should be a much |
comment:2
Replying to @dimpase:
See ticket description.
As you can see in the ticket description, it would be nice if |
comment:3
One of the problems is that Gap has a fundamental datatype for "permutation" (with special syntax support!) that Sage does not have. One way to obtain what you request is by letting a python tuple of tuples translate into a permutation in libgap. I think that's a poor match-up. Currently both python tuples and lists get converted into gap lists. There's a bit of a loss there, but if Gap does not have a more suitable translation for a tuple (a permutation cycle certainly isn't), then that's probably the best choice. The next best thing is a routine (in gap?) that takes a list of lists, interprets it as a cycle product, and returns the product as a permutation in Gap. There is such a routine in Gap 4.10, (but by the looks of it not in 4.8): https://www.gap-system.org/Manuals/doc/ref/chap42.html#X7B3194EC869D936D So if we can delay this ticket until libgap is upgraded to 4.10, then we can do simply something like
I would recommend to keep "libgap" as thin as possible: provide only a very faithful interface to and from gap, hopefully with as many useful basic datastructure mappings as possible. Then we can write convenient tools to translate back and forth higher level objects based on that. If we keep that basics of libgap largely independent of sage, I think you'll get the best cooperation from the Gap people in making it work well. |
comment:5
Replying to @simon-king-jena:
I wasn't aware of that. Then I suggest you investigate using |
comment:6
Replying to @nbruin:
Sage does have fast permutations (in Cython) as a fundamental datatype, it merely lacks a convenient syntax. So the translation Sage<->GAP ought to be on that level, C arrays to C arrays. |
comment:7
Replying to @dimpase:
I see. Indeed, this works presently:
This looks like a more promising route than using It would not be unreasonable to be able to use I'm also not so sure that currently the element returned by Should this ticket be the place to track more efficient permutation conversion between sage and libgap? |
comment:8
how about such a tagline? |
comment:9
Replying to @nbruin:
I don't know what MRO is, but by reading src/sage/groups/perm_gps/permgroup_element.pyx one might see that the actual data for a permutation group element (not to be confused with By the way, it seems that |
comment:10
OK, indeed. In one direction we're there already:
However, the round-trip is a bit off:
So it looks like either In addition, perhaps it would be nice to merge the two notions of |
comment:11
Replying to @nbruin:
I am not at all sure that this goes directly from the C array in Sage.
One might implement
well, yes and no. One reason for the divergence of the two we see in GAP is historical, the combinatorics of permutations comes from sage-combinat project. |
comment:12
Replying to @dimpase:
And then prefer that to the present conversion performed by
No, why would that need to change? It gives whatever gap parses it to, wrapped by libgap in the appropriate element class. Are you worried that
|
comment:13
Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sage-pending or sage-wishlist. |
comment:14
Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually) |
comment:15
As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9). |
The GAP notation for permutations is a bit strange. A permutation group can, for example, be created like this:
Rather than evaluating string, it would be more pythonic to be able to do the following (which currently fails):
I am not aware of a different pythonic way to create a permutation group in libgap. If there is, please speak up and review this as "duplicate/won't fix".
CC: @dimpase
Component: interfaces
Keywords: libgap permutation group
Issue created by migration from https://trac.sagemath.org/ticket/26960
The text was updated successfully, but these errors were encountered: