Opened 4 years ago

Closed 2 years ago

#23639 closed defect (fixed)

Strange errors with roots() of polynomials over polynomial rings

Reported by: mmezzarobba Owned by:
Priority: minor Milestone: sage-8.9
Component: algebra Keywords:
Cc: bruno Merged in:
Authors: Bruno Grenet Reviewers: Vincent Delecroix
Report Upstream: N/A Work issues:
Branch: 3bdb49c (Commits, GitHub, GitLab) Commit: 3bdb49c8b02d14c01c9e92a95e4a2d52d2e9f1d7
Dependencies: Stopgaps:

Status badges

Description (last modified by mmezzarobba)

sage: pol = GF(3)['x']['y'].one()
sage: pol.roots()
...
TypeError: unable to coerce <class 'sage.rings.polynomial.ideal.Ideal_1poly_field'> to an integer
sage: pol.roots(multiplicities=False)
...
ValueError: max() arg is an empty sequence
sage: foo = QQ['k']['n'].one()
sage: foo.roots(QQ)
...
TypeError: base_ring True must be a ring

Change History (8)

comment:1 Changed 4 years ago by mmezzarobba

  • Description modified (diff)
  • Summary changed from Strange errors with roots() of polynomials over polynomial rings over finite fields to Strange errors with roots() of polynomials over polynomial rings

comment:2 Changed 2 years ago by bruno

  • Authors set to Bruno Grenet
  • Branch set to u/bruno/23639_strange_errors_with_roots
  • Milestone changed from sage-8.1 to sage-8.9
  • Status changed from new to needs_review

Bugs fixed. In order of appearance in the description:

  1. Does not appear in version 8.9b7
  2. Fixed by introducing special cases for constant and null polynomials
  3. The call p.roots(...) at line 1755 of src/sage/rings/polynomial/polynomial_ring.py had problematic parameters

comment:3 Changed 2 years ago by git

  • Commit set to a4ca66e06a54740225ffb45230c1b4574554f7fa

Branch pushed to git repo; I updated commit sha1. New commits:

1e86b8223629: Fix parameters in call to p.roots(...)
a4ca66e23639: Fix case of constant and null polynomials

comment:4 Changed 2 years ago by vdelecroix

  • Reviewers set to Vincent Delecroix
  • Status changed from needs_review to needs_work

Please doctest the error

+            if l < 0:
+                raise ArithmeticError("roots of 0 are not defined")

comment:5 Changed 2 years ago by git

  • Commit changed from a4ca66e06a54740225ffb45230c1b4574554f7fa to 3bdb49c8b02d14c01c9e92a95e4a2d52d2e9f1d7

Branch pushed to git repo; I updated commit sha1. New commits:

3bdb49c23639: Doctest null polynomial

comment:6 Changed 2 years ago by bruno

  • Status changed from needs_work to needs_review

comment:7 Changed 2 years ago by vdelecroix

  • Status changed from needs_review to positive_review

comment:8 Changed 2 years ago by vbraun

  • Branch changed from u/bruno/23639_strange_errors_with_roots to 3bdb49c8b02d14c01c9e92a95e4a2d52d2e9f1d7
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.