Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-35334: Improvements to squarefree_decomposition() for finite fields.
<!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> ### 📚 Description We make some optimizations to the computation of `squarefree_decomposition()` for polynomials over finite fields. This is a followup to #35323. We make improvements by only getting the parent of `T0` once and manually keep track of its degree. The current branch ```python sage: x = GF(4)["x"].gen() sage: p = x^2 + 1 sage: %timeit p.squarefree_decomposition() 140 µs ± 22.1 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each) ``` versus with #35323: ```python 168 µs ± 5.28 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each) ``` versus 10.0.beta5: ```python 158 µs ± 6.74 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each) ``` <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If it resolves an open issue, please link to the issue here. For example "Closes #1337" --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [x] I have linked an issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies - #35323 Based on this change and needs to avoid conflicts. URL: #35334 Reported by: Travis Scrimshaw Reviewer(s): Rémy Oudompheng
- Loading branch information