-
Notifications
You must be signed in to change notification settings - Fork 165
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
Fix finiteness condition in IsomorphismGroups
#3331
Conversation
This does improve things, thanks! Two small things:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the condition is still not correct.
Yes, please add a test! And I am surprised that this change made your two tests pass -- I don't see how, given that it only triggered if both inputs were infinite?! Maybe I am misunderstanding something? |
@fingolfin My change worked because later in the code there is the following check:
What I do not like about @fingolfin's suggestion is that one cannot easily read off in which cases the error is triggered exactly. That's why I'm in favor of @ChrisJefferson's second suggestion:
Do you agree or shall I implement @fingolfin's suggestion? |
Both pieces of code give the same answer in all cases... if IsFinite(G) <> IsFinite(H) then
return fail;
fi;
if not IsFinite(G) then
Error(...)
fi; if not IsFinite(G) and not IsFinite(H) then
Error("cannot test isomorphism of infinite groups");
fi;
if IsFinite(G) <> IsFinite(H) then
return fail;
fi; ...so I don't think it matters which one you choose. (If |
My current commit also gives the same answer in all cases because of the existing check |
The only reason to bail earlier is there could be cases where we know group G is infinite, group H is finite (for example, H could be a permutation group), but we don't actually know H's size, and calcaulating it is expensive. However, this is just an optimisation, and fixing the bug is obviously more important. |
Codecov Report
@@ Coverage Diff @@
## master #3331 +/- ##
==========================================
+ Coverage 85.25% 85.26% +<.01%
==========================================
Files 697 697
Lines 344151 344150 -1
==========================================
Hits 293423 293423
+ Misses 50728 50727 -1
|
I have pushed a test file and my suggestion from above. I hope that I did put the test file in the correct directory. |
I disagree with this solution, because before the |
Where "this solution" referred to "leave it to the Size check later on". But it seems you now did what I suggested anyway, so that should be fine. |
Could you please squash this into a single commit? |
If one group is finite and the other is infinite, the answer is always `fail`
4ed2f65
to
d2f34a1
Compare
Done! |
Currently, the arguments of
IsomorphismGroups
are not handled symmetrically:After this commit, in both cases
fail
is returned.