Skip to content
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

Bug in any_root introduced in #37170 #37445

Closed
2 tasks done
grhkm21 opened this issue Feb 24, 2024 · 0 comments · Fixed by #37443
Closed
2 tasks done

Bug in any_root introduced in #37170 #37445

grhkm21 opened this issue Feb 24, 2024 · 0 comments · Fixed by #37443

Comments

@grhkm21
Copy link
Contributor

grhkm21 commented Feb 24, 2024

Steps To Reproduce

The trace computation in the helper method _cantor_zassenhaus_split_to_irreducible introduced by #37170 is implemented incorrectly. More specifically, these lines at https://github.com/sagemath/sage/blob/develop/src/sage/rings/polynomial/polynomial_element.pyx#L2176-L2177

            if q % 2:
                h = self.gcd(pow(T, (q-1)//2, self) - 1)

should be

            if q % 2:
                h = self.gcd(pow(T, (q**degree-1)//2, self) - 1)

Proof:

sage: R.<x> = GF(13)[]
....: def irr(d, R): return f.monic() if (f := R.random_element(d)).is_irreducible() else irr(d, R)
....: f = prod(irr(6, R) for _ in range(10))
....: f.factor()[0][0].degree()
....: f.any_root(degree=6) # errors

Expected Behavior

don't error

Actual Behavior

error

Additional Information

We have a fix already

Environment

Latest `develop` branch

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants