Skip to content

Added alias to_integer for lift - #42811

Merged
vbraun merged 5 commits into
sagemath:developfrom
ArixEggink:finiterings
Sep 29, 2026
Merged

vbraun merged 5 commits into
sagemath:developfrom
ArixEggink:finiterings

Conversation

@ArixEggink

@ArixEggink ArixEggink commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #42799 .
I added under the _integer_ alias for lift() also the alias to_integer().
Finite fields of prime order are integer mod n objects in Sage. This caused the function to_integer() of finite fields to fail on fields of prime order.
Adding to_integer() as an alias for lift (which makes sense in all $$\mathbb{Z}/n\mathbb{Z}$$ rings) solves the problem, since the behaviour of to_integer() on finite fields of prime order should be the same as that of lift.

(Since it is an alias, tests did not seem to be relevant, but I like to hear if that is not true.)

📝 Checklist

  • [ x] The title is concise and informative.
  • [ x] 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 and checked the documentation preview.

⌛ Dependencies

no dependencies

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Documentation preview for this PR (built with commit 5bd2e69; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@ArixEggink

Copy link
Copy Markdown
Contributor Author

I have checked the documentation in the latest commit in the pdf version. I'm not sure why the html-version doesn't work, but it failed on "downloading old doc".
The documentation is I think oke. It only does not have a nice clickable link to the function .lift() . When I tried to add that I got the errors, which is probably because .lift() is not defined in the class of to_integer but in all the three subclasses. (It is also not a function on the page of the reference manual where to_integer appears.)

@vincentmacri

Copy link
Copy Markdown
Member

Solves issue #42799

Can you edit this to use the wording "Fixes #42799" so that GitHub will link this PR to the issue and close the issue when this PR is merged?

(Since it is an alias, tests did not seem to be relevant, but I like to hear if that is not true.)

Detailed tests definitely are not needed. You could have one test just to make sure the alias works, but I'm fine with it either way.

@vincentmacri

Copy link
Copy Markdown
Member

Doc build failure is odd, I think it's spurious and should hopefully go away in the next run.

Co-authored-by: Vincent Macri <vincent.macri@ucalgary.ca>
@vincentmacri

Copy link
Copy Markdown
Member

Looks good to me! Just a heads up, since we're now on release candidates for 10.10 it might be some time before this gets merged into develop as I think we only merge critical fixes at this point of a release cycle. I expect this will get merged in for the first 10.11 beta release. In the meantime, just keep an eye on this branch and resolve any merge conflicts if they arise (i.e. if GitHub stops saying "Changes can be cleanly merged").

@vbraun
vbraun merged commit 831df5c into sagemath:develop Sep 29, 2026
25 checks passed
@ArixEggink
ArixEggink deleted the finiterings branch September 30, 2026 14:59
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.

Make to_integer() an alias for lift()

3 participants