You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use GroupHomset_libgap for permutation groups, as well #26750
At the moment the construction of group homomorphisms between groups implemented under the classes ParentLibGAP and PermutationGroup_generic (and vice versa) is not possible in sage using the method hom. For example, it isn't possible to construct the natural projection from symplectic groups onto the corresponding projective group although this is possible using GAP:
sage: Sp43 = Sp(4,3)
sage: PSp43 = PSp(4,3)
sage: natProj = Sp43.hom(PSp43.gens())
Traceback (most recent call last):
...
TypeError: unable to convert [(3,4)(6,7)(9,10)(12,13)(17,20)(18,21)(19,22)(23,32)(24,33)(25,34)(26,38)(27,39)(28,40)(29,35)(30,36)(31,37), (1,5,14,17,27,22,19,36,3)(2,6,32)(4,7,23,20,37,13,16,26,40)(8,24,29,30,39,10,33,11,34)(9,15,35)(12,25,38)(21,28,31)] to an element of Set of Morphisms from Symplectic Group of degree 4 over Finite Field of size 3 to The projective symplectic linear group of degree 4 over Finite Field of size 3 in Category of finite groups
The reason for this is that the constructor of the class GroupHomset_libgap explicitly checks both groups to be instances of ParentLibGAP. So an easy way to have hom work in such cases, as well, would be to allow PermutationGroup_generic additionally.
An alternative option is to shift PermutationGroup_generic into the ParentLibGAP framework. But this would cause a lot of work to have all doctests pass through. The main problem here is that the element class of PermutationGroup_generic still has parent as second (optional) argument (in opposite to ParentLibGAP).
Therefore, this ticket will follow the first option!
I add the method gap to the classes PermutationGroup_generic and PermutationGroupElement to achieve compatibility with class GroupHomset_libgap and its elements class. For the same reason I add the method _subgroup_constructor to PermutationGroup_generic (needed in the methods pushforward, kernel and preimage in GroupMorphism_libgap)
I implement the method _Hom_ in PermutationGroup_generic to have hom use class GroupHomset_libgap.
In the module libgap_morphism I add PermutationGroup_generic to the list of allowed parent-instances at all relevant pieces of code. Furthermore, I changed the _element_constructor_ in order to avoid buffer size overflow by transferring long lists of large permutation generators to GAP. This is done in a new local method _obtain_gap_hom.
I take the occasion to implement two methods from framework: section of class Map and natural_map of class HomsetWithBase improving their default implementation using the possibilities of GroupHomset_libgap and its element class.
I am not convinced the function _obtain_gap_hom is useful/necessary.
It seems to be used only for the natural_map method. But then the code just belongs there.
But indeed one could replace
gens = [g.gap() for g in dom.gens()]
by
gens = dom.gap().GeneratorsOfGroup()
in the _element_constructor_
and likewise for the images in natural map. Would that fix the overflow?
sagetrac-git commented on Nov 28, 2018
sagetrac-gitmannequin
Mannequin
More actions
Branch pushed to git repo; I updated commit sha1. New commits:
changes to docs and the permutation group and subgroup constructor
This is a good improvement in order to get the permutation groups closer to libgap!
I just do two doc-string adaptions and rename your GapElement since that name is already used globally with respect to sage.interfaces.gap
Thanks for the review, Simon.
I wish you a merry Christmas!
I've created a follow up ticket #27234 since by the improvements in connection with GAP 4.10 upgrade, the implementation of the gap method of class PermutationGroupElement can be done properly, right now.
Activity
soehms commentedon Nov 24, 2018
Branch: u/soehms/libgap_morphism_permgroup-26750
soehms commentedon Nov 24, 2018
Dependencies: #26420
soehms commentedon Nov 24, 2018
Commit:
28f39dfsoehms commentedon Nov 24, 2018
I do the following:
I add the method
gapto the classesPermutationGroup_genericandPermutationGroupElementto achieve compatibility with classGroupHomset_libgapand its elements class. For the same reason I add the method_subgroup_constructortoPermutationGroup_generic(needed in the methodspushforward,kernelandpreimageinGroupMorphism_libgap)I implement the method
_Hom_inPermutationGroup_genericto havehomuse classGroupHomset_libgap.In the module
libgap_morphismI addPermutationGroup_genericto the list of allowed parent-instances at all relevant pieces of code. Furthermore, I changed the_element_constructor_in order to avoid buffer size overflow by transferring long lists of large permutation generators to GAP. This is done in a new local method_obtain_gap_hom.I take the occasion to implement two methods from framework:
sectionof classMapandnatural_mapof classHomsetWithBaseimproving their default implementation using the possibilities ofGroupHomset_libgapand its element class.New commits:
841a405group morphism constructor from a libgap morphism08a0735a doctestb2d9622docs21cb664correct docstring for argument `gap_hom`2a432d0Merge commit '21cb66449cd424f94d15bd695fa986a0ce40c30c' of git://trac.sagemath.org/sage into libgap_morphism_permgroup-2675028f39dfinitial versionsimonbrandhorst commentedon Nov 28, 2018
I am not convinced the function
_obtain_gap_homis useful/necessary.It seems to be used only for the
natural_mapmethod. But then the code just belongs there.But indeed one could replace
by
in the
_element_constructor_and likewise for the images in natural map. Would that fix the overflow?
sagetrac-git commentedon Nov 28, 2018
Branch pushed to git repo; I updated commit sha1. New commits:
deaa647remove unnecessary method _obtain_gap_homsagetrac-git commentedon Nov 28, 2018
Changed commit from
28f39dftodeaa647soehms commentedon Nov 28, 2018
Thanks for looking at this, Simon! Of course you are right: This method has been a stupid idea! I corrected as you suggested.
sagetrac-git commentedon Nov 28, 2018
Branch pushed to git repo; I updated commit sha1. New commits:
0133335implement subgroup / ambient methods for MatrixGroup_base747bc16removed unused keywordc3a92a4Merge branch 'develop' into matrix_groups_subgroups-25894901441bMerge branch 'develop' into matrix_groups_subgroups-25894b02eb31Merge branch 'libgap_morphism_permgroup-26750' into cubic_braid_groupbe4674binitial implementation6a07854Merge branch 'develop' into adapt_unitary_burau-26657806d0c6Merge branch 'adapt_unitary_burau-26657' into cubic_braid_group464b784Merge branch 'libgap_morphism_permgroup-26750' into cubic_braid_group2b74ce4restore deleted doctestsagetrac-git commentedon Nov 28, 2018
Changed commit from
deaa647to2b74ce430 remaining items
simonbrandhorst commentedon Dec 22, 2018
btw. if you split up your tickets into smaller ones, they are easier to review
soehms commentedon Dec 23, 2018
Changed branch from u/sbrandhorst/libgap_morphism_permgroup_26750 to u/soehms/libgap_morphism_permgroup_26750
soehms commentedon Dec 23, 2018
Changed commit from
e0feb00to66ceb94soehms commentedon Dec 23, 2018
Reviewer: Simon Brandhorst
soehms commentedon Dec 23, 2018
Replying to @simonbrandhorst:
e0feb00changes to docs and the permutation group and subgroup constructorThis is a good improvement in order to get the permutation groups closer to libgap!
I just do two doc-string adaptions and rename your
GapElementsince that name is already used globally with respect tosage.interfaces.gapThanks for the review, Simon.
I wish you a merry Christmas!
New commits:
66ceb94adapt doc-strings to former change and ticket #26889soehms commentedon Dec 23, 2018
Replying to @simonbrandhorst:
Sure! I will try to take care of that the next time!
vbraun commentedon Dec 27, 2018
Changed branch from u/soehms/libgap_morphism_permgroup_26750 to
66ceb94embray commentedon Dec 28, 2018
Changed commit from
66ceb94to nonesoehms commentedon Feb 7, 2019
I've created a follow up ticket #27234 since by the improvements in connection with GAP 4.10 upgrade, the implementation of the
gapmethod of classPermutationGroupElementcan be done properly, right now.