Skip to content

Commit 54af5b3

Browse files
author
Release Manager
committedNov 14, 2024
gh-38964: Drinfeld Modules: Default to zero endomorphism in `.hom` and avoid inversion of zero endomorphism This PR fixes #38953 and is inspired by the error raised in the issue: - The main fix is to avoid sampling the zero element of the base field in the test of `__invert__`, so that `phi.hom(a)` actually returns an invertible morphism. - However, the error raised in the issue named above was slightly confusing, as the call of `phi.hom(K.zero())` does not return any homomorphism: Since the codomain is not specified, it tries to find a codomain via the `.velu`-method, but this only works if the given element defines an isogeny, which `K.zero()` does not. Instead of raising an error for this special case in `.hom`, it seems more robust to default to the zero endomorphism of `self` instead. - Also added the mention of `isog` in the `.velu`-method. URL: #38964 Reported by: Sebastian A. Spindler Reviewer(s): Xavier Caruso
2 parents 7c13ae9 + b192330 commit 54af5b3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
 

‎src/sage/rings/function_field/drinfeld_modules/drinfeld_module.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ def rank(self):
18551855

18561856
def velu(self, isog):
18571857
r"""
1858-
Return a new Drinfeld module such that input is an
1858+
Return a new Drinfeld module such that ``isog`` defines an
18591859
isogeny to this module with domain ``self``; if no such isogeny
18601860
exists, raise an exception.
18611861
@@ -2018,11 +2018,19 @@ def hom(self, x, codomain=None):
20182018
Traceback (most recent call last):
20192019
...
20202020
ValueError: Ore polynomial does not define a morphism
2021+
2022+
Check that x = 0 (without specified codomain) gives the zero endomorphism::
2023+
2024+
sage: phi.hom(K.zero())
2025+
Endomorphism of Drinfeld module defined by ...
2026+
Defn: 0
20212027
"""
20222028
# When `x` is in the function ring (or something that coerces to it):
20232029
if self.function_ring().has_coerce_map_from(x.parent()):
20242030
return self.Hom(self)(x)
20252031
if codomain is None:
2032+
if x.is_zero():
2033+
return self.Hom(self)(0)
20262034
try:
20272035
codomain = self.velu(x)
20282036
except TypeError:

‎src/sage/rings/function_field/drinfeld_modules/morphism.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,11 @@ def __invert__(self):
536536
sage: K.<z> = Fq.extension(3)
537537
sage: coeffs = [z] + [K.random_element() for _ in range(10)]
538538
sage: phi = DrinfeldModule(A, coeffs)
539-
sage: f = phi.hom(K.random_element())
539+
sage: a = K.random_element()
540+
sage: while a.is_zero():
541+
....: a = K.random_element()
542+
sage: f = phi.hom(a)
540543
sage: g = ~f
541-
542544
sage: (f*g).is_identity()
543545
True
544546
sage: (g*f).is_identity()

0 commit comments

Comments
 (0)
Please sign in to comment.