Skip to content

Commit

Permalink
src/sage/modular/hecke/algebra.py: Replace use of is_HeckeAlgebraElem…
Browse files Browse the repository at this point in the history
…ent, is_HeckeOperator
  • Loading branch information
mkoeppe committed May 13, 2024
1 parent 344e2b3 commit 554bcc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sage/modular/hecke/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,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 @@ -265,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

0 comments on commit 554bcc2

Please sign in to comment.