Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit e4c12fe

Browse files
committed
one more fix in abvar
1 parent 13992d3 commit e4c12fe

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/sage/modular/abvar/abvar.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4221,10 +4221,10 @@ def _compute_hecke_polynomial(self, n, var='x'):
42214221
42224222
.. note::
42234223
4224-
If self has dimension d, then this is a polynomial of
4225-
degree d. It is not of degree 2\*d, so it is the square
4226-
root of the characteristic polynomial of the Hecke operator
4227-
on integral or rational homology (which has degree 2\*d).
4224+
If self has dimension d, then this is a polynomial of
4225+
degree d. It is not of degree 2\*d, so it is the square
4226+
root of the characteristic polynomial of the Hecke operator
4227+
on integral or rational homology (which has degree 2\*d).
42284228
42294229
EXAMPLES::
42304230
@@ -4243,7 +4243,8 @@ def _compute_hecke_polynomial(self, n, var='x'):
42434243
sage: factor(J0(43).hecke_operator(2).charpoly())
42444244
(x + 2) * (x^2 - 2)
42454245
"""
4246-
return sqrt_poly(self.modular_symbols().hecke_polynomial(n, var))
4246+
b, r = self.modular_symbols().hecke_polynomial(n, var).is_square(True)
4247+
return r
42474248

42484249
def _integral_hecke_matrix(self, n, sign=0):
42494250
"""
@@ -4956,9 +4957,9 @@ def sqrt_poly(f):
49564957
49574958
.. note::
49584959
4959-
At some point something like this should be a member of the
4960-
polynomial class. For now this is just used internally by some
4961-
charpoly functions above.
4960+
At some point something like this should be a member of the
4961+
polynomial class. For now this is just used internally by some
4962+
charpoly functions above.
49624963
49634964
EXAMPLES::
49644965
@@ -4980,12 +4981,12 @@ def sqrt_poly(f):
49804981
if not f.is_monic():
49814982
raise ValueError("f must be monic")
49824983
try:
4983-
return prod([g**(e // Integer(2)) for g, e in f.factor()])
4984+
return prod([g**Integer(e / Integer(2)) for g, e in f.factor()])
49844985
except TypeError:
49854986
raise ValueError("f must be a perfect square")
49864987

49874988

4988-
####################################################################################################
4989+
##############################################################################
49894990
# Useful for decomposing exactly the sort of modular symbols spaces that come up here.
49904991

49914992

0 commit comments

Comments
 (0)