#20074: QQbar cleaning 2
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.1
      Component:  number fields      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/20074                 |  66b22b5e512916c0d3f6cfb32cfc1603bb6b1980
   Dependencies:  #19954             |     Stopgaps:
-------------------------------------+-------------------------------------
Description changed by vdelecroix:

Old description:

> We further simplify QQbar code by:
> - using python operator to indentify binary operators instead of strings.
> In other words we replace `'+'` by `operator.add`, `'-'` by
> `operator.sub`, etc
> - writing only one function `binop` instead of `addsub` and `muldiv`.
> - removing the method `kind` of descriptors and instead use the class
> themselves for dispatching
> - detect unions earlier in the code to avoid constructing `ANBinaryExpr`
>
> As a consequence, we have exactification detected earlier
> {{{
> sage: sqrt17 = QQbar(17).sqrt()
> sage: sqrt19 = QQbar(19).sqrt()
> sage: (sqrt17 + sqrt19).exactify()
> sage: sqrt17 * sqrt19 + sqrt17 - sqrt19 * sqrt17 - sqrt17
> 0
> }}}
> Instead of `0.?e-17` on the current beta.
>
> follow up: #19955

New description:

 We further simplify QQbar code by:
 - using python operator to indentify binary operators instead of strings.
 In other words we replace `'+'` by `operator.add`, `'-'` by
 `operator.sub`, etc
 - writing only one function `binop` instead of `addsub` and `muldiv`.
 - removing the methods `kind`,  `is_exact`, `is_rational`,
 `is_field_element` of descriptors and instead use the class themselves
 - removing the method `rational_value` and directly access the `_value`
 attribute
 - detect unions earlier in the code to avoid constructing `ANBinaryExpr`

 As a consequence of the last items, we have exactification detected
 earlier
 {{{
 sage: sqrt17 = QQbar(17).sqrt()
 sage: sqrt19 = QQbar(19).sqrt()
 sage: (sqrt17 + sqrt19).exactify()
 sage: sqrt17 * sqrt19 + sqrt17 - sqrt19 * sqrt17 - sqrt17
 0
 }}}
 Instead of `0.?e-17` on the current beta. See also the better output in
 doctests from the commit `012ae18`.

 follow up: #19955

--

--
Ticket URL: <http://trac.sagemath.org/ticket/20074#comment:5>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to