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
35 changes: 11 additions & 24 deletions src/sage/categories/drinfeld_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class DrinfeldModules(Category_over_base_ring):
The base field is retrieved using the method :meth:`base`::

sage: C.base()
Finite Field in z of size 11^4 over its base
Finite Field in z of size 11^4

Equivalently, one can use :meth:`base_morphism` to retrieve the base
morphism::
Expand Down Expand Up @@ -170,13 +170,6 @@ class DrinfeldModules(Category_over_base_ring):
...
TypeError: base field must be a ring extension

Note that `C.base_morphism()` has codomain `K` while
the defining morphism of `C.base()` has codomain `K` viewed
as an `A`-field. Thus, they differ::

sage: C.base().defining_morphism() == C.base_morphism()
False

::

sage: base = Hom(A, A)(1)
Expand Down Expand Up @@ -276,7 +269,7 @@ def __init__(self, base_morphism, name='τ'):
i = A.coerce_map_from(Fq)
Fq_to_K = self._base_morphism * i
self._base_over_constants_field = base_field.over(Fq_to_K)
super().__init__(base=base_field.over(base_morphism))
super().__init__(base=base_field)

def _latex_(self):
r"""
Expand Down Expand Up @@ -377,7 +370,7 @@ def A_field(self):
sage: C.A_field()
Finite Field in z of size 5^12 over its base
"""
return self.base()
return self.base().over(self._base_morphism)

def base_morphism(self):
r"""
Expand Down Expand Up @@ -461,7 +454,7 @@ def constant_coefficient(self):
sage: C = phi.category()
sage: C.constant_coefficient()
z^3 + 7*z^2 + 6*z + 10
sage: C.constant_coefficient() == C.base()(T)
sage: C.constant_coefficient() == C.A_field()(T)
True
"""
return self._constant_coefficient
Expand Down Expand Up @@ -616,15 +609,8 @@ def A_field(self):

def base(self):
r"""
Return the underlying `A`-field of this Drinfeld module,
viewed as an algebra over the function ring `A`.

This is an instance of the class
:class:`sage.rings.ring_extension.RingExtension`.

.. NOTE::

This method has the same behavior as :meth:`A_field`.
Return the field over which this Drinfeld module
is defined.

EXAMPLES::

Expand All @@ -634,14 +620,15 @@ def base(self):
sage: p_root = 2*z12^11 + 2*z12^10 + z12^9 + 3*z12^8 + z12^7 + 2*z12^5 + 2*z12^4 + 3*z12^3 + z12^2 + 2*z12
sage: phi = DrinfeldModule(A, [p_root, z12^3, z12^5])
sage: phi.base()
Finite Field in z12 of size 5^12 over its base
Finite Field in z12 of size 5^12

The base can be infinite::

sage: sigma = DrinfeldModule(A, [T, 1])
sage: sigma.base()
Fraction Field of Univariate Polynomial Ring in T over Finite Field in z2 of size 5^2 over its base
Fraction Field of Univariate Polynomial Ring in T over Finite Field in z2 of size 5^2
"""
# should we add a deprecation?
return self.category().base()

def base_morphism(self):
Expand Down Expand Up @@ -758,8 +745,8 @@ def constant_coefficient(self):
`\gamma(T)`::

sage: C = phi.category()
sage: base = C.base()
sage: base(T) == phi.constant_coefficient()
sage: F = C.A_field()
sage: F(T) == phi.constant_coefficient()
True

Naturally, two Drinfeld modules in the same category have the
Expand Down
4 changes: 2 additions & 2 deletions src/sage/rings/function_field/drinfeld_modules/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DrinfeldModuleAction(Action):
sage: phi = DrinfeldModule(A, [z, 0, 0, 1])
sage: action = phi.action()
sage: action
Action on Finite Field in z of size 11^2 over its base
Action on Finite Field in z of size 11^2
induced by Drinfeld module defined by T |--> τ^3 + z

