Skip to content

Recog An/Sn unknown degree: conder, holt#265

Open
ssiccha wants to merge 47 commits into
gap-packages:masterfrom
ssiccha:frss/AnSnRecogUnknownDegree-2
Open

Recog An/Sn unknown degree: conder, holt#265
ssiccha wants to merge 47 commits into
gap-packages:masterfrom
ssiccha:frss/AnSnRecogUnknownDegree-2

Conversation

@ssiccha
Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

ssiccha commented Apr 12, 2021

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

@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Awesome, thank you!

@fingolfin
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread gap/generic/SnAnUnknownDegree.gi Outdated
Comment thread gap/generic/SnAnUnknownDegree.gi Outdated
@TWiedemann
Copy link
Copy Markdown
Collaborator

I am finished with my review. Everything looks good, so I think we can merge as seen as all comments above are resolved.

I think this PR will resolve #348, but correct me if I am wrong.

@TWiedemann TWiedemann linked an issue Mar 24, 2026 that may be closed by this pull request
Comment thread gap/generic/SnAnUnknownDegree.gi
Comment thread gap/generic/SnAnUnknownDegree.gi Outdated
Comment thread gap/generic/SnAnUnknownDegree.gi Outdated
# - slpToStdGens: an SLP from the generators of G to stdGens.
RECOG.ConstructSnAnIsomorphism := function(ri, n, stdGensAnWithMemory)
local stdGensAn, xis, gImage, foundOddPermutation, slp, eval,
local stdGensAn, filter, filterPart, gImage, foundOddPermutation, slp, eval,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this called filter? It is neither a filter in GAP's sense, nor in the mathematical sense (think "ultrafilter") nor do any of the sources use this term. I find it rather confusing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I remember correctly, we used the word "filter" because the xis act like a sieve or filtering mechanism on the search space for finding the image points. But any renaming would be fine here :)

Comment on lines +960 to +961
# Construct filter. In <Cite Key="C12"/> filter is called E.
# In <Cite Key="JLNP13"/> filter is called `xi`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be better if we had more concrete refs (so to specific definitions/lemmas); as it is we could not quite tell which "xi" or "Xi" or "X_i" or "x_i" are meant exactly.

I also note that RECOG.ConstructXiAn comes from the older code written for the paper by Beals et all (BLN+03 here?), so perhaps that is also a reference?

(Of course the fact that RECOG.ConstructXiAn in turn is undocumented doesn't help either...)

Copy link
Copy Markdown
Contributor

@FriedrichRober FriedrichRober May 12, 2026

Choose a reason for hiding this comment

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

Yes, this is indeed from BLN+03. It is introduced in prose, so has no reference, and then is used for the first time in Lemma 5.3. If n>=11, then this filter can be used to find the image under the homomorphism. For degree <11, we had to use Conder's algorithm for the image computation, which works for degree>=5.

Comment thread gap/generic/SnAnUnknownDegree.gi Outdated
Comment thread gap/generic/SnAnUnknownDegree.gi Outdated
Comment thread gap/generic/SnAnUnknownDegree.gi Outdated
fingolfin and others added 4 commits May 12, 2026 11:17
Co-authored-by: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com>
Co-authored-by: Max Horn <max@quendi.de>
## ----------------
##
## Here we describe the general strategy that is used to recognise if a group
## is ismorphic to `An` or `Sn` for `n >= 7`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But below when defining SnAnUnknownDegree (around line 1355ff), it is stated that this method is for $n\geq 9$. Some parts of the code suggest that certain operations require $n\geq 9$ and others $n\geq 7$, which might explain the difference (and of course it would mean overall we indeed need $n\geq 9$).

And then there is the code in RECOG.SnAnUpperBoundForDegree which kinda seems to suggest we might have to assume $n\geq 10$, at least for non-projective matrix groups?!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let me check this quickly so you don’t end up on a wild goose chase.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can recognise groups with degree n>=7, and that groups with degree 5 or 6 cannot be recognised.

Details:

  • Lower Bounds need n >= 9:
    This is just to satisfy the error-probabilities, and has no impact on the correctness of the algorithm.
  • Bolstering Elements are only defined for n >= 7:
    This is the crucial point, which I think would lead to the algorithm returning fail for smaller degrees.
  • In SnAnUpperBoundForDegree:
    • For the projective groups, the relevant bounds are only defined for n≥9. To handle all cases, we set N:=max(8,d+2). When the actual degree is at least 9, we use the corresponding bound; otherwise, we assume the worst case, namely degree at most 8. Hence, the argument remains valid for all degrees.
    • Same holds for non-projective matrix groups with n>=10.

##
## We have to be careful what we do for small degrees.
## If we pass an `A5`, `S5`, `A6`, `S6` into `SnAnUnknownDegree`, then it will not recognize it.
## If the input acts on a space with a large dimension, then this can take forever.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is that last bit still the case? If so, a concrete example would be good so we can better guard against it (i.e., an example could be used in a test that verifies that whatever "guards" we use are effective)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it will not anymore run forever, since I adjusted the code to return fail more quickly. But I agree that a test case would be nice to confirm this, see my comment about bolstering elements only being defined for n>=7.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Anyway, I also think that the SnAnUnknownDegree code assumes that the input is irreducible (because it runs after FindHomMethodsProjective.NotAbsolutelyIrred in the recog framework, etc.), so these examples that Sergio and I thought of as problematic should not be passed as input to SnAnUnknownDegree at this stage.

## If we pass an `A5`, `S5`, `A6`, `S6` into `SnAnUnknownDegree`, then it will not recognize it.
## If the input acts on a space with a large dimension, then this can take forever.
##
## - We assume that our input group `G` is a projective irreducible matrix group.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, OK. That might partially address my concern from above about RECOG.SnAnUpperBoundForDegree requiring $n\geq 10$ in the non-projective case.

Comment thread gap/generic/SnAnUnknownDegree.gi Outdated
Comment on lines -270 to -291
# FindHomMethodsGeneric.SnAnUnknownDegree
# Sn
gap> for d in [11 .. 30] do
> sets := Combinations([1 .. d], 2);;
> SdOn2Sets := Action(SymmetricGroup(d), sets, OnSets);;
> ri := RecogNode(SdOn2Sets);;
> success := FindHomMethodsGeneric.SnAnUnknownDegree(ri);
> if not success or not Size(ri) = Factorial(d) then
> Print("wrong result! degree ", d, "\n");
> fi;
> od;

# An
gap> for d in [11 .. 30] do
> sets := Combinations([1 .. d], 2);;
> SdOn2Sets := Action(AlternatingGroup(d), sets, OnSets);;
> ri := RecogNode(SdOn2Sets);;
> success := FindHomMethodsGeneric.SnAnUnknownDegree(ri);
> if not success or not Size(ri) = Factorial(d)/2 then
> Print("wrong result! degree ", d, "\n");
> fi;
> od;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Removing this will result in quite a loss of coverage. Why do we do it?

SoongNoonien and others added 4 commits May 19, 2026 10:32
Co-authored-by: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com>
Co-authored-by: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com>
Co-authored-by: Martin Wagner <martin.wagner.dev@gmail.com>
Comment thread gap/generic/SnAnUnknownDegree.gi Outdated
Comment thread gap/generic/SnAnUnknownDegree.gi
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.

SnAn naming algorithm

6 participants