-
-
Notifications
You must be signed in to change notification settings - Fork 711
Implement is_square for LaurentSeries #41240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
It would be great to harmonize with lazy Laurent series. |
done |
tscrim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally do not have periods/full-stops at the end of input blocks. Once changed, I will set a positive review.
Co-authored-by: Travis Scrimshaw <[email protected]>
Co-authored-by: Travis Scrimshaw <[email protected]>
|
Okay, LGTM. (Mostly for @mantepse) At some point, we probably should figure out a way to combine stuff for both classes; perhaps some kind of mixin class. |
Description
This PR implements the missing
is_square()method forLaurentSeriesandLazyLaurentSerieselements. Previously, calling.is_square()on these series would raise anAttributeError.The implementation follows the mathematical definition: a Laurent series$f = t^v \cdot u$ is a square if and only if:
PowerSeriesRingor base ring).Changes:
is_squareby checking the valuation and delegating the unit check to the underlyingPowerSerieslogic.is_squareto harmonize functionality, ensuring it handles unit shifts correctly before delegating to the lazysqrt()method.Both implementations support the
root=Trueargument to return the square root when it exists.Fixes
#41221