The action on elements is computed as follows::
Expand Down Expand Up @@ -174,7 +174,7 @@ def _repr_(self) -> str:
sage: phi = DrinfeldModule(A, [z, 0, 0, 1])
sage: action = phi.action()
sage: action
Action on Finite Field in z of size 11^2 over its base induced by Drinfeld module defined by T |--> τ^3 + z
Action on Finite Field in z of size 11^2 induced by Drinfeld module defined by T |--> τ^3 + z
"""
return f'Action on {self._base} induced by ' \
f'{self._drinfeld_module}'
Expand Down
19 changes: 5 additions & 14 deletions src/sage/rings/function_field/drinfeld_modules/drinfeld_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class DrinfeldModule(Parent, UniqueRepresentation):
sage: psi
Drinfeld module defined by T |--> (T + 1)*τ + T
sage: psi.base()
Fraction Field of Univariate Polynomial Ring in T over Finite Field in z2 of size 7^2 over its base
Fraction Field of Univariate Polynomial Ring in T over Finite Field in z2 of size 7^2

.. NOTE::

Expand Down Expand Up @@ -213,7 +213,7 @@ class DrinfeldModule(Parent, UniqueRepresentation):
:meth:`base`::

sage: phi.base()
Finite Field in z of size 3^12 over its base
Finite Field in z of size 3^12

The base morphism is retrieved using :meth:`base_morphism`::

Expand All @@ -223,14 +223,6 @@ class DrinfeldModule(Parent, UniqueRepresentation):
To: Finite Field in z of size 3^12
Defn: T |--> z

Note that the base field is *not* the field `K`. Rather, it is a
ring extension
(see :class:`sage.rings.ring_extension.RingExtension`) whose
underlying ring is `K` and whose base is the base morphism::

sage: phi.base() is K
False

.. RUBRIC:: Getters

One can retrieve basic properties::
Expand Down Expand Up @@ -403,7 +395,7 @@ class DrinfeldModule(Parent, UniqueRepresentation):

sage: action = phi.action()
sage: action
Action on Finite Field in z of size 3^12 over its base
Action on Finite Field in z of size 3^12
induced by Drinfeld module defined by T |--> τ^2 + τ + z

The action on elements is computed by calling the action object::
Expand Down Expand Up @@ -711,7 +703,7 @@ def __call__(self, a):
::

sage: a = A.random_element(5)
sage: phi(a)[0] == phi.category().base()(a)
sage: phi(a)[0] == phi.A_field()(a)
True
"""
return self._morphism(a)
Expand Down Expand Up @@ -859,7 +851,7 @@ def action(self):
sage: phi = DrinfeldModule(A, [p_root, z12^3, z12^5])
sage: action = phi.action()
sage: action
Action on Finite Field in z12 of size 5^12 over its base
Action on Finite Field in z12 of size 5^12
induced by Drinfeld module defined by T |--> z12^5*τ^2 + z12^3*τ + 2*z12^11
+ 2*z12^10 + z12^9 + 3*z12^8 + z12^7 + 2*z12^5 + 2*z12^4 + 3*z12^3 + z12^2 + 2*z12

Expand Down Expand Up @@ -1446,7 +1438,6 @@ def is_isomorphic(self, other, absolutely=False) -> bool:
if absolutely:
return True
else:
ue = ue.backend(force=True)
try:
_ = ue.nth_root(e)
except ValueError:
Expand Down
5 changes: 4 additions & 1 deletion src/sage/rings/ring_extension_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,15 @@
sage: R.<x> = QQ[]
sage: E = R.over()
sage: P = E(x^2 + 2*x + 3)
sage: P(1)

Check failure on line 165 in src/sage/rings/ring_extension_element.pyx

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.12, new)

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/sage/doctest/forker.py", line 734, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/sage/doctest/forker.py", line 1158, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.ring_extension_element.RingExtensionElement.__call__[3]>", line 1, in <module> P(Integer(1)) File "sage/rings/ring_extension_element.pyx", line 171, in sage.rings.ring_extension_element.RingExtensionElement.__call__ return from_backend(output, args[0].parent()) File "sage/rings/ring_extension_conversion.pyx", line 457, in sage.rings.ring_extension_conversion.from_backend ans = from_backend_element(arg,E) TypeError: Cannot convert sage.rings.integer_ring.IntegerRing_class to sage.rings.ring_extension.RingExtension_generic

Check failure on line 165 in src/sage/rings/ring_extension_element.pyx

View workflow job for this annotation

GitHub Actions / test-long (src/sage/[p-z]*)

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 734, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1158, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.ring_extension_element.RingExtensionElement.__call__[3]>", line 1, in <module> P(Integer(1)) File "sage/rings/ring_extension_element.pyx", line 171, in sage.rings.ring_extension_element.RingExtensionElement.__call__ File "sage/rings/ring_extension_conversion.pyx", line 457, in sage.rings.ring_extension_conversion.from_backend TypeError: Cannot convert sage.rings.integer_ring.IntegerRing_class to sage.rings.ring_extension.RingExtension_generic

Check failure on line 165 in src/sage/rings/ring_extension_element.pyx

View workflow job for this annotation

