Skip to content
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

Add minimal_normal_subgroups and maximal_normal_subgroups functions #37038

Merged

Conversation

RuchitJagodara
Copy link
Contributor

  • Added the function
    This patch implements a minimal_normal_subgroups function in PermutationGroup_generic class.

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

NA

This commit changes the _algebraic_ function of Expression class to
simplify the expression with simplify_full() function before converting
it to algebraic number.
Added the doctest for _element_constructor_() function of AlgebraicField class.
Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result should be converted back into Sage (permutation) (sub)groups.

Also, I don't see why $S_8$ should be a test (which are hidden in the final html doc) rather than a normal example.

@RuchitJagodara RuchitJagodara changed the title Add minimal_normal_subgroups function for permutation groups Add minimal_normal_subgroups and maximal_normal_subgroups functions for permutation groups Jan 10, 2024
@RuchitJagodara
Copy link
Contributor Author

I have done some necessary changes. But I just found that these methods can be implemented for all groups as the functions MaximalNormalSubgroups and MinimalNormalSubgroups works for all groups in gap, so I am considering implementing this in Sage for all groups, but I am having difficulty in finding the appropriate location to define these functions. Can you help me with this?

@tscrim
Copy link
Collaborator

tscrim commented Jan 11, 2024

You can add it to the Groups() category, but that wouldn't work because not all groups in Sage have a corresponding GAP version (see, e.g., right-angled Artin groups). However, there is a base class for all GAP groups, so you can implement it there.

@RuchitJagodara
Copy link
Contributor Author

I have relocated the function, but I believe the implementation is suboptimal. This is because it will consume a significant amount of time, as it needs to generate the generators first and then convert them into a subgroup (as demonstrated below). I attempted to explore alternative options but was unsuccessful. Do you have any suggestions for the fix for this?

return [self.subgroup(gap_subgroup.GeneratorsOfGroup()) for gap_subgroup in self.gap().MinimalNormalSubgroups()]

Also, were you referring to this particular Class? Because now for permutation groups it is giving an AttributeError (seems like permutationgroups are not derived from this class).

@tscrim
Copy link
Collaborator

tscrim commented Jan 12, 2024

Within ParentLibGAP, there is the _subgroup_constructor() method that you should use since you already have the GAP group (and always takes a GAP group object from doing a grep search).

@RuchitJagodara
Copy link
Contributor Author

I have implemented the modifications; however, I remain uncertain about the location of these functions. I am unable to invoke these functions when I have a permutation group(It is giving me AttributeError). Because this class is never inherited in the PermutationGroup class. So what should I do ? Because I am not sure whether inheriting that function in PermutationGroup class will be good or not.

@tscrim
Copy link
Collaborator

tscrim commented Jan 14, 2024

Something that is annoying is that permutation groups don't seem to use libgap. I think you need to have your previous implement in permgroup. Then that should cover the most number of cases I think...

src/sage/groups/libgap_wrapper.pyx Outdated Show resolved Hide resolved
src/sage/groups/libgap_wrapper.pyx Outdated Show resolved Hide resolved
src/sage/groups/perm_gps/permgroup.py Outdated Show resolved Hide resolved
src/sage/groups/perm_gps/permgroup.py Outdated Show resolved Hide resolved
src/sage/groups/perm_gps/permgroup.py Outdated Show resolved Hide resolved
src/sage/groups/perm_gps/permgroup.py Outdated Show resolved Hide resolved
src/sage/groups/libgap_wrapper.pyx Outdated Show resolved Hide resolved
src/sage/groups/libgap_wrapper.pyx Outdated Show resolved Hide resolved
@tscrim
Copy link
Collaborator

tscrim commented Jan 14, 2024

Please also squash and give at least a little bit better commit messages for the first two. These automated ones from github are not good (I want to fire that "feature" into the sun).

@RuchitJagodara RuchitJagodara force-pushed the add_minimal_normal_subgroups_method branch from 1e10cc6 to 1d90107 Compare January 14, 2024 13:57
@RuchitJagodara RuchitJagodara force-pushed the add_minimal_normal_subgroups_method branch from ce236ee to 0f17e65 Compare January 14, 2024 14:43
@RuchitJagodara
Copy link
Contributor Author

RuchitJagodara commented Jan 14, 2024

Done! I have applied all the changes that you suggested. Thank you for your help, @tscrim throughout :) . I learned a lot while working on this, and I won't make these types of mistakes again.

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. Thank you for the changes. This is just dealing with some trickier parts of Sage with how things are implemented because of the interfaces.

I am cc-ing @dimpase in case he has some comments.

@dimpase
Copy link
Member

dimpase commented Jan 14, 2024

@fchapoton did some work on removing pexpect GAP and replacing it with libgap just last week.

Maybe it should be taken into account here

@tscrim
Copy link
Collaborator

tscrim commented Jan 15, 2024

Good point. I rebased this off the latest develop, which should have #36889 included. Since there are no merge conflicts and @RuchitJagodara wrote the code with future-proofing in mind, there shouldn’t be any issues (which will be reflected in the tests all passing). I also don’t see any way to make additional improvements at this point either.

Copy link

Documentation preview for this PR (built with commit fa26be9; changes) is ready! 🎉

vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2024
…groups functions for permutation groups

    
- Added the function
This patch implements a minimal_normal_subgroups function in
PermutationGroup_generic class.
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
NA
    
URL: sagemath#37038
Reported by: Ruchit Jagodara
Reviewer(s): Ruchit Jagodara, Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2024
…groups functions for permutation groups

    
- Added the function
This patch implements a minimal_normal_subgroups function in
PermutationGroup_generic class.
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
NA
    
URL: sagemath#37038
Reported by: Ruchit Jagodara
Reviewer(s): Ruchit Jagodara, Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2024
…groups functions for permutation groups

    
- Added the function
This patch implements a minimal_normal_subgroups function in
PermutationGroup_generic class.
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
NA
    
URL: sagemath#37038
Reported by: Ruchit Jagodara
Reviewer(s): Ruchit Jagodara, Travis Scrimshaw
@vbraun vbraun merged commit 55c9f9c into sagemath:develop Jan 22, 2024
12 of 15 checks passed
@RuchitJagodara RuchitJagodara changed the title Add minimal_normal_subgroups and maximal_normal_subgroups functions for permutation groups Add minimal_normal_subgroups and maximal_normal_subgroups functions Jan 22, 2024
@mkoeppe mkoeppe added this to the sage-10.3 milestone Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants