Skip to content

Conversation

SoongNoonien
Copy link
Collaborator

While reading a question by @lkastner on Slack I saw this polynomial ring construction:

julia> K = algebraic_closure(QQ)
Algebraic closure of rational field

julia> Kx, xx = K[:x]
(Univariate polynomial ring in x over QQBar, x)

julia> Kxy, yy = Kx[:y]
(Univariate polynomial ring in y over Kx, y)

And I thought that this should be a little more convenient like this:

julia> R, (x,y) = QQ[:x][:y]
(Univariate polynomial ring in y over univariate polynomial ring, AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{Rational{BigInt}}}[x, y])

QQ[:x][:y] existed before this PR but it returned only the polynomial ring in y and the variable y itself. I've extended this idea to support all combinations of nested univariate and multivariate polynomial rings. While at it, I also noticed that we allow R[:x,:y] for non-commutative rings R even though there is no implementation of multivariate polynomial rings over non-commutative rings. (One can argue what this should even mean, I'd rather expect R[:x,:y] to be the free algebra on $x$ and $y$ over R.) Simply removing this method would cause QQ[:x] to create a multivariate polynomial ring in just one variable. So, I made the multivariate shorthand construction more explicit, such that at least two variables are needed for multivariate polynomial rings. If desired I can separate this change into another PR.

Copy link

codecov bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.95%. Comparing base (2980528) to head (7bc479c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2191   +/-   ##
=======================================
  Coverage   87.95%   87.95%           
=======================================
  Files         127      127           
  Lines       31791    31805   +14     
=======================================
+ Hits        27961    27975   +14     
  Misses       3830     3830           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant