#10038: Wrap Maxima's demoivre and exponentialize
---------------------------+------------------------------------------------
Reporter: mpatel | Owner: burcin
Type: enhancement | Status: new
Priority: major | Milestone:
Component: symbolics | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Changes (by burcin):
* cc: fmaltey (added)
Comment:
You can use `maxima_methods()` to access the maxima functions easily.
{{{
sage: x = var('x')
sage: t1 = cos(x)
sage: t2 = e^(I * x) / 2 / I - e^(-I * x) / 2 / I
sage: res = t1.maxima_methods().exponentialize(); res
1/2*e^(-I*x) + 1/2*e^(I*x)
sage: type(res)
<type 'sage.symbolic.expression.Expression'>
sage: t2.maxima_methods().demoivre()
sin(x)
}}}
I am very much against wrapping each maxima function for manipulating
symbolic expressions individually from Sage. Even though maxima provides a
lot of functionality, their user interface is far from intuitive.
IMHO, the user interface to these functions should be something like:
{{{
sage: t1.rewrite(exp)
1/2*e^(-I*x) + 1/2*e^(I*x)
sage: t2.rewrite(sin)
sin(x)
}}}
BTW, it would be great if we could think about how to provide basic
functionality like this directly in Sage without relying on maxima. It's
possible that this requires wrapping more of pynac's features, for example
* http://www.ginac.de/tutorial/Applying-a-function-on-subexpressions.html
and
* http://www.ginac.de/tutorial/Visitors-and-tree-traversal.html
but it's well worth the effort.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10038#comment:1>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.