#14239: symbolic radical expression for algebraic number
-------------------------------------+-------------------------------------
       Reporter:  gagern             |        Owner:  davidloeffler
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.4
      Component:  number fields      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Martin von Gagern  |    Reviewers:  Marc Mezzarobba
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/gagern/ticket/14239              |  d2f72c655cc22f18c9029da5feff12f35eb0dbf8
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by gagern):

 Replying to [comment:31 jdemeyer]:
 > I dislike
 > {{{
 > # Adapted from NumberFieldElement._symbolic_()
 > }}}
 >
 > If two implementations do the same thing, there should be a common
 function...

 They don't do the ''same'' thing. Please read my comment:26. Looking at
 the code, the common functionality is essentially two and a half lines:

 {{{
 #!python
 poly = self.minpoly()
 var = SR(poly.variable_name())
 for soln in SR(poly).solve(var, …
 }}}

 Where I pass `explicit_solutions=True`, number field elements pass
 `to_poly_solve=True`. Where they collect all roots and do a closest root
 matching in a 53 bit ambient field, I only collect roots which fall into
 our separating interval and hope (but don't require) that only one of the
 roots found does that. Where they give up in cases where not all solutions
 were found, I try each found solution to check whether it's the one I
 need. I do the same verification if I got more than one root into my
 isolating interval, contrary to my hope stated above.

 It could well be that although the two implementations don't do the same
 thing ''at the moment'', they ''should'' do the same thing because what's
 right in one case is right in the other as well. In that case, I could
 adjust my code to encompass the number field case as well. The
 verification of roots in cases where more than one is found would have to
 happen in `QQbar` but it shouldn't hurt to do that step in `QQbar` in any
 case.

 I haven't yet figured out how to obtain an isolating interval for a number
 field element. And where would you suggest to place such a function, if I
 were to write it? Which module is most suitable for this?

 My main concern is that I put in this extra work and then eventually
 someone gives me a negative review because it modifies established
 behavior of the numeric element implementation. Or because there is a good
 reason for things to be done differently there which I hadn't thought of
 before.

 Would you give the current commit a conditional positive review? Would you
 say that if combining the code turns out to be impossible for some reason,
 then we can go back to the current code and merge that?

--
Ticket URL: <http://trac.sagemath.org/ticket/14239#comment:32>
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