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 LowIndexNormalSubs operation #59

Merged
merged 6 commits into from
Dec 20, 2023
Merged

Add LowIndexNormalSubs operation #59

merged 6 commits into from
Dec 20, 2023

Conversation

FriedrichRober
Copy link
Collaborator

@FriedrichRober FriedrichRober commented Dec 13, 2023

Closes #57

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Merging #59 (c9de9a4) into master (8617b89) will increase coverage by 0.54%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
+ Coverage   93.92%   94.46%   +0.54%     
==========================================
  Files          12       12              
  Lines        1596     1608      +12     
==========================================
+ Hits         1499     1519      +20     
+ Misses         97       89       -8     
Files Coverage Δ
gap/LINS.gd 100.00% <100.00%> (ø)
gap/LINS.gi 87.13% <100.00%> (+4.09%) ⬆️

@FriedrichRober
Copy link
Collaborator Author

@fingolfin, we have one problem: LowIndexNormalSubgroups in polycylic computes the normal subgroups of index n, while LowIndexNormalSubgroups in LINS computes all normal subgroups of index at most n, similar to LowIndexSubgroups

@FriedrichRober
Copy link
Collaborator Author

We probably want to have two operations, one for computing all normal subgroups with index at mostn and the other one for all normal subgroups of index equal to n. I struggle with finding two suitable names, maybe we could add the suffix OfIndex to indicate that the subgroups of index equal to n are returned.

The package polycyclic has the operations/functions LowIndexNormalSubgroups, LowIndexSubgroupClasses and MaximalSubgroupClassesByIndex that compute the subgroups of index equal to n.

Gap lib has the operations/functions LowIndexSubgroups, LowIndexSubgroupsFpGroup that compute subgroups with index at most n.

In my opinion, the behaviour of all LowIndex operations should match with one another, and we probably should stick with the convention from LowIndexSubgroups from gap lib. So for example both LowIndexSubgroups and LowIndexNormalSubgroups should return a list of (class representatives of) all (normal) subgroups with index at most n.

@fingolfin
Copy link
Member

fingolfin commented Dec 14, 2023

I generally agree that consistent behavior would be better, but that ship has sailed for now.

Perhaps over time we can carefully re-engineer the code in the GAP library and in polycyclic to offer an optional argument which allows choosing different behaviors -- e.g. choose whether to all subgroups of index $&lt; n$ or $=n$ or dividing $n$. But that will require more work and coordination...

BTW I had a look at the polycyclic source code, and it actually computes all normal subgroups of any index dividing $n$, but then it discards any of index $&lt; n$. So it wouldn't be too hard to change it to return more normal subgroups; or to make it accept an option to choose a behavior. But I am reluctant to change the current default because it might break existing code.

So perhaps we should just use a different name for now and implement our ideal version there.

I don't have a great suggestion, though... Perhaps LowIndexNormalSubgroupsIterator and then we return an iterator object?

@fingolfin
Copy link
Member

We agreed to use GAP options to allow the user to customize the behavior

@FriedrichRober
Copy link
Collaborator Author

Since polycyclic uses a KeyDependentOperation, two consecutive calls of LowIndexNormalSubgroups with different options might return the wrong result and cause the user too much trouble and confusion. For this reason, we decided to rename the operation in this package to LowIndexNormalSubs and add a remark in the documentation.

@FriedrichRober FriedrichRober marked this pull request as ready for review December 14, 2023 15:32
@FriedrichRober FriedrichRober changed the title Add LowIndexNormalSubgroups operation Add LowIndexNormalSubs operation Dec 14, 2023
@FriedrichRober FriedrichRober force-pushed the fr/LinsOp branch 6 times, most recently from 6aad6fe to d5df4a5 Compare December 14, 2023 16:19
- Rename `LowIndexNormalSubgroups` -> `LowIndexNormalSubs`
- Add option `allSubgroups` to `LowIndexNormalSubs`
- Add documentation for `LowIndexNormalSubs`
- Move previous examples to advanced section
- Add simplfied examples in introduction using the new high-level function
dev/tests_doc/processTests.sh Outdated Show resolved Hide resolved
doc/intro.xml Outdated Show resolved Hide resolved
doc/intro.xml Outdated Show resolved Hide resolved
doc/intro.xml Outdated Show resolved Hide resolved
doc/intro.xml Outdated Show resolved Hide resolved
doc/intro.xml Outdated Show resolved Hide resolved
doc/lins_interface.xml Outdated Show resolved Hide resolved

gap> G := DihedralGroup(IsPermGroup, 20);
Group([ (1,2,3,4,5,6,7,8,9,10), (2,10)(3,9)(4,8)(5,7) ])
gap> L := LowIndexNormalSubs(G, 10);
Copy link
Member

Choose a reason for hiding this comment

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

This kind of test is fragile and prone to break when GAP improvements lead to different generating sets. I would recommend to hide the outputs in these cases and instead test for suitable properties (which you already do by calling Index)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, usually I do this, I just thought that for such a small example it might actually be useful to also check the representations of the subgroups. I can remove these parts.

@fingolfin fingolfin merged commit cba84e8 into master Dec 20, 2023
4 checks passed
@fingolfin fingolfin deleted the fr/LinsOp branch December 20, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add LowIndexNormalSubgroups method.
2 participants