#16651: Buggy to_poly_solve option
---------------------------------+------------------------
       Reporter:  gagern         |        Owner:
           Type:  defect         |       Status:  new
       Priority:  critical       |    Milestone:  sage-6.3
      Component:  number fields  |   Resolution:
       Keywords:                 |    Merged in:
        Authors:                 |    Reviewers:
Report Upstream:  N/A            |  Work issues:
         Branch:                 |       Commit:
   Dependencies:                 |     Stopgaps:
---------------------------------+------------------------
Description changed by vbraun:

Old description:

> I noticed this in comment:18:ticket:14239.
>
> {{{
> sage: poly = QQ[x](x^7 - x - 1)
> sage: root = sorted(poly.roots(QQbar, False), key=imag)[0]
> sage: root
> -0.3636235193291805? - 0.9525611952610331?*I
> sage: nf = NumberField(poly, "y", embedding=CC(root))
> sage: z = SR(nf.gen()); z
> -3775/3963*I - 2573/7076
> sage: poly(QQbar(z)).is_zero()
> False
> }}}
>
> The problem here for me as a user is the fact that when I see rational
> numbers in some expression, I expect them to be accurate. But the
> conversion to SR here uses `solve(to_poly_solve=True)`, which according
> to its documentation may yield approximate solutions. I'm still surprised
> that these approximate solutions may take the form of elements from ℚ[I].
> I guess some code further down the line might get confused as well, since
> these conversions look as if they were exact.

New description:

 The `SR.solve(..., to_poly_solve=True)` option does weird things:
 {{{
 sage: (x^7-x-1).solve(x, to_poly_solve=True)
 [x == 1.11277569705, x == (0.617093477784 - 0.900864951949*I), x ==
 (-0.809857800594 + 0.262869645851*I), x == (-0.363623519329 +
 0.952561195261*I), x == (-240/913*I - 4157/5133), x == (-3775/3963*I -
 2573/7076), x == (1354/1503*I + 2000/3241)]
 }}}
 Note that none of the solutions are actually Gaussian rationals. Maxima
 gives correct output:
 {{{
 maxima: load(to_poly_solve)$
 Loadingmaxima-grobner$Revision:1.6$$Date:2009-06-0207:49:49$
 maxima: to_poly_solve(x^7-x-1 = 0, x);
 
%union([x=1.11277569704536],[x=-0.9525611952610316*%i-0.36362351932918313],[x=0.6170934777839656-0.9008649519489099*%i],[x=-0.2628696458512362*%i-0.8098578005941353],[x=0.2628696458512362*%i-0.8098578005941353],[x=0.9008649519489099*%i+0.6170934777839656],[x=0.9525611952610316*%i-0.36362351932918313])
 }}}
 But our parsing of the output is totally off, starting at an iteration
 over the output list while modifying the output list.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/16651#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to