Access to Maxima methods

class sage.symbolic.maxima_wrapper.MaximaFunctionElementWrapper(obj, name)[source]

Bases: InterfaceFunctionElement

class sage.symbolic.maxima_wrapper.MaximaWrapper(exp)[source]

Bases: 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
>>> from sage.all import *
>>> t = log(sqrt(Integer(2)) - Integer(1)) + log(sqrt(Integer(2)) + Integer(1)); t
log(sqrt(2) + 1) + log(sqrt(2) - 1)
>>> u = t.maxima_methods(); u
MaximaWrapper(log(sqrt(2) + 1) + log(sqrt(2) - 1))
>>> type(u)
<class 'sage.symbolic.maxima_wrapper.MaximaWrapper'>
>>> u.logcontract()
log((sqrt(2) + 1)*(sqrt(2) - 1))
>>> u.logcontract().parent()
Symbolic Ring
t = log(sqrt(2) - 1) + log(sqrt(2) + 1); t
u = t.maxima_methods(); u
type(u)
u.logcontract()
u.logcontract().parent()
sage()[source]

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
>>> from sage.all import *
>>> t = log(sqrt(Integer(2)) - Integer(1)) + log(sqrt(Integer(2)) + Integer(1)); t
log(sqrt(2) + 1) + log(sqrt(2) - 1)
>>> u = t.maxima_methods().sage()
>>> u is t
True
t = log(sqrt(2) - 1) + log(sqrt(2) + 1); t
u = t.maxima_methods().sage()
u is t