-
Notifications
You must be signed in to change notification settings - Fork 161
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
Disable NaturalHomomorphism
for FactorGroup
, as it has side effects (code using this should be rewritten to use NaturalHomomorphismByNormalSubgroup
instead)
#4697
Conversation
FactorGroup
as it has side effects.NaturalHomomorphism
for FactorGroup
, as it has side effects.
lib/grp.gi
Outdated
@@ -2685,6 +2685,9 @@ end ); | |||
InstallMethod( NaturalHomomorphism, "for a group with natural homomorphism stored", | |||
[ IsGroup ], | |||
function(G) | |||
Error("The use of `NaturalHomomorphism` for a `FactorGroup`\n", | |||
"has been removed, as it caused side-effects."); |
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.
But won't that break existing user code that relies on this?
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.
Yes, should code rely onthis functionality. We could change it to add text "enter return;
to continue, or change the error to a warning message.
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.
Also we should perhaps quickly check if any distributed packages rely on this?
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.
I have checked through the packages in 4.11. Only XMod, laguna, primgrp, rds, wedderga and xgap call FactorGroup(
. None of them uses NaturalHomomorphism(
. I will change the error to a warning.
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.
XMod does use NaturalHomomorphism
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.
@cdwensley Where does it use NaturalHomomorphism
? I found it only uses NaturalHomomorphismByNormalSubgroup
(which is safe and well) in version 2.82.
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.
I'm happy to change it if that is the sensible thing to do.
Christopher-Wensleys-iMac:lib christopherwensley$ grep -n NaturalHomomorphism *
catone.gi:575: nat:=NaturalHomomorphismByNormalSubgroup(G,N);
gp2map.gi:1764: nat1 := NaturalHomomorphism( KR1 );
gp2map.gi:1795: nat2 := NaturalHomomorphism( KQ );
gp2map.gi:1862: nat1 := NaturalHomomorphism( KR1 );
gp2map.gi:1891: natKQ := NaturalHomomorphism( KQ );
gp2map.gi:1897: natKR1 := NaturalHomomorphism( KR1 );
gp2map.gi:1902: natKQ := NaturalHomomorphism( KQ );
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.
Yes, this does appear to be a recent change.
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.
Since this is a recent change (and thus possibly not even in a distributed version) I would urge to replace code of the form
F:=FactorGroup(G,N);
hom:=NaturalHomomorphism(F);
by
hom:=NaturalHomomorphismByNormalSubgroup(G,N);
F:=Image(hom,G);
The cost will be the same, but it does not rely on the side-effect of aching the homomorphism in the object.
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.
It all happened when quasi-isomorphisms were introduced: PR #107 (17/2/21).
I'll try using NaturalHomomorphismByNormalSubgroup instead.
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.
Thank you
I recall now that this advice was given and followed some years ago.
As the operation was still available, it was used again this year.
The 5 occurrences of NaturalHomomorphism in XMod have now been replaced.
Since this is a recent change (and thus possibly not even in a
distributed version) I would urge to replace code of the form
F:=FactorGroup(G,N); hom:=NaturalHomomorphism(F);
by
hom:=NaturalHomomorphismByNormalSubgroup(G,N);
F:=Image(hom,G);
The cost will be the same, but it does not rely on the side-effect of
aching the homomorphism in the object.
|
(Moved the method into obsolete) Subsequent demotion of `FactorGroup` and related library/manual changes This resolves gap-system#4656
Criterion should only exclude small solvable group (which have something better). This resolves gap-system#4698
does not try primitivity for short orbits -- not worth doing and tedious
Unfortunately something in here broke the test suite, specifically
|
Yes. This is a side-effect of a small improvement to `SmallGeneratingSet' which I had added since the PR was hanging anyhow (did not realize you would then override the merge). |
NaturalHomomorphism
for FactorGroup
, as it has side effects.NaturalHomomorphism
for FactorGroup
, as it has side effects (code using this should be rewritten to use NaturalHomomorphismByNormalSubgroup
instead)
(Moved into obsoletes).
This resolves #4656
Also included the (trivial) fix for #4698
Text for release notes
The use of
FactorGroup
succeeded byNaturalHomomorphism
has been made obsolete, as the implementation relied on side-effects.