Skip to content

Conversation

@cxzhong
Copy link
Contributor

@cxzhong cxzhong commented Dec 15, 2025

Add Chinese Remainder Theorem support for checking squares in power series over squarefree moduli.
Fix #41220 And return a NotImplement for prime power case

📝 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

#41239

Add Chinese Remainder Theorem support for checking squares in power series over squarefree moduli.
@github-actions
Copy link

github-actions bot commented Dec 15, 2025

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

@user202729
Copy link
Contributor

user202729 commented Dec 15, 2025

Use \Zmod LaTeX macro.

Is there any test that previously fail but succeed with this pull request?

@cxzhong
Copy link
Contributor Author

cxzhong commented Dec 15, 2025

Use \Zmod LaTeX macro.

Is there any test that previously fail but succeed with this pull request?

I think maybe for prime power, we need to use Hensel lift to compute. and for 2^n, the situation is complexity.
So I do not try to implement it.
I wrote a case

sage: R.<x> = PowerSeriesRing(Zmod(8))
sage: ((x + 1)^2).is_square()
Traceback (most recent call last):
...
NotImplementedError: is_square() not implemented for power series over Zmod(p^k) with k > 1

@user202729
Copy link
Contributor

So the only change is the additional check instead of return wrong answer?

I'd rather modifying the generic method to check that the ring has zero nilradical. (The only case where (f^2).valuation() is odd is that f[f.valuation()]^2 = 0.) (caveat: #41222. One easy way to get ZZ.nilradical() to work is to make ZZ(0).radical() == 0, which looks like the consensus is +2/-0 right now, so should be good)

Change radical(0) to return 0 instead of raising an error.
Updated the radical method to return 0 for input 0 instead of raising an error.
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.

is_square of power series ring fails for rings with zero divisors

2 participants