Skip to content

Conversation

@ssiccha
Copy link
Collaborator

@ssiccha ssiccha commented Apr 9, 2021

A PR based on #176.

We are going to implement the extensions by Conder and Derek Holt's
GuessAltSymDegree.

@ssiccha
Copy link
Collaborator Author

ssiccha commented Apr 12, 2021

Rebased the last commit onto the current version of #176.

@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

❌ Patch coverage is 75.32468% with 95 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.48%. Comparing base (c309d8a) to head (16bace0).

Files with missing lines Patch % Lines
gap/generic/SnAnUnknownDegree.gi 75.13% 95 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #265      +/-   ##
==========================================
+ Coverage   69.12%   70.48%   +1.35%     
==========================================
  Files          43       43              
  Lines       18321    18637     +316     
==========================================
+ Hits        12665    13136     +471     
+ Misses       5656     5501     -155     
Files with missing lines Coverage Δ
gap/matrix.gi 92.97% <100.00%> (+0.01%) ⬆️
gap/perm.gi 79.76% <100.00%> (+0.07%) ⬆️
gap/projective.gi 83.17% <100.00%> (+0.08%) ⬆️
gap/generic/SnAnUnknownDegree.gi 85.07% <75.13%> (-5.02%) ⬇️

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ssiccha ssiccha force-pushed the frss/AnSnRecogUnknownDegree-2 branch from d40a988 to dc4a895 Compare April 12, 2021 12:32
@FriedrichRober FriedrichRober force-pushed the frss/AnSnRecogUnknownDegree-2 branch from dc4a895 to f162f36 Compare June 23, 2021 14:20
@ssiccha ssiccha force-pushed the frss/AnSnRecogUnknownDegree-2 branch from cca25fd to 35a39de Compare June 23, 2021 16:37
@FriedrichRober
Copy link
Contributor

Link to our Hackmd

@ssiccha ssiccha force-pushed the frss/AnSnRecogUnknownDegree-2 branch from 96f9a25 to 705504c Compare March 28, 2022 22:01
@FriedrichRober FriedrichRober force-pushed the frss/AnSnRecogUnknownDegree-2 branch 3 times, most recently from e63f4a8 to 956884d Compare March 29, 2022 22:51
@ssiccha
Copy link
Collaborator Author

ssiccha commented Mar 29, 2022

We should be almost done. We think there are two TODOs left: clean up the tests and figure out what to do with small classical groups like: Omega(-1,4,3). It has element orders <= 5, thus slips through our heuristics to weed out groups which are not isomorphic to An or Sn. Hence the SnAnUnknownDegree algorithm takes forever until it realizes, that the group in question is not an An or Sn. We think we should be able to alleviate this by simply saying that we're NeverApplicable if the vector space our group acts has less than e.g. 100 elements. And then we'll post a challenge on slack or the GAP forum whether somebody can find a small group, which makes the algorithm run slow.

And get the tests to pass again. :)

And in Make CallMethods directly write into the RecogNode update the docs of CallMethods.

And, @FriedrichRober is writing a short text, how all the parts fit together, that is how our implementation differs from a "vanilla" implementation of the JLNP algorithm according to the paper.

@ssiccha ssiccha force-pushed the frss/AnSnRecogUnknownDegree-2 branch 2 times, most recently from 3b12114 to daceec3 Compare March 29, 2022 23:52
@fingolfin
Copy link
Member

Awesome, thank you!

@fingolfin
Copy link
Member

@FriedrichRober do you think you can finish this on your own, now that @ssiccha is gone? Perhaps I can help a bit?

@FriedrichRober
Copy link
Contributor

Yes, I think I can finish this on my own. The code is finished (except for handling small classical groups). What is missing now is to finish the documentation (comments) and looking at the runtime of the test suite.

@FriedrichRober FriedrichRober force-pushed the frss/AnSnRecogUnknownDegree-2 branch 2 times, most recently from d45adbb to 7ba5ec6 Compare June 1, 2022 13:32
@FriedrichRober FriedrichRober force-pushed the frss/AnSnRecogUnknownDegree-2 branch 4 times, most recently from 85ca56f to deb2974 Compare November 7, 2022 03:36
@FriedrichRober
Copy link
Contributor

