Skip to content
Open
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
24 changes: 10 additions & 14 deletions src/sage/modular/abvar/homspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,23 +275,19 @@ def _matrix_space(self):
"""
return MatrixSpace(ZZ, 2*self.domain().dimension(), 2*self.codomain().dimension())

def _element_constructor_from_element_class(self, *args, **keywords):
"""
Used in the coercion framework. Unfortunately, the default method
would get the order of parent and data different from what is expected
in ``MatrixMorphism.__init__``.

EXAMPLES::
def _coerce_map_from_(self, other):
r"""
TESTS::

sage: H = Hom(J0(11), J0(22))
sage: phi = H(matrix(ZZ,2,4,[5..12])); phi # indirect doctest
Abelian variety morphism:
From: Abelian variety J0(11) of dimension 1
To: Abelian variety J0(22) of dimension 2
sage: t = J0(33).hecke_operator(2)
sage: t.parent().has_coerce_map_from(ZZ)
True
"""
return self.element_class(self, *args, **keywords)
if self.matrix_space().has_coerce_map_from(other):
return True
return super()._coerce_map_from_(other)

def __call__(self, M, **kwds):
def _element_constructor_(self, M, **kwds):
r"""
Create a homomorphism in this space from M. M can be any of the
following:
Expand Down
Loading