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
gh-37174: fixed bug in `is_linearly_dependent()`, returns true for linearly dependent univariate polynomial.
`is_linearly_dependent()` returned wrong results for the univariate
polynomial ring because the `coefficients()` method of univariate
polynomials returns coefficients in the opposite order of `monomials()`:
```
sage: R.<q> = QQ[]
sage: p = q^4 + 3*q + 5
sage: p.monomials()
[q^4, q, 1]
sage: p.coefficients()
[5, 3, 1]
```
We fix this by making the `coefficient_matrix()` method to check for
univariate polynomial ring and make the order consistent.
Fixes: #37075
### 📝 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! -->
<!-- Feel free to remove irrelevant items. -->
- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.
URL: #37174
Reported by: Aman Moon
Reviewer(s): Travis Scrimshaw
0 commit comments