Skip to content
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

Adding generic change_ring() method and some other touchups. #36472

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

tscrim
Copy link
Collaborator

@tscrim tscrim commented Oct 17, 2023

We implement a generic change_ring() method.

That there is no such method was noticed in #36368.

We also do some other minor touchups: Use _repr_ instead of __repr__ and

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@tscrim
Copy link
Collaborator Author

tscrim commented Oct 17, 2023

@roed314 This branch causes the following p-adic test to have a very long loop of changing ideals:

sage: W = Zp(3,10)
sage: S.<x> = W[]
sage: R.<pi> = W.extension(x^2 + 3)
sage: R.residue_field()(pi) == pi

I've spent the past 2 hours trying to figure it out, but I still don't understand what is going on. This is as small of an example as I was able to devise from the failing padic doctests. Even once the check figures out how it should be done, it creates a number of 0 elements in performing the check as opposed to before this branch. Any idea about what is going on here?

@tscrim
Copy link
Collaborator Author

tscrim commented Oct 17, 2023

Before:

sage: W = Zp(3,10)
sage: S.<x> = W[]
sage: R.<pi> = W.extension(x^2 + 3)
sage: R.residue_field()(pi) == pi
False

With the PR:

sage: W = Zp(3,10)
sage: S.<x> = W[]
sage: R.<pi> = W.extension(x^2 + 3)
sage: R.residue_field()(pi) == pi
True

With PR in a fresh session:

sage: W = Zp(3,10)
sage: S.<x> = W[]
sage: R.<pi> = W.extension(x^2 + 3)
sage: R(pi, absprec=20)
pi + O(pi^20)
sage: R(pi^3, absprec=20)
---------------------------------------------------------------------------
RecursionError                            Traceback (most recent call last)
[very long traceback]
RecursionError: maximum recursion depth exceeded while calling a Python object
sage: R(pi^3, absprec=20)
pi^3 + O(pi^20)
sage: R.residue_field()(pi) == pi
False

@roed314
Copy link
Contributor

roed314 commented Oct 23, 2023

I'll try to take a look at this soon.

@tscrim
Copy link
Collaborator Author

tscrim commented Oct 24, 2023

Thanks. I have no idea whatsoever what is going wrong with this change. Any thoughts/pointers/help would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants