You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues for a bug report that matches the one I want to file, without success.
Did you read the documentation and troubleshoot guide?
I have read the documentation and troubleshoot guide
Environment
-**OS**: Debian 12.0
-**Sage Version**: 10.0
Steps To Reproduce
The method "is_square" for finding square roots of (Laurent) polynomials has a subtle bug.
sage: R.<v> = LaurentPolynomialRing(ZZ)
sage: x = is_square(v^2, root=True)[1]
sage: x, x + v^-1
Expected Behavior
We expect x, x + v^-1 to evaluate to (v, v^-1 + v).
Actual Behavior
Instead, we get (v, 5*v^-1).
Additional Information
There is similar behavior when the coefficients are rational or real.
The problem seems to be that is_square for polynomial rings does not always coerce square roots into the correct parent. For example,
sage: S.<x> = PolynomialRing(ZZ)
sage: is_square(S(1), True)[1].parent()
Integer Ring
These square roots come from factorizations/squarefree decompositions of the polynomial in which the unit is explicitly declared to be a member of the base ring. If the square root of the unit doesn't get multiplied by anything polynomial, the resulting square root remains in the base ring.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Did you read the documentation and troubleshoot guide?
Environment
Steps To Reproduce
The method "is_square" for finding square roots of (Laurent) polynomials has a subtle bug.
Expected Behavior
We expect
x, x + v^-1
to evaluate to(v, v^-1 + v)
.Actual Behavior
Instead, we get
(v, 5*v^-1)
.Additional Information
There is similar behavior when the coefficients are rational or real.
The problem seems to be that
is_square
for polynomial rings does not always coerce square roots into the correct parent. For example,These square roots come from factorizations/squarefree decompositions of the polynomial in which the unit is explicitly declared to be a member of the base ring. If the square root of the unit doesn't get multiplied by anything polynomial, the resulting square root remains in the base ring.
The text was updated successfully, but these errors were encountered: