Skip to content
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

Hide GAP finiteness warnings during isomorphism check #38956

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/sage/groups/cubic_braid.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ class CubicBraidGroup(UniqueRepresentation, FinitelyPresentedGroup):
sage: C3.gens()
(t0, t1)
sage: U3.is_isomorphic(C3)
#I Forcing finiteness test
True
sage: U3.as_classical_group()
Subgroup generated by [(1,7,6)(3,19,14)(4,15,10)(5,11,18)(12,16,20),
Expand Down Expand Up @@ -1604,7 +1603,6 @@ def as_permutation_group(self, use_classical=True):
sage: C3 = CubicBraidGroup(3)
sage: PC3 = C3.as_permutation_group()
sage: assert C3.is_isomorphic(PC3) # random (with respect to the occurrence of the info message)
#I Forcing finiteness test
sage: PC3.degree()
8
sage: c = C3([2,1-2])
Expand Down
4 changes: 0 additions & 4 deletions src/sage/groups/finitely_presented.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,6 @@ def direct_product(self, H, reduced=False, new_names=True):
sage: C7 = G / [G.0**7]; C6 = G / [G.0**6]
sage: C14 = G / [G.0**14]; C3 = G / [G.0**3]
sage: C7.direct_product(C6).is_isomorphic(C14.direct_product(C3))
#I Forcing finiteness test
True
sage: F = FreeGroup(2); D = F / [F([1,1,1,1,1]),F([2,2]),F([1,2])**2]
sage: D.direct_product(D).as_permutation_group().is_isomorphic(
Expand Down Expand Up @@ -1174,7 +1173,6 @@ def semidirect_product(self, H, hom, check=True, reduced=False):
sage: alpha = (Q.gens(), [a,b])
sage: S2 = C2.semidirect_product(Q, ([C2.0],[alpha]))
sage: S1.is_isomorphic(S2)
#I Forcing finiteness test
True

Dihedral groups can be constructed as semidirect products
Expand Down Expand Up @@ -1233,8 +1231,6 @@ def semidirect_product(self, H, hom, check=True, reduced=False):
sage: Se2 = D.semidirect_product(C ,id2)
sage: Dp1 = C.direct_product(D)
sage: Dp1.is_isomorphic(Se1), Dp1.is_isomorphic(Se2)
#I Forcing finiteness test
#I Forcing finiteness test
(True, True)

Most checks for validity of input are left to GAP to handle::
Expand Down
7 changes: 0 additions & 7 deletions src/sage/groups/finitely_presented_named.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@
sage: Q.order(), Q.is_abelian()
(8, False)
sage: Q.is_isomorphic(groups.presentation.DiCyclic(2))
#I Forcing finiteness test
True
"""
F = FreeGroup(['a','b'])
Expand Down Expand Up @@ -490,7 +489,7 @@
(True, 1)
sage: A3 = groups.presentation.Alternating(3); A3.order(), A3.as_permutation_group().is_cyclic()
(3, True)
sage: A8 = groups.presentation.Alternating(8); A8.order()

Check warning on line 492 in src/sage/groups/finitely_presented_named.py

View workflow job for this annotation

GitHub Actions / test-new

Warning: slow doctest:

slow doctest:

Check warning on line 492 in src/sage/groups/finitely_presented_named.py

View workflow job for this annotation

GitHub Actions / test-long (src/sage/[g-o]*)

Warning: slow doctest:

slow doctest:
20160
"""
from sage.groups.perm_gps.permgroup_named import AlternatingGroup
Expand Down Expand Up @@ -554,12 +553,6 @@
....: P = groups.presentation.BinaryDihedral(n)
....: M = groups.matrix.BinaryDihedral(n)
....: assert P.is_isomorphic(M)
#I Forcing finiteness test
#I Forcing finiteness test
#I Forcing finiteness test
#I Forcing finiteness test
#I Forcing finiteness test
#I Forcing finiteness test
"""
F = FreeGroup('x,y,z')
x,y,z = F.gens()
Expand Down
14 changes: 13 additions & 1 deletion src/sage/groups/libgap_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,4 +946,16 @@ def is_isomorphic(self, H):
sage: F == G, G == H, F == H
(False, False, False)
"""
return self.gap().IsomorphismGroups(H.gap()) != libgap.fail
# If GAP doesn't know that the groups are finite, it will
# check. This emits an informational warning, and then
# annotates the groups as being finite (assuming they were) so
# that future isomorphism checks are silent. This can lead to
# apparent non-determinism in the output as statements are
# rearranged. There's nothing the user can do about this
# anyway, and it happens in trivial cases like the alternating
# group on one element, so we prefer to hide the warning.
old_warnlevel = libgap.InfoLevel(libgap.InfoWarning)
libgap.SetInfoLevel(libgap.InfoWarning, 0)
result = self.gap().IsomorphismGroups(H.gap()) != libgap.fail
libgap.SetInfoLevel(libgap.InfoWarning, old_warnlevel)
return result
1 change: 0 additions & 1 deletion src/sage/schemes/curves/projective_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@
sage: set_verbose(-1)
sage: P.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: C = Curve([(x^2 + y^2 - y*z - 2*z^2)*(y*z - x^2 + 2*z^2)*z + y^5], P)
sage: C.ordinary_model() # long time (5 seconds)

Check warning on line 1403 in src/sage/schemes/curves/projective_curve.py

View workflow job for this annotation

GitHub Actions / test-new

Warning: slow doctest:

slow doctest:
Scheme morphism:
From: Projective Plane Curve over Number Field in a
with defining polynomial y^2 - 2 defined
Expand Down Expand Up @@ -1805,7 +1805,6 @@
....: + (x-18*z)*(z^2+11*x*z-x^2)^2)
sage: G0 = C.fundamental_group() # needs sirocco
sage: G.is_isomorphic(G0) # needs sirocco
#I Forcing finiteness test
True
sage: C = P.curve(z)
sage: C.fundamental_group() # needs sirocco
Expand Down
Loading