GitHub Actions / Conda (macos, Python 3.12, all)

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.12/site-packages/sage/doctest/forker.py", line 734, in _run self.compile_and_execute(example, compiler, test.globs) File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.12/site-packages/sage/doctest/forker.py", line 1158, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.ring_extension_element.RingExtensionElement.__call__[3]>", line 1, in <module> P(Integer(1)) File "sage/rings/ring_extension_element.pyx", line 171, in sage.rings.ring_extension_element.RingExtensionElement.__call__ return from_backend(output, args[0].parent()) File "sage/rings/ring_extension_conversion.pyx", line 457, in sage.rings.ring_extension_conversion.from_backend ans = from_backend_element(arg,E) TypeError: Cannot convert sage.rings.integer_ring.IntegerRing_class to sage.rings.ring_extension.RingExtension_generic

Check failure on line 165 in src/sage/rings/ring_extension_element.pyx

View workflow job for this annotation

GitHub Actions / Conda (macos, Python 3.13, all)

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/forker.py", line 734, in _run self.compile_and_execute(example, compiler, test.globs) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/forker.py", line 1158, in compile_and_execute exec(compiled, globs) ~~~~^^^^^^^^^^^^^^^^^ File "<doctest sage.rings.ring_extension_element.RingExtensionElement.__call__[3]>", line 1, in <module> P(Integer(1)) ~^^^^^^^^^^^^ File "sage/rings/ring_extension_element.pyx", line 171, in sage.rings.ring_extension_element.RingExtensionElement.__call__ return from_backend(output, args[0].parent()) File "sage/rings/ring_extension_conversion.pyx", line 457, in sage.rings.ring_extension_conversion.from_backend ans = from_backend_element(arg,E) TypeError: Cannot convert sage.rings.integer_ring.IntegerRing_class to sage.rings.ring_extension.RingExtension_generic

Check failure on line 165 in src/sage/rings/ring_extension_element.pyx

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.13, all)

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/usr/share/miniconda/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/forker.py", line 734, in _run self.compile_and_execute(example, compiler, test.globs) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/miniconda/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/forker.py", line 1158, in compile_and_execute exec(compiled, globs) ~~~~^^^^^^^^^^^^^^^^^ File "<doctest sage.rings.ring_extension_element.RingExtensionElement.__call__[3]>", line 1, in <module> P(Integer(1)) ~^^^^^^^^^^^^ File "sage/rings/ring_extension_element.pyx", line 171, in sage.rings.ring_extension_element.RingExtensionElement.__call__ return from_backend(output, args[0].parent()) File "sage/rings/ring_extension_conversion.pyx", line 457, in sage.rings.ring_extension_conversion.from_backend ans = from_backend_element(arg,E) TypeError: Cannot convert sage.rings.integer_ring.IntegerRing_class to sage.rings.ring_extension.RingExtension_generic

Check failure on line 165 in src/sage/rings/ring_extension_element.pyx

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.12, all)

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/sage/doctest/forker.py", line 734, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/sage/doctest/forker.py", line 1158, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.ring_extension_element.RingExtensionElement.__call__[3]>", line 1, in <module> P(Integer(1)) File "sage/rings/ring_extension_element.pyx", line 171, in sage.rings.ring_extension_element.RingExtensionElement.__call__ return from_backend(output, args[0].parent()) File "sage/rings/ring_extension_conversion.pyx", line 457, in sage.rings.ring_extension_conversion.from_backend ans = from_backend_element(arg,E) TypeError: Cannot convert sage.rings.integer_ring.IntegerRing_class to sage.rings.ring_extension.RingExtension_generic

Check failure on line 165 in src/sage/rings/ring_extension_element.pyx

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.12, all, editable)

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/home/runner/work/sage/sage/src/sage/doctest/forker.py", line 734, in _run self.compile_and_execute(example, compiler, test.globs) File "/home/runner/work/sage/sage/src/sage/doctest/forker.py", line 1158, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.ring_extension_element.RingExtensionElement.__call__[3]>", line 1, in <module> P(Integer(1)) File "sage/rings/ring_extension_element.pyx", line 171, in sage.rings.ring_extension_element.RingExtensionElement.__call__ File "sage/rings/ring_extension_conversion.pyx", line 457, in sage.rings.ring_extension_conversion.from_backend TypeError: Cannot convert sage.rings.integer_ring.IntegerRing_class to sage.rings.ring_extension.RingExtension_generic
6
"""
if (<RingExtension_generic>self._parent)._import_methods:
output = self._backend(*to_backend(args), **to_backend(kwargs))
return from_backend(output, self._parent)
if args:
return from_backend(output, args[0].parent())
else:
return from_backend(output, self._parent)
return TypeError("this element is not callable")

def __dir__(self):
Expand Down
Loading