Skip to content

Commit 14b5a1b

Browse files
committed
addition of morphisms
1 parent 79d8be5 commit 14b5a1b

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

src/sage/rings/function_field/drinfeld_modules/homset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ def __init__(self, X, Y, category=None, check=True):
247247
# ARGH: the next line does not work
248248
# because Map.__mul__ does not call the coercion system
249249
self.register_action(DrinfeldModuleMorphismAction(A, self, False, operator.mul))
250+
if X is Y:
251+
self.register_coercion(A)
250252

251253
def _latex_(self):
252254
r"""

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

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from sage.misc.latex import latex
2323
from sage.categories.morphism import Morphism
2424
from sage.structure.unique_representation import UniqueRepresentation
25+
from sage.structure.element import coerce_binop
2526

2627
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
2728
from sage.matrix.constructor import matrix
@@ -419,6 +420,42 @@ def ore_polynomial(self):
419420
"""
420421
return self._ore_polynomial
421422

423+
@coerce_binop
424+
def __add__(self, other):
425+
r"""
426+
Return the sum of this morphism and ``other``.
427+
428+
INPUT:
429+
430+
- ``other`` -- a morphism of Drinfeld modules in the
431+
same category
432+
433+
TESTS::
434+
435+
sage: Fq = GF(5)
436+
sage: A.<T> = Fq[]
437+
sage: K.<z> = Fq.extension(3)
438+
sage: phi = DrinfeldModule(A, [z, 0, 1, z])
439+
sage: t = phi.ore_variable()
440+
sage: f = phi.hom(t + 1)
441+
sage: g = T * f
442+
sage: f + g # indirect doctest
443+
Drinfeld Module morphism:
444+
From: Drinfeld module defined by T |--> z*t^3 + t^2 + z
445+
To: Drinfeld module defined by T |--> (2*z^2 + 4*z + 4)*t^3 + (3*z^2 + 2*z + 2)*t^2 + (2*z^2 + 3*z + 4)*t + z
446+
Defn: (2*z^2 + 4*z + 4)*t^4 + (z + 1)*t^3 + t^2 + (2*z^2 + 4*z)*t + z + 1
447+
448+
We check that coercion from the function ring works::
449+
450+
sage: F = phi.frobenius_endomorphism()
451+
sage: F + T
452+
Endomorphism of Drinfeld module defined by T |--> z*t^3 + t^2 + z
453+
Defn: (z + 1)*t^3 + t^2 + z
454+
455+
"""
456+
u = self.ore_polynomial() + other.ore_polynomial()
457+
return self.parent()(u)
458+
422459
def _composition_(self, other, H):
423460
r"""
424461
Return the composite of this morphism and ``other``.
@@ -718,9 +755,17 @@ def charpoly(self, var='X'):
718755
sage: phi = DrinfeldModule(A, [z, 0, 1, z])
719756
720757
sage: f = phi.frobenius_endomorphism()
721-
sage: f.charpoly()
758+
sage: chi = f.charpoly()
759+
sage: chi
722760
X^3 + (T + 1)*X^2 + (2*T + 3)*X + 2*T^3 + T + 1
723761
762+
We check that the characteristic polynomial annihilates the
763+
morphism (Cayley-Hamilton's theorem)::
764+
765+
sage: chi(f)
766+
Endomorphism of Drinfeld module defined by T |--> z*t^3 + t^2 + z
767+
Defn: 0
768+
724769
We verify, on an example, that the caracteristic polynomial
725770
of a morphism corresponding to `\phi_a` is `(X-a)^r` where `r`
726771
is the rank::

0 commit comments

Comments
 (0)