Skip to content

Commit

Permalink
Avoid non-invertible scaling and zero endomorphism
Browse files Browse the repository at this point in the history
  • Loading branch information
S17A05 committed Nov 13, 2024
1 parent 209ae4c commit b192330
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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

0 comments on commit b192330

Please sign in to comment.