Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/rings/polynomial/polynomial_element.pyx: Use isinstance(...,…
Browse files Browse the repository at this point in the history
… sage.rings.abc.SymbolicRing) instead of ... is SR
  • Loading branch information
Matthias Koeppe committed Oct 20, 2021
1 parent 056b8d4 commit 45aab88
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/sage/rings/polynomial/polynomial_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7656,9 +7656,9 @@ cdef class Polynomial(CommutativeAlgebraElement):
back to pari (numpy will fail if some coefficient is infinite,
for instance).
If L is SR, then the roots will be radical expressions,
computed as the solutions of a symbolic polynomial expression.
At the moment this delegates to
If L is SR (or one of its subrings), then the roots will be radical
expressions, computed as the solutions of a symbolic polynomial
expression. At the moment this delegates to
:meth:`sage.symbolic.expression.Expression.solve`
which in turn uses Maxima to find radical solutions.
Some solutions may be lost in this approach.
Expand Down Expand Up @@ -7932,8 +7932,7 @@ cdef class Polynomial(CommutativeAlgebraElement):
else:
return [rt for (rt, mult) in rts_mult]

from sage.symbolic.ring import SR
if L is SR:
if isinstance(L, sage.rings.abc.SymbolicRing):
if self.degree() == 2:
from sage.functions.other import sqrt
from sage.symbolic.expression import I
Expand All @@ -7953,6 +7952,7 @@ cdef class Polynomial(CommutativeAlgebraElement):
return l
else:
return [val for val,m in l]
from sage.symbolic.ring import SR
vname = 'do_not_use_this_name_in_a_polynomial_coefficient'
var = SR(vname)
expr = self(var)
Expand Down

0 comments on commit 45aab88

Please sign in to comment.