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
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ def rank(self):

def velu(self, isog):
r"""
Return a new Drinfeld module such that input is an
Return a new Drinfeld module such that ``isog`` defines an
isogeny to this module with domain ``self``; if no such isogeny
exists, raise an exception.

Expand Down Expand Up @@ -2018,11 +2018,19 @@ def hom(self, x, codomain=None):
Traceback (most recent call last):
...
ValueError: Ore polynomial does not define a morphism

Check that x = 0 (without specified codomain) gives the zero endomorphism::

sage: phi.hom(K.zero())
Endomorphism of Drinfeld module defined by ...
Defn: 0
"""
# When `x` is in the function ring (or something that coerces to it):
if self.function_ring().has_coerce_map_from(x.parent()):
return self.Hom(self)(x)
if codomain is None:
if x.is_zero():
return self.Hom(self)(0)
try:
codomain = self.velu(x)
except TypeError:
Expand Down
6 changes: 4 additions & 2 deletions src/sage/rings/function_field/drinfeld_modules/morphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,11 @@ def __invert__(self):
sage: K.<z> = Fq.extension(3)
sage: coeffs = [z] + [K.random_element() for _ in range(10)]
sage: phi = DrinfeldModule(A, coeffs)
sage: f = phi.hom(K.random_element())
sage: a = K.random_element()
sage: while a.is_zero():
....: a = K.random_element()
sage: f = phi.hom(a)
sage: g = ~f

sage: (f*g).is_identity()
True
sage: (g*f).is_identity()
Expand Down
Loading