Skip to content

Refactor generic ideal method + avoid computing principal generator of ideal of PolynomialRing on construction#41425

Draft
user202729 wants to merge 3 commits intosagemath:developfrom
user202729:categories-ring-ideal-refactor
Draft

Refactor generic ideal method + avoid computing principal generator of ideal of PolynomialRing on construction#41425
user202729 wants to merge 3 commits intosagemath:developfrom
user202729:categories-ring-ideal-refactor

Conversation

@user202729
Copy link
Contributor

@user202729 user202729 commented Jan 9, 2026

  • use keyword arguments.
  • delete the special case logic where naive .gcd() is ran for univariate polynomial ring.

Reason:

There's a doctest

K.<a> = QuadraticField(4569)
j = 46969655/32768
E = EllipticCurve(j=K(j))
C = E.isogeny_class()

that now takes very long to run. With this change, the runtime is cut in half. (Finding a single generator for a number field ideal is usually harder than finding a HNF basis of the ideal, and the latter is all pari needs to do relevant computations.)

Note: this is kind of a breaking change, in that ZZ.ideal(1, 2, 3).gens() will now return (1, 2, 3). I think it is preferable (users who want reduced generators can run gens_reduced).

Indeed, some tests break https://github.com/sagemath/sage/actions/runs/20863923668/job/59950182623 --- but ideally they should be refactored to avoid relying specifically on this behavior.

📝 Checklist

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

⌛ Dependencies

@user202729 user202729 changed the title Refactor generic ideal method Refactor generic ideal method + avoid computing principal generator of ideal of number field on construction Jan 9, 2026
@github-actions
Copy link

github-actions bot commented Jan 9, 2026

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

@user202729 user202729 changed the title Refactor generic ideal method + avoid computing principal generator of ideal of number field on construction Refactor generic ideal method + avoid computing principal generator of ideal of PolynomialRing on construction Jan 9, 2026
@user202729 user202729 marked this pull request as draft January 10, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant