better IsAlmostSimple support in AllPrimitiveGroups - #79
Conversation
Up to now, the groups had to be constructed and were checked. Now we use that `IsAlmostSimple` is determined by `ONanScottType`. The `IsAlmostSimpleGroup` flag is now set in the groups returned by `PrimitiveGroup`. (The primgrp package does not say which functions have special support, but `is_almost_simple` is listed in the Oscar documentation.)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #79 +/- ##
==========================================
+ Coverage 99.11% 99.13% +0.02%
==========================================
Files 46 46
Lines 38324 38327 +3
==========================================
+ Hits 37984 37995 +11
+ Misses 340 332 -8
🚀 New features to boost your workflow:
|
(These are only tests for my additions, most features of `AllPrimitiveGroups` do not have tests.)
|
Thanks @ThomasBreuer! I let Claude have a closer look, and it pointed out three issues:
Wrong answer, no error. elif a=IsAlmostSimpleGroup or a=IsAlmostSimple then
# for primitive groups, almost simple means O'Nan-Scott type 2
bfunc:= b;
b:= val -> STGSelFunc(val = "2", bfunc);
gut[i]:=Filtered(gut[i],j->STGSelFunc(PRIMGrp(i,j)[4],b)); |
|
Just for the record: |
| elif a=IsAlmostSimpleGroup or a=IsAlmostSimple then | ||
| # for primitive groups, almost simple means O'Nan-Scott type 2 | ||
| if IsFunction(b) then | ||
| # does not really make sense but is allowed | ||
| gut[i]:=Filtered(gut[i],j->b(PRIMGrp(i,j)[4]="2")); | ||
| else | ||
| if IsBool(b) then | ||
| b:= [b]; | ||
| fi; | ||
| if IsList(b) then | ||
| if true in b and false in b then | ||
| # nothing is to do | ||
| elif true in b then | ||
| gut[i]:=Filtered(gut[i],j->PRIMGrp(i,j)[4]="2"); | ||
| elif false in b then | ||
| gut[i]:=Filtered(gut[i],j->PRIMGrp(i,j)[4]<>"2"); | ||
| else | ||
| gut[i]:=[]; | ||
| fi; | ||
| else | ||
| gut[i]:=[]; | ||
| fi; | ||
| fi; |
There was a problem hiding this comment.
You wrote "for the record" that you don't agree with Claude's suggestion for 3. It was indeed needlessly complicated, this version already does it, and is very similar to the code right above and below this case:
| elif a=IsAlmostSimpleGroup or a=IsAlmostSimple then | |
| # for primitive groups, almost simple means O'Nan-Scott type 2 | |
| if IsFunction(b) then | |
| # does not really make sense but is allowed | |
| gut[i]:=Filtered(gut[i],j->b(PRIMGrp(i,j)[4]="2")); | |
| else | |
| if IsBool(b) then | |
| b:= [b]; | |
| fi; | |
| if IsList(b) then | |
| if true in b and false in b then | |
| # nothing is to do | |
| elif true in b then | |
| gut[i]:=Filtered(gut[i],j->PRIMGrp(i,j)[4]="2"); | |
| elif false in b then | |
| gut[i]:=Filtered(gut[i],j->PRIMGrp(i,j)[4]<>"2"); | |
| else | |
| gut[i]:=[]; | |
| fi; | |
| else | |
| gut[i]:=[]; | |
| fi; | |
| fi; | |
| elif a=IsAlmostSimpleGroup or a=IsAlmostSimple then | |
| # for primitive groups, almost simple means O'Nan-Scott type 2 | |
| gut[i]:=Filtered(gut[i],j->STGSelFunc(PRIMGrp(i,j)[4]="2",b)); |
So, also for the record: what are your concerns with that, if there are any?
My main reason for preferring the version with STGSelFunc is that by having these checks similar, it is much easier for me to trust that they behave consistently. So the code becomes easier to maintain.
But I am happy to be convinced otherwise, I just haven't heard the arguments yet :-)
Up to now, the groups had to be constructed and were checked. Now we use that
IsAlmostSimpleis determined byONanScottType.The
IsAlmostSimpleGroupflag is now set in the groups returned byPrimitiveGroup.(The primgrp package does not say which functions have special support in
AllPrimitiveGroups, butis_almost_simpleis listed in the Oscar documentation.)