Access to Maxima methods¶
-
class
sage.symbolic.maxima_wrapper.
MaximaFunctionElementWrapper
(obj, name)¶
-
class
sage.symbolic.maxima_wrapper.
MaximaWrapper
(exp)¶ Bases:
sage.structure.sage_object.SageObject
Wrapper around Sage expressions to give access to Maxima methods.
We convert the given expression to Maxima and convert the return value back to a Sage expression. Tab completion and help strings of Maxima methods also work as expected.
EXAMPLES:
sage: t = log(sqrt(2) - 1) + log(sqrt(2) + 1); t log(sqrt(2) + 1) + log(sqrt(2) - 1) sage: u = t.maxima_methods(); u MaximaWrapper(log(sqrt(2) + 1) + log(sqrt(2) - 1)) sage: type(u) <class 'sage.symbolic.maxima_wrapper.MaximaWrapper'> sage: u.logcontract() log((sqrt(2) + 1)*(sqrt(2) - 1)) sage: u.logcontract().parent() Symbolic Ring
TESTS:
Test tab completions:
sage: import sagenb.misc.support as s sage: u = t.maxima_methods() sage: s.completions('u.elliptic_',globals(),system='python') ['u.elliptic_e', 'u.elliptic_ec', 'u.elliptic_eu', 'u.elliptic_f', 'u.elliptic_kc', 'u.elliptic_pi']
-
sage
()¶ Return the Sage expression this wrapper corresponds to.
EXAMPLES:
sage: t = log(sqrt(2) - 1) + log(sqrt(2) + 1); t log(sqrt(2) + 1) + log(sqrt(2) - 1) sage: u = t.maxima_methods().sage() sage: u is t True
-