26
26
#
27
27
# https://www.gnu.org/licenses/
28
28
# ****************************************************************************
29
+ from typing import Iterator
29
30
30
- import sage .rings .infinity
31
+ from sage .rings .infinity import infinity
32
+ from sage .categories .algebras import Algebras
31
33
from sage .matrix .constructor import matrix
32
34
from sage .arith .functions import lcm
33
35
from sage .arith .misc import gcd
34
36
from sage .misc .latex import latex
35
37
from sage .matrix .matrix_space import MatrixSpace
36
- from sage .rings .ring import CommutativeAlgebra
38
+ from sage .rings .ring import CommutativeRing
37
39
from sage .rings .integer_ring import ZZ
38
40
from sage .rings .rational_field import QQ
39
41
from sage .structure .element import Element
42
44
from sage .structure .richcmp import richcmp_method , richcmp
43
45
44
46
45
- def is_HeckeAlgebra (x ):
47
+ def is_HeckeAlgebra (x ) -> bool :
46
48
r"""
47
49
Return ``True`` if x is of type HeckeAlgebra.
48
50
@@ -105,7 +107,7 @@ def _heckebasis(M):
105
107
106
108
107
109
@richcmp_method
108
- class HeckeAlgebra_base (CachedRepresentation , CommutativeAlgebra ):
110
+ class HeckeAlgebra_base (CachedRepresentation , CommutativeRing ):
109
111
"""
110
112
Base class for algebras of Hecke operators on a fixed Hecke module.
111
113
@@ -163,7 +165,7 @@ def __classcall__(cls, M):
163
165
pass
164
166
return super ().__classcall__ (cls , M )
165
167
166
- def __init__ (self , M ):
168
+ def __init__ (self , M ) -> None :
167
169
"""
168
170
Initialization.
169
171
@@ -179,7 +181,9 @@ def __init__(self, M):
179
181
if not module .is_HeckeModule (M ):
180
182
raise TypeError ("M (=%s) must be a HeckeModule" % M )
181
183
self .__M = M
182
- CommutativeAlgebra .__init__ (self , M .base_ring ())
184
+ cat = Algebras (M .base_ring ()).Commutative ()
185
+ CommutativeRing .__init__ (self , base_ring = M .base_ring (),
186
+ category = cat )
183
187
184
188
def _an_element_ (self ):
185
189
r"""
@@ -319,12 +323,13 @@ def ngens(self):
319
323
sage: CuspForms(1, 12).anemic_hecke_algebra().ngens()
320
324
+Infinity
321
325
"""
322
- return sage . rings . infinity . infinity
326
+ return infinity
323
327
324
- def is_noetherian (self ):
328
+ def is_noetherian (self ) -> bool :
325
329
"""
326
- Return ``True`` if this Hecke algebra is Noetherian as a ring. This is true
327
- if and only if the base ring is Noetherian.
330
+ Return ``True`` if this Hecke algebra is Noetherian as a ring.
331
+
332
+ This is true if and only if the base ring is Noetherian.
328
333
329
334
EXAMPLES::
330
335
@@ -343,9 +348,9 @@ def matrix_space(self):
343
348
sage: CuspForms(3, 24, base_ring=Qp(5)).anemic_hecke_algebra().matrix_space()
344
349
Full MatrixSpace of 7 by 7 dense matrices over 5-adic Field with capped relative precision 20
345
350
"""
346
- return sage . matrix . matrix_space . MatrixSpace (self .base_ring (), self .module ().rank ())
351
+ return MatrixSpace (self .base_ring (), self .module ().rank ())
347
352
348
- def _latex_ (self ):
353
+ def _latex_ (self ) -> str :
349
354
r"""
350
355
LaTeX representation of self.
351
356
@@ -569,7 +574,7 @@ class HeckeAlgebra_full(HeckeAlgebra_base):
569
574
A full Hecke algebra (including the operators `T_n` where `n` is not
570
575
assumed to be coprime to the level).
571
576
"""
572
- def _repr_ (self ):
577
+ def _repr_ (self ) -> str :
573
578
r"""
574
579
String representation of self.
575
580
@@ -580,7 +585,7 @@ def _repr_(self):
580
585
"""
581
586
return "Full Hecke algebra acting on %s" % self .module ()
582
587
583
- def __richcmp__ (self , other , op ):
588
+ def __richcmp__ (self , other , op ) -> bool :
584
589
r"""
585
590
Compare self to other.
586
591
@@ -631,15 +636,15 @@ class HeckeAlgebra_anemic(HeckeAlgebra_base):
631
636
r"""
632
637
An anemic Hecke algebra, generated by Hecke operators with index coprime to the level.
633
638
"""
634
- def _repr_ (self ):
639
+ def _repr_ (self ) -> str :
635
640
r"""
636
641
EXAMPLES::
637
642
638
643
sage: H = CuspForms(3, 12).anemic_hecke_algebra()._repr_()
639
644
"""
640
645
return "Anemic Hecke algebra acting on %s" % self .module ()
641
646
642
- def __richcmp__ (self , other , op ):
647
+ def __richcmp__ (self , other , op ) -> bool :
643
648
r"""
644
649
Compare self to other.
645
650
@@ -689,7 +694,7 @@ def is_anemic(self) -> bool:
689
694
"""
690
695
return True
691
696
692
- def gens (self ):
697
+ def gens (self ) -> Iterator :
693
698
r"""
694
699
Return a generator over all Hecke operator `T_n` for
695
700
`n = 1, 2, 3, \ldots`, with `n` coprime to the
0 commit comments