-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Improve Selmer Group method for number fields #31345
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
Thanks for tidying up the description. What do you think about the name of the new method? Preferable -- at least in the end -- would be to rename the current method called Meanwhile what I will do is this: I'll change the method selmer_group to generators, at the same time adding the line selmer_group = selmer_generators in the number field class and changing all uses to this method within Sage source code to use the new name; I will call my new method selmer_space. Then at some future point we can possibly make selmer_group the same as selmer_space instead of selmer_generators. |
comment:3
The main new code is in a new file selmer_group.py, with interface via new methods selmer_space for both number fields and the rational field. Towards the backwards compatibility, here is what I did: I changed the name of the existing method selmer_group (in those two places and in polynomial_quotient_ring) to selmer_generators, but also for compatibility added an alias in all three places so that the method selmer_group still works. In a small number of places where the old selmer_group method was used I changed it to selmer_generators. I think there will be a couple of follow-up tickets to sort out things I spotted but which I did not want to complicate this ticket with. (1) Where the selmer_generators method is used in (elliptic curve) gal_rep_number_field, it is possible that the loop should be through all nontrivial elements of the selmer group, not just the generators. (2) In the etale algebra code in polynomial_quotient_ring, written (I think) ages ago by Robert Miller, there should be a non-hidden method to compute the decomposition as a sum of number fields, which does not refer to any set S of primes; and the hidden function which does this now looks rather inefficiently coded as well as probably being incorrect (at one point it computes an isomorphism from a field D_abs to itself but I think it means to compute one from D to D_abs or vice versa). Those two issues are best dealt with after this is merged. I do have some application of my own waiting in the wings which will use this new improved Selmer group. New commits:
|
Commit: |
Branch: u/cremona/31345 |
comment:4
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
Reviewer: David Roe |
comment:5
Overall it looks good. As a followup ticket, it shouldn't be too hard to make things work for
|
comment:6
Thanks a lot for the review (at last!). I will deal with the issues you raise. |
comment:7
Replying to @roed314:
Not yet fixed. Currently I just use assignment selmer_group = selmer_group_generators and to implement this suggestion I think it would have to be a genuine separate method with full docstring, which I have not yet done.
Unfortunately emacs python-mode disagrees so I always have to fix these manually and often miss some. I think I have fixed them now.
Oops, I left in what I had from when it was a separate piece of my own code. I copied from number_field.py (changing name).
It's an internal function, so no -- but I put in I.abs() for the case where I is an integer rather than an ideal. But this is an internal function so does not do checking of its input. I have also added an underscore prefix to the function name, and also for the two coords_in functions.
Thanks for catching that, I have put in tthe second part of the test for being p-torsion, which also ensures that the division is exact. This should not matter in practice since the function will only be called with ideals whose p'th power is principal, but it is still good to check properly.
Check added.
Fixed
Fixed
Fixed. OK, I have fixed all but the deprecation, which I will come back to after building the documentation to check on all the docstrings. |
comment:9
I have still not addressed teh deprecation question, but all else should be fixed. |
comment:10
one trivial failing doctest in src/sage/rings/rational_field.py |
comment:11
Replying to @fchapoton:
Sorry to be dim, but I see that error but don't know why it is occurring: it complains that there is an extra before the ValueError message. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:13
OK, fixed. (The BLANKLINE distracted me from the actual error, which was just that I had corrected the grammar in the error message.) |
comment:14
For the deprecation, I'd suggest just using Otherwise, it looks good! |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:16
I added deprecation aliases in both places, and also fixed the docstring formatting issue raised (and one other I found). The deprecation aliases seem to work as expected, in tha if you call QQ.selmer_group() or K.selmer_group() for a number field K, then it outputs a message asking the user to use selmer_generators() instead, before calling selmer_generators(). It is not perfect, since it does not also recommend that the user might want to use selmer_space() instead for extra functionality -- I don't think that the deprecation alias machinery can handle that -- and also, I noticed that the deprecation warning appears every time you call the deprecated method, not just the first time. But neither of these should hold up this enhancement. |
comment:17
Perhaps I could also add a separate deprecation warning to the selmer_generators() method too, when it is called with a prime, alerting the user to the selmer_space() method which gives more functionality? |
comment:18
I don't think we need to use a deprecation warning on |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:20
Replying to @roed314:
OK, I removed the additional deprecation warnings introduced, converted the NOTE block cross-referencing to selmer_space into a SEEALSO block, and added a similar SEEALSO block for the RationalField case. I hope this can finally be given a green light now! |
comment:21
doc does not build, because the seealso block is not correctly indented. |
comment:22
Replying to @fchapoton:
Dammit I already spent time fixing that exact issue and thought I had. I'll get back onto it. |
comment:23
Please tell me why the SEEALSO block in rational_field.py is OK but the one in number_field.py is not, since they are indented the same way as far as I can see. |
comment:24
both are wrong, I think |
comment:25
Replying to @fchapoton:
Fixed. I think. I'm sure this is the indentation I put in originally, then I saw an error message and changed it. This sort of error is extremely tedious to fix since the error message is insufficient and it takes 5-10 minutes for each "make" even if you only touch one file. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:27
looks good now I agree that the error message is sometimes not so clear Note that |
comment:28
green bot. I will let David give the final word. |
comment:29
Looks good to me! |
Changed branch from u/cremona/31345 to |
, sagemath#24483, sagemath#24371, sagemath#24511, sagemath#25848, sagemath#26105, sagemath#28481, sagemath#29010, sagemath#29412, sagemath#30332, sagemath#30372, sagemath#31345, sagemath#32375, sagemath#32606, sagemath#32610, sagemath#32612, sagemath#32641, sagemath#32660, sagemath#32750, sagemath#32869, sagemath#33602 <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36307 Reported by: Matthias Köppe Reviewer(s):
If
K
is a number field andS
a finite set of primes ofK
, then for anym > 1
there is a finite multiplicative abelian group of exponent at mostm
called them
-Selmer group, denotedK(S, m)
, a subgroup ofK<sup>*/(K</sup>*)^m
.The existing method
K.selmer_group(m)
returns a list of elements ofK^*
which generateK(S, m)
, with no access to the group structure. There is also a utility methodK.selmer_group_iterator(m)
which I wrote ages ago to make it easy to iterate through all the elements of the group. There is no method to determine whether a given element ofK^*
represents an element ofK(S, m)
and if so express it in terms of the generators.For many applications of mine I have needed something better, and for
m = p
prime I have code for a functionpSelmerGroup(K, S, p)
which returns a quadruple(KSp, KSp_gens, from_KSp, to_KS_p)
whereKSp
is an abstract vector space overGF(p)
,KSp_gens
is a set of elements ofK^*
which generateK(S, p)
(similar toK.selmer_group(S, p)
),from_KSp
is a map from the abstractKSp
toK^*
(the easy one) andto_KSp
is the harder map from a subset ofK^*
to the vector space.Together with some utilities this is about 560 lines of code, with docstrings but no doctest yet. I intend to add this to Sage.
There are two issues: (1) it would make sense to have
K.selmer_group(S, p)
return the quadruple as above, but this would not be backwards compatible; (2) the new functionality is only for primep
, not generalm
. I have no plans for a general version, giving a finite abelian group rather than a vector space, though for elliptic curve applications the casesm = 4
,m = 6
,m = 12
are all useful. There's a version of the Chinese Remainder Theorem at play here som = 6
is easy usingm = 2
andm = 3
, andm = 12
is easy givenm = 3
andm = 4
, whilem = 4
requires real work. I implemented these cases some time ago in Magma, where I also implemented the prime case, so it is possible.I am not sure how to solve the backwards compatibility issue. Places in Sage itself will be easy to handle (there are not many), but to avoid breaking user code will be harder unless I use a new name for the new method, perhaps
K.selmer_space(S, p)
, though "Selmer space" is not standard terminology. I'll think of something by the time I have a patch ready for review.Component: number fields
Author: John Cremona
Branch/Commit:
257a47d
Reviewer: David Roe
Issue created by migration from https://trac.sagemath.org/ticket/31345
The text was updated successfully, but these errors were encountered: