Opened 2 years ago
Last modified 2 years ago
#23946 new enhancement
Exhaust over Weil polynomials
Reported by: | kedlaya | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | sage-8.1 |
Component: | number theory | Keywords: | Weil polynomials, sd91 |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | u/kedlaya/exhaust_over_weil_polynomials (Commits) | Commit: | d12b0ea0aa53cbf558e6ac873414778dd12796a4 |
Dependencies: | #24016 | Stopgaps: |
Description
I have reasonably stable code (mostly in C, depending on FLINT) for exhausting over Weil polynomials:
https://github.com/kedlaya/root-unitary
The goal of this ticket is to incorporate this code into Sage in some fashion.
Change History (8)
comment:1 follow-up: ↓ 2 Changed 2 years ago by
- Dependencies set to #24016
comment:2 in reply to: ↑ 1 Changed 2 years ago by
Replying to kedlaya:
In the meantime, I'd appreciate some feedback about where this might belong in Sage.
First of all, your github repo contains both C code and .sage
files. Are the .sage
files considered to be part of your package or are they really only use cases/examples/tests/documentation?
There are two possibilities, each with its advantages and disadvantages:
(A) Make it an external (presumably optional) package and interface it from Sage.
(B) Make it actually a part of Sage itself.
Advantages of (A) are that you keep control of the package: you can easily change the package at will (with (B) every change would need to go through the Sage Trac) and you don't need to care about Sage coding standards. Also important: with (A) your package could be used without Sage. With (B), there might be more initial work needed to get it into Sage but then it might be less work to maintain.
comment:3 Changed 2 years ago by
I just merged a pull request in from another branch, which has the effect of significantly reconfiguring the file structure. In particular, there are no longer any .sage
files in the main directory; the ones that exist are all in subdirectories and are indeed examples/tests.
The main code base now consists of two .c
files (and their .h
headers) and one .pyx
file. I still don't have any sort of independent build structure set up; moreover, the .pyx
file is more than just a simple wrapper, it is where the parallelism is currently implemented. So at the moment there is really no way to use the code without Sage, and I don't particularly intend to work on making that possible. (Exception: if someone wants to use the code from some other platform like Julia, I'd be willing to cooperate with that.)
comment:4 follow-up: ↓ 5 Changed 2 years ago by
I think that the code is stable enough that we should just add it to Sage. Maybe create a folder sage/rings/polynomial/weil/
and put them in there?
comment:5 in reply to: ↑ 4 ; follow-up: ↓ 6 Changed 2 years ago by
Replying to roed:
I think that the code is stable enough that we should just add it to Sage. Maybe create a folder
sage/rings/polynomial/weil/
and put them in there?
Do you mean put everything in there? Or put the Cython in sage/rings/polynomials/weil_polynomials.pyx
and the C files in sage/rings/polynomial/weil
?
Also, if someone can point me to some guidance about a module to the Sage library (e.g., how to format __init__.py
and all.py
and the like to make the new code discoverable), that would be helpful.
comment:6 in reply to: ↑ 5 Changed 2 years ago by
Replying to kedlaya:
Replying to roed:
I think that the code is stable enough that we should just add it to Sage. Maybe create a folder
sage/rings/polynomial/weil/
and put them in there?Do you mean put everything in there? Or put the Cython in
sage/rings/polynomials/weil_polynomials.pyx
and the C files insage/rings/polynomial/weil
?
I meant putting everything in there. We should also talk about the best way for a user to access these methods; perhaps a method weil_polynomials
on ZZ[x]
and QQ[x]
that returns your iterator?
Also, if someone can point me to some guidance about a module to the Sage library (e.g., how to format
__init__.py
andall.py
and the like to make the new code discoverable), that would be helpful.
See http://doc.sagemath.org/html/en/developer/coding_basics.html#files-and-directory-structure for some details. You'll also need to add lines to src/module_list.py
for each extension module.
comment:7 Changed 2 years ago by
- Branch set to u/kedlaya/exhaust_over_weil_polynomials
comment:8 Changed 2 years ago by
- Commit set to d12b0ea0aa53cbf558e6ac873414778dd12796a4
Status update: I've pushed many recent changes to the branch
repackage_for_sage
of the Github repo. In particular, I have been working to make the call syntax much more transparent; for instance, to compute the Weil polynomials corresponding to abelian varieties of dimensiong
over the finite field of orderq
, one can now use standard Python iterator syntax:Some to-do items: check that all my old test scripts still work; write more tests; add more documentation; add more input sanitization.
In the meantime, I'd appreciate some feedback about where this might belong in Sage.