Repository navigation
Guard power series square tests over unsupported rings - #42785
Merged
vbraun merged 1 commit intoSep 29, 2026
Merged
Conversation
|
Documentation preview for this PR (built with commit ce76ea5; changes) is ready! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
((x + 4)^2).is_square()overZmod(16)[[x]]currently returnsFalse. The valuation and leading-coefficient tests assume an integral domain; nilpotent coefficients can invalidate both tests.Raise
NotImplementedErrorfor nonconstant series over non-integral domains before applying either test. Also reject nonconstant series in characteristic 2, where the existing field shortcut incorrectly accepts1 + x. Zero and constant series remain directly decidable through the base ring.This is a conservative restriction of the generic algorithm, including over reduced rings with zero divisors. Regression doctests cover the original example, an even-valuation square with nonsquare leading coefficient over
Zmod(9),Zmod(15), characteristic 2, zero, and constant series.Fixes #41220.
Validation
Rebuilt the Cython extension and passed 1,278 doctests:
src/sage/rings/power_series_ring_element.pyx: 520 testssrc/sage/rings/power_series_poly.pyx: 287 testssrc/sage/rings/laurent_series_ring_element.pyx: 471 testsgit diff --checkalso passed.📝 Checklist
Docstrings are updated; the documentation preview is pending.
⌛ Dependencies
None.