-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
New algorithms to compute the characteristic polynomial of the Frobenius endomorphism of a Drinfeld module #38174
Conversation
Documentation preview for this PR (built with commit 3dd3c04; changes) is ready! 🎉 |
Check that ``var`` inputs are taken into account for cached | ||
characteristic polynomials:: | ||
|
||
sage: Fq = GF(2) | ||
sage: A.<T> = Fq[] | ||
sage: K.<z> = Fq.extension(2) | ||
sage: phi = DrinfeldModule(A, [z, 0, 1]) | ||
sage: phi.frobenius_charpoly() | ||
X^2 + X + T^2 + T + 1 | ||
sage: phi.frobenius_charpoly(var='Foo') | ||
Foo^2 + Foo + T^2 + T + 1 | ||
sage: phi.frobenius_charpoly(var='Bar') | ||
Bar^2 + Bar + T^2 + T + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like there a little bit too much emphasis on this optional flag and the documentation of this method is already quite lenghty. I think this could either: be rephrased into a more "software reference manual documentation" way OR put into a TEST
block in order to hide it from the manual completely.
What I mean by the first suggestion is: rephrase the sentence like "Use the optional var
parameter in order to change the variable name of the resulting univariate polynomial" or somthing like this. Also, I would reuse the last phi
to make it a one-liner doctest.
Anyway, this is only my preference as someone who don't really like to read documentation and prefer to have the most straightforward info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this block (lines 408 to 420) are already in a TESTS::
block, no? See line 359.
src/sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py
Outdated
Show resolved
Hide resolved
src/sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py
Outdated
Show resolved
Hide resolved
…_module.py Co-authored-by: David Ayotte <34245930+DavidAyotte@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small comments.
Otherwise it looks good to me; however, my opinion is certainly biased since I am mostly the author of this code.
if self._frobenius_charpoly is not None: | ||
return self._frobenius_charpoly | ||
return self._frobenius_charpoly.change_variable_name(var) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With these lines, you use the cached value even if the user explicitly asks for another algorithm. I think that it is not what we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Will also take care of it.
(Wasn't it already the case tho? I remember having to use some tricks in the past to not use the cached data, but maybe I was mistaken.)
@cached_method | ||
def frobenius_trace(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this method, you use the crystalline matrix in all cases. I think it is okay but aren't there any case where the motive matrix is faster to compute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. Will take care of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any objection to making DrinfeldModuleMorphism._motive_matrix
public? It's interesting in its own right and would be useful in our case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by public? Without the initial underscore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, eventually, I plan to have a method motive
to create the motive of a Drinfeld module or a morphism between those, and a method matrix
to get the matrix of a morphism of Anderson motives.
So, if you make the method _motive_matrix
public now, it means that it will need to be deprecated afterwards. Therefore, I prefer keeping it as it is.
src/sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py
Outdated
Show resolved
Hide resolved
src/sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py
Outdated
Show resolved
Hide resolved
src/sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py
Outdated
Show resolved
Hide resolved
src/sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py
Outdated
Show resolved
Hide resolved
src/sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py
Outdated
Show resolved
Hide resolved
src/sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py
Outdated
Show resolved
Hide resolved
Strong +1. |
This time, for instance, I got the error for the check
I assume this is not due to this PR. With
Should I care about this? All In any case, it seems that the issue with the documentation is now fixed. So I give again a positive review. I'm sorry if I'm wrong but I'm completely lost. |
Why is the git commit history so ugly? It's quite hard to follow what has been done in this PR. |
I think it's my fault but I don't know exactly what happened: at some point, I merged with the latest version of |
…mial of the Frobenius endomorphism of a Drinfeld module <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> This pull request implements two new algorithms to compute the characteristic polynomial of the Frobenius endomorphism of a Drinfeld $\mathbb F_q[T]$-module over a finite field $K$. Previously, only the algorithms based on crystalline cohomology (see [Musleh-Schost 2023](https://dl.acm.org/doi/10.1145/3597066.3597080)) or on Anderson motives (see [Caruso-Leudière 2023](https://arxiv.org/abs/2307.02879)) were implemented. We propose two new algorithms: - The algorithm based on central simple algebras described in Chapter 4 of [Caruso-Leudière 2023](https://arxiv.org/abs/2307.02879). - The algorithm described by Gekeler in [Gekeler 1991](https://www.scien cedirect.com/science/article/pii/002186939190211P). **Acknowledgement.** This implementation was originally due to @xcaruso (see [here](https://github.com/xcaruso/sage/blob/d2e36bd18b51c93806b7a3b 5c8261da7dc98c494/src/sage/rings/function_field/drinfeld_modules/finite_ drinfeld_module.py)), and after a private discussion, I took the liberty of creating this PR. I also propose to change the formula computed by `frobenius_norm`. Before, it computed $$(-1)^n \mathrm{N}_{K/\mathbb F_q}(\Delta) p^{n / \mathrm{deg}(p)},$$ where $K$ is the ground field, $n$ is the degree of $K$ over $\mathbb F_q$, and $p$ is the monic generator of the $\mathbb F_q[T]$-characteristic of $K$. The docstring claimed this was $(-1)^r$ times the constant coefficient of the characteristic polynomial of the Frobenius endomorphism, $r$ being the rank of the Drinfeld module. I believe this was a mistake, and instead changed the formula, following Theorem 4.2.7 of [Papikian's book](https://link.springer.com/book/10.1007/978-3-031-19707-9), to $$(-1)^{nr - n - r} \mathrm{N}_{K/\mathbb F_q}(\Delta) p^{n / \mathrm{deg}(p)}.$$ P.S. @DavidAyotte, given that you now work in the industry, please tell us if you still want to be tagged on these Drinfeld module stuff. Same question for you @ymusleh given that you defended your thesis (congratulations!). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [X] I have updated the documentation and checked the documentation preview. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> (Dédicace à ABLCCN) URL: sagemath#38174 Reported by: Antoine Leudière Reviewer(s): Antoine Leudière, David Ayotte, Xavier Caruso
The error in the conda workflow at least seems to be introduced by this PR or not? Could this be fixed please? Thanks! (Maybe as a follow-up since its already in volkers release branch) |
…mial of the Frobenius endomorphism of a Drinfeld module <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> This pull request implements two new algorithms to compute the characteristic polynomial of the Frobenius endomorphism of a Drinfeld $\mathbb F_q[T]$-module over a finite field $K$. Previously, only the algorithms based on crystalline cohomology (see [Musleh-Schost 2023](https://dl.acm.org/doi/10.1145/3597066.3597080)) or on Anderson motives (see [Caruso-Leudière 2023](https://arxiv.org/abs/2307.02879)) were implemented. We propose two new algorithms: - The algorithm based on central simple algebras described in Chapter 4 of [Caruso-Leudière 2023](https://arxiv.org/abs/2307.02879). - The algorithm described by Gekeler in [Gekeler 1991](https://www.scien cedirect.com/science/article/pii/002186939190211P). **Acknowledgement.** This implementation was originally due to @xcaruso (see [here](https://github.com/xcaruso/sage/blob/d2e36bd18b51c93806b7a3b 5c8261da7dc98c494/src/sage/rings/function_field/drinfeld_modules/finite_ drinfeld_module.py)), and after a private discussion, I took the liberty of creating this PR. I also propose to change the formula computed by `frobenius_norm`. Before, it computed $$(-1)^n \mathrm{N}_{K/\mathbb F_q}(\Delta) p^{n / \mathrm{deg}(p)},$$ where $K$ is the ground field, $n$ is the degree of $K$ over $\mathbb F_q$, and $p$ is the monic generator of the $\mathbb F_q[T]$-characteristic of $K$. The docstring claimed this was $(-1)^r$ times the constant coefficient of the characteristic polynomial of the Frobenius endomorphism, $r$ being the rank of the Drinfeld module. I believe this was a mistake, and instead changed the formula, following Theorem 4.2.7 of [Papikian's book](https://link.springer.com/book/10.1007/978-3-031-19707-9), to $$(-1)^{nr - n - r} \mathrm{N}_{K/\mathbb F_q}(\Delta) p^{n / \mathrm{deg}(p)}.$$ P.S. @DavidAyotte, given that you now work in the industry, please tell us if you still want to be tagged on these Drinfeld module stuff. Same question for you @ymusleh given that you defended your thesis (congratulations!). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [X] I have updated the documentation and checked the documentation preview. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> (Dédicace à ABLCCN) URL: sagemath#38174 Reported by: Antoine Leudière Reviewer(s): Antoine Leudière, David Ayotte, Xavier Caruso
This bug is not even in the current version; I merged
So no, I don't think so, and I can hardly find it realistic that Xavier or me would have touched this file. |
Yo! All required tests pass! 🎉 |
Ah bah non attends. (Meaning: oh but wait but no.) Some stuff related to coverage is failing. Oh well. |
…mial of the Frobenius endomorphism of a Drinfeld module <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> This pull request implements two new algorithms to compute the characteristic polynomial of the Frobenius endomorphism of a Drinfeld $\mathbb F_q[T]$-module over a finite field $K$. Previously, only the algorithms based on crystalline cohomology (see [Musleh-Schost 2023](https://dl.acm.org/doi/10.1145/3597066.3597080)) or on Anderson motives (see [Caruso-Leudière 2023](https://arxiv.org/abs/2307.02879)) were implemented. We propose two new algorithms: - The algorithm based on central simple algebras described in Chapter 4 of [Caruso-Leudière 2023](https://arxiv.org/abs/2307.02879). - The algorithm described by Gekeler in [Gekeler 1991](https://www.scien cedirect.com/science/article/pii/002186939190211P). **Acknowledgement.** This implementation was originally due to @xcaruso (see [here](https://github.com/xcaruso/sage/blob/d2e36bd18b51c93806b7a3b 5c8261da7dc98c494/src/sage/rings/function_field/drinfeld_modules/finite_ drinfeld_module.py)), and after a private discussion, I took the liberty of creating this PR. I also propose to change the formula computed by `frobenius_norm`. Before, it computed $$(-1)^n \mathrm{N}_{K/\mathbb F_q}(\Delta) p^{n / \mathrm{deg}(p)},$$ where $K$ is the ground field, $n$ is the degree of $K$ over $\mathbb F_q$, and $p$ is the monic generator of the $\mathbb F_q[T]$-characteristic of $K$. The docstring claimed this was $(-1)^r$ times the constant coefficient of the characteristic polynomial of the Frobenius endomorphism, $r$ being the rank of the Drinfeld module. I believe this was a mistake, and instead changed the formula, following Theorem 4.2.7 of [Papikian's book](https://link.springer.com/book/10.1007/978-3-031-19707-9), to $$(-1)^{nr - n - r} \mathrm{N}_{K/\mathbb F_q}(\Delta) p^{n / \mathrm{deg}(p)}.$$ P.S. @DavidAyotte, given that you now work in the industry, please tell us if you still want to be tagged on these Drinfeld module stuff. Same question for you @ymusleh given that you defended your thesis (congratulations!). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [X] I have updated the documentation and checked the documentation preview. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> (Dédicace à ABLCCN) URL: sagemath#38174 Reported by: Antoine Leudière Reviewer(s): Antoine Leudière, David Ayotte, Xavier Caruso
The test is not required :-).
So the most likely is that there is a problem somewhere in the configuration of the container, but not in this PR. |
Not all tests are required?! |
I'm not sure. But some of them are marked |
coverage ci will be fixed by #38687. You may ignore the ci failure here. |
Many thanks for the heads-up! |
🍾 |
+100 |
This pull request implements two new algorithms to compute the characteristic polynomial of the Frobenius endomorphism of a Drinfeld$\mathbb F_q[T]$ -module over a finite field $K$ . Previously, only the algorithms based on crystalline cohomology (see Musleh-Schost 2023) or on Anderson motives (see Caruso-Leudière 2023) were implemented. We propose two new algorithms:
The algorithm based on central simple algebras described in Chapter 4 of Caruso-Leudière 2023.
The algorithm described by Gekeler in Gekeler 1991.
Acknowledgement. This implementation was originally due to @xcaruso (see here), and after a private discussion, I took the liberty of creating this PR.
I also propose to change the formula computed by
frobenius_norm
. Before, it computedwhere$K$ is the ground field, $n$ is the degree of $K$ over $\mathbb F_q$ , and $p$ is the monic generator of the $\mathbb F_q[T]$ -characteristic of $K$ . The docstring claimed this was $(-1)^r$ times the constant coefficient of the characteristic polynomial of the Frobenius endomorphism, $r$ being the rank of the Drinfeld module. I believe this was a mistake, and instead changed the formula, following Theorem 4.2.7 of Papikian's book, to
$$(-1)^{nr - n - r} \mathrm{N}_{K/\mathbb F_q}(\Delta) p^{n / \mathrm{deg}(p)}.$$
P.S. @DavidAyotte, given that you now work in the industry, please tell us if you still want to be tagged on these Drinfeld module stuff. Same question for you @ymusleh given that you defended your thesis (congratulations!).
📝 Checklist
(Dédicace à ABLCCN)