@fingolfin, ich habe nun die Änderungen implementiert, wie wir es besprochen haben. Wir geben früher auf, und speichern uns die Iteratoren im recog node ab, um sie später weiter zu verwenden. Trotzdem dauert die Test-Suite auf meinem Rechner 3-4 Minuten länger als auf dem master. Meiner Meinung nach ist dieser Zustand inakzeptabel, um das einfach so zu mergen :(

Ich muss dann nochmal genau schauen, an welchen Stellen wir zu viel Zeit verschwenden, und ob sich da was machen lässt.

Compute ThreeCycleCandidates in a "lazy" way,
as done in Magma Code GetNextThreeCycle.
@FriedrichRober FriedrichRober force-pushed the frss/AnSnRecogUnknownDegree-2 branch from 7925157 to af0aba4 Compare December 8, 2025 14:24
@FriedrichRober
Copy link
Contributor

Getting a lot of errors now of the sort:

# But found:
#I  Increasing tolerance to 0
#I  Increasing tolerance to 1
#I  Increasing tolerance to 2
#I  Increasing tolerance to 3
#I  Increasing tolerance to 4
#I  Increasing tolerance to 5
#I  Increasing tolerance to 6
#I  Increasing tolerance to 7
#I  Increasing tolerance to 8
#I  Increasing tolerance to 9
#I  Increasing tolerance to 10
#I  Giving up!
Error, the recognition described by this recognition node has failed!

Any help is appreciated! I guess we are missing some requirement for the recog tree because the method SnAnUnknownDegree seems to work correctly when testing it manually on the erroring groups. However, instead of

<recognition node SnAnUnknownDegree AlmostSimple Size=5040>

we often get in the (projective) matrix group case

<failed recognition node  AlmostSimple Size=5040 Dim=7 Field=3>

So this is probably a technical error of inserting our method into the database.

@FriedrichRober
Copy link
Contributor

Oh, I messed up the rebase. I will fix this, and this should solve the error

@FriedrichRober FriedrichRober force-pushed the frss/AnSnRecogUnknownDegree-2 branch from e6f5836 to 18b7a18 Compare December 8, 2025 15:41
@FriedrichRober
Copy link
Contributor

The quick test files seem to work as fast as on master on my machine. I am testing now the slow testsuite, since this is where we encoutered problems with Sergio

@FriedrichRober
Copy link
Contributor

The slow test suite takes on master almost 5 minutes and on this branch almost 7 minutes

@FriedrichRober
Copy link
Contributor

@fingolfin , I think I fixed the performance problem for most non-AnSn examples now. I changed the iterator for the threecyclecandidates to work in batches and give up very quickly. It remembers in its cache where it stopped, and continues from there if called again. However, the numbers for the batches I chose arbitrarily now. If the specific numbers are a good choice or not, I do not know. So the pull request is close to being finished now

@FriedrichRober
Copy link
Contributor

We can see which tests fail after everything has run. I think I remember that some small classical groups were recognised now as alternating or symmetric and therefore destroy the output of some tests.

@FriedrichRober
Copy link
Contributor

FriedrichRober commented Dec 9, 2025

Exactly, for example GL(4,2) is now recognized as A8, which is correct but not what the test file expects.

Edit: this seems to be the only error in the tests

- deactivate guessdegree code
- insert SnAnUnknownDegree after deletedpermutationmodule code in projective.gi
@FriedrichRober FriedrichRober marked this pull request as ready for review December 9, 2025 15:46
@FriedrichRober
Copy link
Contributor

@fingolfin, the pull request is ready now. The test suite on my laptop was as quick as on master, however some unrelated errors occures. Two where the stamp is not what was expected in the test file. One where the group was wrongly recognized which would require further investigation. I assume that this is a random error which simply occured from inserting the recognition method into the database.

@fingolfin
Copy link
Member

Fantastic, @FriedrichRober, thank you so much!

AUTHOR = {Conder, Jonathan},
TITLE = {Algorithms for Permutation Groups},
YEAR = {2012},
NOTE = {TODO},
Copy link
Member

Choose a reason for hiding this comment

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

Could this be filled in by someone? At which university was this thesis written; what kind of thesis was it?

Copy link
Member

Choose a reason for hiding this comment

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

I talked to @aniemeyer and learned that this was a thesis in Auckland, but I didn't find something initially. But now it seems this was indeed a B.Sc. thesis there, and it was written by @jonathan-conder . I have now pinged them, and will also write an email. Perhaps we get permissions to post the thesis somewhere, or perhaps Jonathan is willing to put it on e.g. the arXiv (I am not sure if they accept such things, but it seems to contain original research, and they definitely have at least phd theses?)

Copy link
Member

Choose a reason for hiding this comment

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

Jonathan replied to my email and generously gave permission to share copies of his thesis, and he also made it available at https://jonathan-conder.github.io/afpg.pdf -- this should keep working for the foreseeable future, and I also made sure archive.org has a snapshot. Still, we should probably see if we can also get this onto e.g. Zenodo or so.

Anyway, that gives us enough info to complete this bib record. I'll do so eventually (if nobody beats me to it).

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Thank you! I've pushed a bunch of changes (see commit log). I'll try to understand the errors better tomorrow

Comment on lines +1274 to +1284
# This is usually much smaller than RECOG.SnAnUpperBoundForDegree.
# The number to compare N with was chosen arbitrarily as a "large" degree.
# if N > 20 then
# degreeData := RECOG.GuessSnAnDegree(ri);
# if degreeData = fail then
# cache.N := TemporaryFailure;
# return;
# fi;
# N := Minimum(N, degreeData.degree);
# cache.N := N;
# fi;
Copy link
Member

Choose a reason for hiding this comment

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

Is this the only call to RECOG.GuessSnAnDegree?? If so... do we need it at all?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want to keep it just for the sake of Issue #348. But right now the code is not used by SnAnUnknownDegree, and we can surely move it somewhere else.

Comment on lines +314 to +315
# AddMethod(FindHomDbProjective, FindHomMethodsGeneric.SnAnSmallUnknownDegree, 1075);

Copy link
Member

Choose a reason for hiding this comment

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

This method does not seem to exist?

Suggested change
# AddMethod(FindHomDbProjective, FindHomMethodsGeneric.SnAnSmallUnknownDegree, 1075);

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, might be an artifact of some old code we wrote. You can safely delete this.

Comment on lines +133 to +134
yTo5 := y ^ 5;
if not isone(ri)(yTo5) and not isone(ri)(yTo5 * y) then
Copy link
Member

@fingolfin fingolfin Dec 11, 2025

Choose a reason for hiding this comment

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

Computing $y^5 = (y^2)^2\cdot y$ require three multiplications, and then $y^5\cdot y$ a fourth one. So either 3 or 4 multiplications

Wouldn't it then be even better to do something like this, which requires either 1, 2 or 3 multiplications ?

Suggested change
yTo5 := y ^ 5;
if not isone(ri)(yTo5) and not isone(ri)(yTo5 * y) then
y2 := y^2;
if not isone(ri)(y2) then
y3 := y2 * y;
if not isone(ri)(y3) and not isone(ri)(y2 * y3) then

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, your suggestion is definitely better

constants := RECOG.ThreeCycleCandidatesConstants(1. / 4., N);
for i in [1 .. T] do
iterator := RECOG.ThreeCycleCandidatesIterator(ri, constants);
# This is the main method used by RECOG.RecogniseSnAn and RECOG.RecogniseSnAnLazy.
Copy link
Member

Choose a reason for hiding this comment

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

As far as I can tell, RECOG.RecogniseSnAn is not used anymore. Can we just remove it then, and perhaps rename RECOG.RecogniseSnAnLazy to RECOG.RecogniseSnAn ?

Copy link
Contributor

Choose a reason for hiding this comment

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

So, in theory RECOG.RecogniseSnAn is the algorithm that you can run with an arbitrary epsilon and it guarantees you to recognise SnAn with this error bound, so it is running all iterations as often as computed in the respective paper. However, in practice it is too expensive to run this method for the recog tree, so we wrote the lazy variant that exits the iterations way sooner. Whether we want to keep it or not depends on whether or not it is interesting to have this version of the algorithm to play around with, which I honestly do not have a strong opinion on. We can definitely rename the functions to RECOG.RecogniseSnAnExact or something like this and then drop the lazy from the other :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep the code, but rename as Friedrich suggested.

@FriedrichRober
Copy link
Contributor

Thank you! I've pushed a bunch of changes (see commit log). I'll try to understand the errors better tomorrow

The rest of the changes look good to me

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.

4 participants