-
-
Notifications
You must be signed in to change notification settings - Fork 676
Constructor for the Carlitz module #40433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
843a581
Merge branch 'ore_not_extension' into drinfeld_tau
7c1a26b
t -> τ
27e890b
declare encoding
35cf2b6
constructor for the Carlitz module
fca8194
Merge branch 'useless_limitations' into carlitz_module
8ebeba3
Carlitz exponential and logarithm
2caec64
some remaining t
0998e09
Merge branch 'drinfeld_tau' into carlitz_module
1708b40
allow str for the base
9c0ede5
fix lint
3df54f3
typo
eb40b55
Merge branch 'develop' into drinfeld_tau
xcaruso 5dc097f
Merge branch 'develop' into carlitz_module
xcaruso 15b399a
remove coding utf8
e37f633
Merge branch 'drinfeld_tau' into carlitz_module
124db5b
fix pdf documentation
3b91405
Merge branch 'drinfeld_tau' into carlitz_module
5dc6b45
default: ``'τ'``
8dc671e
Merge branch 'drinfeld_tau' into carlitz_module
b4b4d90
remove encoding declaration
8339fed
Merge branch 'drinfeld_tau' into carlitz_module
e14b7cf
Merge branch 'develop' into drinfeld_tau
b201d77
Merge branch 'drinfeld_tau' into carlitz_module
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
187 changes: 187 additions & 0 deletions
187
src/sage/rings/function_field/drinfeld_modules/carlitz_module.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| r""" | ||
| Carlitz module | ||
|
|
||
| AUTHORS: | ||
|
|
||
| - Xavier Caruso (2025-07): initial version | ||
| """ | ||
|
|
||
| # ***************************************************************************** | ||
| # Copyright (C) 2025 Xavier Caruso <[email protected]> | ||
| # | ||
| # This program is free software: you can redistribute it and/or modify | ||
| # it under the terms of the GNU General Public License as published by | ||
| # the Free Software Foundation, either version 2 of the License, or | ||
| # (at your option) any later version. | ||
| # http://www.gnu.org/licenses/ | ||
| # ***************************************************************************** | ||
|
|
||
| from sage.structure.parent import Parent | ||
| from sage.structure.element import Element | ||
| from sage.categories.finite_fields import FiniteFields | ||
|
|
||
| from sage.rings.infinity import Infinity | ||
|
|
||
| from sage.rings.polynomial.polynomial_ring import PolynomialRing_generic | ||
| from sage.rings.function_field.drinfeld_modules.drinfeld_module import DrinfeldModule | ||
|
|
||
|
|
||
| def CarlitzModule(A, base=None): | ||
| r""" | ||
| Return the Carlitz module over `A`. | ||
|
|
||
| INPUT: | ||
|
|
||
| - ``A`` -- a polynomial ring over a finite field | ||
|
|
||
| - ``base`` -- a field or an element in a field | ||
| (default: the fraction field of ``A``) | ||
|
|
||
| EXAMPLES:: | ||
|
|
||
| sage: Fq = GF(7) | ||
| sage: A.<T> = Fq[] | ||
| sage: CarlitzModule(A) | ||
| Drinfeld module defined by T |--> τ + T | ||
|
|
||
| We can specify a different base. | ||
| This is interesting for instance for having two different variable | ||
| names:: | ||
|
|
||
| sage: R.<z> = Fq[] | ||
| sage: K = Frac(R) | ||
| sage: CarlitzModule(A, K) | ||
| Drinfeld module defined by T |--> τ + z | ||
|
|
||
| Using a similar syntax, we can construct the reduction over the | ||
| Carlitz module modulo primes:: | ||
|
|
||
| sage: F.<a> = Fq.extension(z^2 + 1) | ||
| sage: CarlitzModule(A, F) | ||
| Drinfeld module defined by T |--> τ + a | ||
|
|
||
| It is also possible to pass in any element in the base field | ||
| (in this case, the result might not be strictly speaking the | ||
| Carlitz module, but it is always a Drinfeld module of rank 1):: | ||
|
|
||
| sage: CarlitzModule(A, z^2) | ||
| Drinfeld module defined by T |--> τ + z^2 | ||
|
|
||
| TESTS:: | ||
|
|
||
| sage: CarlitzModule(Fq) | ||
| Traceback (most recent call last): | ||
| ... | ||
| TypeError: the function ring must be defined over a finite field | ||
|
|
||
| :: | ||
|
|
||
| sage: S.<x,y> = QQ[] | ||
| sage: CarlitzModule(A, S) | ||
| Traceback (most recent call last): | ||
| ... | ||
| ValueError: function ring base must coerce into base field | ||
| """ | ||
| if (not isinstance(A, PolynomialRing_generic) | ||
| or A.base_ring() not in FiniteFields()): | ||
| raise TypeError('the function ring must be defined over a finite field') | ||
| if base is None: | ||
| K = A.fraction_field() | ||
| z = K.gen() | ||
| elif isinstance(base, Parent): | ||
| if base.has_coerce_map_from(A): | ||
| z = base(A.gen()) | ||
| else: | ||
| z = base.gen() | ||
| elif isinstance(base, Element): | ||
| z = base | ||
| else: | ||
| raise ValueError("cannot construct a Carlitz module from the given data") | ||
| return DrinfeldModule(A, [z, 1]) | ||
|
|
||
| def CarlitzExponential(A, prec=+Infinity, name='z'): | ||
| r""" | ||
| Return the Carlitz exponential attached the ring `A`. | ||
|
|
||
| INPUT: | ||
|
|
||
| - ``prec`` -- an integer or ``Infinity`` (default: ``Infinity``); | ||
| the precision at which the series is returned; if ``Infinity``, | ||
| a lazy power series in returned, else, a classical power series | ||
| is returned. | ||
|
|
||
| - ``name`` -- string (default: ``'z'``); the name of the | ||
| generator of the lazy power series ring | ||
|
|
||
| EXAMPLES:: | ||
|
|
||
| sage: A.<T> = GF(2)[] | ||
|
|
||
| When ``prec`` is ``Infinity`` (which is the default), | ||
| the exponential is returned as a lazy power series, meaning | ||
| that any of its coefficients can be computed on demands:: | ||
|
|
||
| sage: exp = CarlitzExponential(A) | ||
| sage: exp | ||
| z + ((1/(T^2+T))*z^2) + ((1/(T^8+T^6+T^5+T^3))*z^4) + O(z^8) | ||
| sage: exp[2^4] | ||
| 1/(T^64 + T^56 + T^52 + ... + T^27 + T^23 + T^15) | ||
| sage: exp[2^5] | ||
| 1/(T^160 + T^144 + T^136 + ... + T^55 + T^47 + T^31) | ||
|
|
||
| On the contrary, when ``prec`` is a finite number, all the | ||
| required coefficients are computed at once:: | ||
|
|
||
| sage: CarlitzExponential(A, prec=10) | ||
| z + (1/(T^2 + T))*z^2 + (1/(T^8 + T^6 + T^5 + T^3))*z^4 + (1/(T^24 + T^20 + T^18 + T^17 + T^14 + T^13 + T^11 + T^7))*z^8 + O(z^10) | ||
|
|
||
| We check that the Carlitz exponential is the compositional inverse | ||
| of the Carlitz logarithm:: | ||
|
|
||
| sage: log = CarlitzLogarithm(A) | ||
| sage: exp(log) | ||
| z + O(z^8) | ||
| sage: log(exp) | ||
| z + O(z^8) | ||
| """ | ||
| C = CarlitzModule(A) | ||
| return C.exponential(prec, name) | ||
|
|
||
| def CarlitzLogarithm(A, prec=+Infinity, name='z'): | ||
| r""" | ||
| Return the Carlitz exponential attached the ring `A`. | ||
|
|
||
| INPUT: | ||
|
|
||
| - ``prec`` -- an integer or ``Infinity`` (default: ``Infinity``); | ||
| the precision at which the series is returned; if ``Infinity``, | ||
| a lazy power series in returned, else, a classical power series | ||
| is returned. | ||
|
|
||
| - ``name`` -- string (default: ``'z'``); the name of the | ||
| generator of the lazy power series ring | ||
|
|
||
| EXAMPLES:: | ||
|
|
||
| sage: A.<T> = GF(2)[] | ||
|
|
||
| When ``prec`` is ``Infinity`` (which is the default), | ||
| the exponential is returned as a lazy power series, meaning | ||
| that any of its coefficients can be computed on demands:: | ||
|
|
||
| sage: log = CarlitzLogarithm(A) | ||
| sage: log | ||
| z + ((1/(T^2+T))*z^2) + ((1/(T^6+T^5+T^3+T^2))*z^4) + O(z^8) | ||
| sage: log[2^4] | ||
| 1/(T^30 + T^29 + T^27 + ... + T^7 + T^5 + T^4) | ||
| sage: log[2^5] | ||
| 1/(T^62 + T^61 + T^59 + ... + T^8 + T^6 + T^5) | ||
|
|
||
| On the contrary, when ``prec`` is a finite number, all the | ||
| required coefficients are computed at once:: | ||
|
|
||
| sage: CarlitzLogarithm(A, prec=10) | ||
| z + (1/(T^2 + T))*z^2 + (1/(T^6 + T^5 + T^3 + T^2))*z^4 + (1/(T^14 + T^13 + T^11 + T^10 + T^7 + T^6 + T^4 + T^3))*z^8 + O(z^10) | ||
| """ | ||
| C = CarlitzModule(A) | ||
| return C.logarithm(prec, name) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.