|
54 | 54 | from sage.modular.hecke.all import HeckeModule_free_module |
55 | 55 | from sage.rings.all import Integer, ZZ, QQ, CommutativeRing |
56 | 56 |
|
57 | | -from .abvar import sqrt_poly |
58 | | - |
59 | 57 | # TODO: we will probably also need homology that is *not* a Hecke module. |
60 | 58 |
|
| 59 | + |
61 | 60 | @richcmp_method |
62 | 61 | class Homology(HeckeModule_free_module): |
63 | 62 | """ |
@@ -371,7 +370,7 @@ def _repr_(self): |
371 | 370 | sage: J0(23).integral_homology()._repr_() |
372 | 371 | 'Integral Homology of Abelian variety J0(23) of dimension 2' |
373 | 372 | """ |
374 | | - return "Integral Homology of %s"%self.abelian_variety() |
| 373 | + return "Integral Homology of %s" % self.abelian_variety() |
375 | 374 |
|
376 | 375 | def hecke_matrix(self, n): |
377 | 376 | """ |
@@ -410,6 +409,7 @@ def hecke_polynomial(self, n, var='x'): |
410 | 409 | f = (M.hecke_polynomial(n, var)**2).change_ring(ZZ) |
411 | 410 | return f |
412 | 411 |
|
| 412 | + |
413 | 413 | class RationalHomology(Homology_abvar): |
414 | 414 | r""" |
415 | 415 | The rational homology `H_1(A,\QQ)` of a modular |
@@ -446,7 +446,7 @@ def _repr_(self): |
446 | 446 | sage: J0(23).rational_homology()._repr_() |
447 | 447 | 'Rational Homology of Abelian variety J0(23) of dimension 2' |
448 | 448 | """ |
449 | | - return "Rational Homology of %s"%self.abelian_variety() |
| 449 | + return "Rational Homology of %s" % self.abelian_variety() |
450 | 450 |
|
451 | 451 | def hecke_matrix(self, n): |
452 | 452 | """ |
@@ -486,19 +486,14 @@ def hecke_polynomial(self, n, var='x'): |
486 | 486 | (x + 2) * (x^2 - 2) |
487 | 487 | """ |
488 | 488 | 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 |
495 | 491 |
|
496 | 492 |
|
497 | 493 | class Homology_over_base(Homology_abvar): |
498 | 494 | r""" |
499 | 495 | 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`). |
502 | 497 | """ |
503 | 498 | def __init__(self, abvar, base_ring): |
504 | 499 | r""" |
@@ -537,7 +532,7 @@ def _repr_(self): |
537 | 532 | sage: H._repr_() |
538 | 533 | 'Homology with coefficients in Finite Field of size 5 of Abelian variety J0(23) of dimension 2' |
539 | 534 | """ |
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()) |
541 | 536 |
|
542 | 537 | def hecke_matrix(self, n): |
543 | 538 | """ |
@@ -590,10 +585,6 @@ def __init__(self, ambient, submodule): |
590 | 585 | if not isinstance(ambient, Homology_abvar): |
591 | 586 | raise TypeError("ambient must be the homology of a modular abelian variety") |
592 | 587 | 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: |
597 | 588 | submodule = ambient.free_module().submodule(submodule) |
598 | 589 | self.__submodule = submodule |
599 | 590 | HeckeModule_free_module.__init__( |
@@ -744,5 +735,3 @@ def rank(self): |
744 | 735 | [2, 4] |
745 | 736 | """ |
746 | 737 | return self.__submodule.rank() |
747 | | - |
748 | | - |
0 commit comments