Opened 3 years ago
Closed 3 years ago
#28395 closed defect (fixed)
Bug in is_weil_polynomial
Reported by: | kedlaya | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.9 |
Component: | algebra | Keywords: | Weil polynomial |
Cc: | Merged in: | ||
Authors: | Kiran Kedlaya | Reviewers: | Frédéric Chapoton |
Report Upstream: | N/A | Work issues: | |
Branch: | 92a22f5 (Commits, GitHub, GitLab) | Commit: | 92a22f5d52dd25f82d1f5ac51809c50b99edca8a |
Dependencies: | Stopgaps: |
Description
This is a bug:
sage: P.<t> = QQ[] sage: u = t^10 + 4*t^9 + 8*t^8 + 18*t^7 + 81*t^6 + 272*t^5 + 567*t^4 + 882*t^3 + 2744*t^2 + 9604*t + 16807 sage: [abs(x[0])^2 for x in u.roots(CC)] [7.00000000000000, 7.00000000000000, 7.00000000000000, 7.00000000000000, 7.00000000000000, 7.00000000000000, 7.00000000000000, 7.00000000000000, 7.00000000000000, 7.00000000000000] sage: u.is_weil_polynomial() # Should return True False
Change History (5)
comment:1 Changed 3 years ago by
- Branch set to u/kedlaya/bug_in_is_weil_polynomial
comment:2 Changed 3 years ago by
- Commit set to 92a22f5d52dd25f82d1f5ac51809c50b99edca8a
- Status changed from new to needs_review
comment:3 Changed 3 years ago by
comment:4 Changed 3 years ago by
- Reviewers set to Frédéric Chapoton
- Status changed from needs_review to positive_review
ok, looks good. Thanks a lot.
comment:5 Changed 3 years ago by
- Branch changed from u/kedlaya/bug_in_is_weil_polynomial to 92a22f5d52dd25f82d1f5ac51809c50b99edca8a
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
The underlying bug is in
trace_polynomial
:The code is currently accessing the leading coefficient without checking the degree; the corner case that triggers this bug is when the expected "leading" coefficient is zero, and so the wrong coefficient is accessed instead.
New commits:
Fix bug in trace_polynomial
Fix bug in trace_polynomial