-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Change behavior of the % operator for p-adic integral elements #21994
Comments
comment:1
Is there some code available somewhere? |
comment:2
I don't think I have any code for this. |
Changed keywords from none to padicIMA |
Branch: u/roed/quo_rem_revision |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Commit: |
Reviewer: Xavier Caruso |
Author: David Roe |
comment:6
All tests pass, but should still wait for remainder of patchbot report. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed branch from u/roed/quo_rem_revision to u/caruso/quo_rem_revision |
Changed branch from u/caruso/quo_rem_revision to u/roed/quo_rem_revision |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
I think that the variables |
comment:16
Patchbot is happy. I give a positive review to this ticket. |
Changed branch from u/roed/quo_rem_revision to |
In
padic_generic_element.pyx
, the documentation for_mod_
describes two options for implementinga%b
anda//b
.(2) If
b = pi^k
, the series expansion (in terms ofpi
) ofa//b
is just the series expansion ofa
, shifted over byk
terms.(2') The series expansion of
a % pi^k
has no terms abovepi^(k-1)
.The conditions (2) and (2') are equivalent. But when we generalize these conditions to arbitrary
b
they diverge.(3) For general
b
, the series expansion ofa//b
is just the series expansion ofa/b
, truncating terms with negative exponents ofpi
.(4) For general
b
, the series expansion ofa%b
has no terms aboveb.valuation() - 1
.In order to satisfy (3), one defines
In order to satisfy (4), one defines
Currently, Sage implements option (3). The justification given is that "it is more easily defined in terms of shifting and thus generalizes more easily to extension rings."
On the other hand, (4) behaves better in terms of precision: the remainder in the definition (4) is always known with the maximal precision (and actually to infinite precision) while in (3) we are loosing precision for the quotient and the remainder at the same
time.
On a related note, when using definition (4), if
u
has valuation 0 thenThere is no corresponding simple relations if we are using definition (3).
In this ticket, we implement behavior (4) as an option and provide deprecation messages for behavior (3).
CC: @xcaruso @saraedum
Component: padics
Keywords: padicIMA
Author: David Roe
Branch/Commit:
162b44d
Reviewer: Xavier Caruso
Issue created by migration from https://trac.sagemath.org/ticket/21994
The text was updated successfully, but these errors were encountered: