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

Commit 83d9371

Browse files
committed
not using sqrt_poly anymore
1 parent e4c12fe commit 83d9371

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

src/sage/modular/abvar/homology.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@
5454
from sage.modular.hecke.all import HeckeModule_free_module
5555
from sage.rings.all import Integer, ZZ, QQ, CommutativeRing
5656

57-
from .abvar import sqrt_poly
58-
5957
# TODO: we will probably also need homology that is *not* a Hecke module.
6058

59+
6160
@richcmp_method
6261
class Homology(HeckeModule_free_module):
6362
"""
@@ -371,7 +370,7 @@ def _repr_(self):
371370
sage: J0(23).integral_homology()._repr_()
372371
'Integral Homology of Abelian variety J0(23) of dimension 2'
373372
"""
374-
return "Integral Homology of %s"%self.abelian_variety()
373+
return "Integral Homology of %s" % self.abelian_variety()
375374

376375
def hecke_matrix(self, n):
377376
"""
@@ -410,6 +409,7 @@ def hecke_polynomial(self, n, var='x'):
410409
f = (M.hecke_polynomial(n, var)**2).change_ring(ZZ)
411410
return f
412411

412+
413413
class RationalHomology(Homology_abvar):
414414
r"""
415415
The rational homology `H_1(A,\QQ)` of a modular
@@ -446,7 +446,7 @@ def _repr_(self):
446446
sage: J0(23).rational_homology()._repr_()
447447
'Rational Homology of Abelian variety J0(23) of dimension 2'
448448
"""
449-
return "Rational Homology of %s"%self.abelian_variety()
449+
return "Rational Homology of %s" % self.abelian_variety()
450450

451451
def hecke_matrix(self, n):
452452
"""
@@ -486,19 +486,14 @@ def hecke_polynomial(self, n, var='x'):
486486
(x + 2) * (x^2 - 2)
487487
"""
488488
f = self.hecke_operator(n).matrix().characteristic_polynomial(var)
489-
return sqrt_poly(f)
490-
491-
#n = Integer(n)
492-
#M = self.abelian_variety().modular_symbols(sign=1)
493-
#f = M.hecke_polynomial(n, var)**2
494-
#return f
489+
_, poly = f.is_square(True)
490+
return poly
495491

496492

497493
class Homology_over_base(Homology_abvar):
498494
r"""
499495
The homology over a modular abelian variety over an arbitrary base
500-
commutative ring (not `\ZZ` or
501-
`\QQ`).
496+
commutative ring (not `\ZZ` or `\QQ`).
502497
"""
503498
def __init__(self, abvar, base_ring):
504499
r"""
@@ -537,7 +532,7 @@ def _repr_(self):
537532
sage: H._repr_()
538533
'Homology with coefficients in Finite Field of size 5 of Abelian variety J0(23) of dimension 2'
539534
"""
540-
return "Homology with coefficients in %s of %s"%(self.base_ring(), self.abelian_variety())
535+
return "Homology with coefficients in %s of %s" % (self.base_ring(), self.abelian_variety())
541536

542537
def hecke_matrix(self, n):
543538
"""
@@ -590,10 +585,6 @@ def __init__(self, ambient, submodule):
590585
if not isinstance(ambient, Homology_abvar):
591586
raise TypeError("ambient must be the homology of a modular abelian variety")
592587
self.__ambient = ambient
593-
#try:
594-
# if not submodule.is_submodule(ambient):
595-
# raise ValueError, "submodule must be a submodule of the ambient homology group"
596-
#except AttributeError:
597588
submodule = ambient.free_module().submodule(submodule)
598589
self.__submodule = submodule
599590
HeckeModule_free_module.__init__(
@@ -744,5 +735,3 @@ def rank(self):
744735
[2, 4]
745736
"""
746737
return self.__submodule.rank()
747-
748-

0 commit comments

Comments
 (0)