Skip to content
Merged
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
16 changes: 11 additions & 5 deletions src/sage/modular/hecke/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,16 @@ def is_HeckeAlgebra(x) -> bool:

sage: from sage.modular.hecke.algebra import is_HeckeAlgebra
sage: is_HeckeAlgebra(CuspForms(1, 12).anemic_hecke_algebra())
doctest:warning...
DeprecationWarning: the function is_HeckeAlgebra is deprecated;
use 'isinstance(..., HeckeAlgebra_base)' instead
See https://github.com/sagemath/sage/issues/37895 for details.
True
sage: is_HeckeAlgebra(ZZ)
False
"""
from sage.misc.superseded import deprecation
deprecation(37895, "the function is_HeckeAlgebra is deprecated; use 'isinstance(..., HeckeAlgebra_base)' instead")
return isinstance(x, HeckeAlgebra_base)


Expand Down Expand Up @@ -177,8 +183,8 @@ def __init__(self, M) -> None:
"""
if isinstance(M, tuple):
M = M[0]
from . import module
if not module.is_HeckeModule(M):
from .module import HeckeModule_generic
if not isinstance(M, HeckeModule_generic):
msg = f"M (={M}) must be a HeckeModule"
raise TypeError(msg)
self.__M = M
Expand Down Expand Up @@ -246,7 +252,7 @@ def _element_constructor_(self, x, check=True):
TypeError: Don't know how to construct an element of Anemic Hecke algebra acting on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field from Hecke operator T_11 on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field

"""
from .hecke_operator import HeckeAlgebraElement_matrix, HeckeOperator, is_HeckeOperator, is_HeckeAlgebraElement
from .hecke_operator import HeckeAlgebraElement_matrix, HeckeOperator, HeckeAlgebraElement

if not isinstance(x, Element):
x = self.base_ring()(x)
Expand All @@ -259,13 +265,13 @@ def _element_constructor_(self, x, check=True):
if parent is self:
return x

if is_HeckeOperator(x):
if isinstance(x, HeckeOperator):
if x.parent() == self \
or (not self.is_anemic() and x.parent() == self.anemic_subalgebra()) \
or (self.is_anemic() and x.parent().anemic_subalgebra() == self and gcd(x.index(), self.level()) == 1):
return HeckeOperator(self, x.index())

if is_HeckeAlgebraElement(x):
if isinstance(x, HeckeAlgebraElement):
if x.parent() == self or (not self.is_anemic() and x.parent() == self.anemic_subalgebra()):
if x.parent().module().basis_matrix() == self.module().basis_matrix():
return HeckeAlgebraElement_matrix(self, x.matrix())
Expand Down
Loading