embray / gappy

Python interface to GAP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More efficient access to GAP permutations

embray opened this issue · comments

As mentioned at https://trac.sagemath.org/ticket/31404#comment:17 I removed efficient access to permutation elements since the libgap API currently lacks interfaces specific to permutations.

Should work on a PR to GAP to add the minimum necessary interfaces; in the meantime we can temporarily include implementations of these interfaces in gappy using the necessary internal GAP functions. Always unfortunate to have to do that, but it is doable in a pinch as GAP does not actively hide its internals.

In Sage, permutation group elements are represented by an array of ints of size of the degree of the group. GapPermutation could include a C method for copying the elements of the GAP permutations into such an array, given a pointer to an int array and degree (basically as PermGroupElement currently does in Sage. That way the details of this could be moved into gappy (somewhat like I've done with GapInteger.to_mpz and the like).