#14630: Add `simplify_real` method to symbolic expressions
------------------------------------+---------------------------------------
       Reporter:  mjo               |         Owner:  burcin      
           Type:  enhancement       |        Status:  needs_review
       Priority:  major             |     Milestone:  sage-5.10   
      Component:  symbolics         |    Resolution:              
       Keywords:                    |   Work issues:              
Report Upstream:  N/A               |     Reviewers:              
        Authors:  Michael Orlitzky  |     Merged in:              
   Dependencies:                    |      Stopgaps:              
------------------------------------+---------------------------------------

Comment (by mjo):

 Replying to [comment:2 kcrisman]:
 > You need to do `\left|x\\right|`.
 >

 [[BR]]

 Fixed in the new patch, but my MathJAX still doesn't work, so please give
 it a look.

 [[BR]]

 >
 > I'm not sure about all the stuff in the doc and the code, but I think
 that some of the doc is doing the code and vice versa?  For instance,
 > {{{
 > # Forget all assumptions
 > }}}
 > but you don't do that in the code.
 [[BR]]

 Whoops, I forgot to call `forget()`; the comment was correct. I fixed it
 and added a doctest to ensure that no new assumptions remain after the
 call.

 [[BR]]

 > And the corresponding part in the doc seems to imply that in order to
 use `simplify_real` you have to assume variables are real... I may be
 misunderstanding something here.  I think this could be a good way to
 solve the issue at hand.

 [[BR]]

 I didn't mean that the user has to `assume()` anything, only that we have
 to assume things are real in the traditional sense. You can call
 `simplify_real()` on an expression containing complex variables, but the
 answer might not make sense.

 [[BR]]

 >
 > My question is how this will interact with the other simplifications.  I
 seem to recall that in some of the more controversial (e.g.
 `radcan`-related) simplifications we do, part of the issue is whether the
 variable is real... that recollection may be outdated.  Anyway, I could
 imagine that `simplify_foo` simplified differently whether one was real or
 complex, though I hesitate to add `simplify_foo_real` for all `foo`!

 [[BR]]

 Expressions ''should'' be complex everywhere. I believe there are one or
 two functions which treat them as real, but they're documented to do that,
 so it's fine. Radcan via `simplify_radical()` will still produce crazy
 answers that are invalid for complex numbers, but there isn't much that
 can be done about that now except revoke the name "simplify" from
 "simplify_radical."

 Not many expressions are actually affected by the domain and 'real'
 assumptions. We can get most of the benefit of `simplify_foo_real()` by
 doing `simplify_foo().simplify_real()`. Simplifications can be
 combined/repeated to produce better answers, and we already have a
 situation where calling e.g. `simplify_full()` twice might give you a
 better answer than calling it once. So you're kind of on your own
 regarding how many simplifications to try and in what order.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14630#comment:3>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to