Skip to content

Use GroupHomset_libgap for permutation groups, as well #26750

Closed

Description

@soehms

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!

Depends on #26420

CC: @tscrim @simonbrandhorst

Component: group theory

Keywords: permutation group, homomorphism, libgap

Author: Sebastian Oehms

Branch: 66ceb94

Reviewer: Simon Brandhorst

Issue created by migration from https://trac.sagemath.org/ticket/26750

Activity

  1. added this to the sage-8.5 milestone on Nov 23, 2018
  2. soehms commented on Nov 24, 2018

    @soehms
    MemberAuthor
  3. soehms commented on Nov 24, 2018

    @soehms
    MemberAuthor

    Dependencies: #26420

  4. soehms commented on Nov 24, 2018

    @soehms
    MemberAuthor

    Commit: 28f39df

  5. soehms commented on Nov 24, 2018

    @soehms
    MemberAuthor
    comment:2

    I do the following:

    1. 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)

    2. I implement the method _Hom_ in PermutationGroup_generic to have hom use class GroupHomset_libgap.

    3. 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.

    4. 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.


    New commits:

    841a405group morphism constructor from a libgap morphism
    08a0735a doctest
    b2d9622docs
    21cb664correct docstring for argument `gap_hom`
    2a432d0Merge commit '21cb66449cd424f94d15bd695fa986a0ce40c30c' of git://trac.sagemath.org/sage into libgap_morphism_permgroup-26750
    28f39dfinitial version
  6. simonbrandhorst commented on Nov 28, 2018

    @simonbrandhorst
    comment:3

    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?

  7. sagetrac-git commented on Nov 28, 2018

    sagetrac-gitmannequin
    Mannequin

    Branch pushed to git repo; I updated commit sha1. New commits:

    deaa647remove unnecessary method _obtain_gap_hom
  8. sagetrac-git commented on Nov 28, 2018

    sagetrac-gitmannequin
    Mannequin

    Changed commit from 28f39df to deaa647

  9. soehms commented on Nov 28, 2018

    @soehms
    MemberAuthor
    comment:5

    Thanks for looking at this, Simon! Of course you are right: This method has been a stupid idea! I corrected as you suggested.

  10. sagetrac-git commented on Nov 28, 2018

    sagetrac-gitmannequin
    Mannequin

    Branch pushed to git repo; I updated commit sha1. New commits:

    0133335implement subgroup / ambient methods for MatrixGroup_base
    747bc16removed unused keyword
    c3a92a4Merge branch 'develop' into matrix_groups_subgroups-25894
    901441bMerge branch 'develop' into matrix_groups_subgroups-25894
    b02eb31Merge branch 'libgap_morphism_permgroup-26750' into cubic_braid_group
    be4674binitial implementation
    6a07854Merge branch 'develop' into adapt_unitary_burau-26657
    806d0c6Merge branch 'adapt_unitary_burau-26657' into cubic_braid_group
    464b784Merge branch 'libgap_morphism_permgroup-26750' into cubic_braid_group
    2b74ce4restore deleted doctest
  11. sagetrac-git commented on Nov 28, 2018

    sagetrac-gitmannequin
    Mannequin

    Changed commit from deaa647 to 2b74ce4

  12. 30 remaining items

  13. simonbrandhorst commented on Dec 22, 2018

    @simonbrandhorst
    comment:30

    btw. if you split up your tickets into smaller ones, they are easier to review

  14. soehms commented on Dec 23, 2018

    @soehms
    MemberAuthor
  15. soehms commented on Dec 23, 2018

    @soehms
    MemberAuthor

    Changed commit from e0feb00 to 66ceb94

  16. soehms commented on Dec 23, 2018

    @soehms
    MemberAuthor

    Reviewer: Simon Brandhorst

  17. soehms commented on Dec 23, 2018

    @soehms
    MemberAuthor
    comment:32

    Replying to @simonbrandhorst:

    Positive review if you are happy with my changes & we have a green bot


    New commits:

    e0feb00changes 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!


    New commits:

    66ceb94adapt doc-strings to former change and ticket #26889
  18. soehms commented on Dec 23, 2018

    @soehms
    MemberAuthor
    comment:33

    Replying to @simonbrandhorst:

    btw. if you split up your tickets into smaller ones, they are easier to review

    Sure! I will try to take care of that the next time!

  19. vbraun commented on Dec 27, 2018

    @vbraun
    Member
  20. embray commented on Dec 28, 2018

    @embray
    Contributor

    Changed commit from 66ceb94 to none

  21. modified the milestones: sage-8.5, sage-8.6 on Dec 28, 2018
  22. soehms commented on Feb 7, 2019

    @soehms
    MemberAuthor
    comment:37

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions