Yes, quite a few functions allow this. The two you mention require you
to implement _eval_simplify and _eval_trace methods, respectively.

Aaron Meurer

On Fri, Aug 30, 2013 at 2:33 AM, F. B. <[email protected]> wrote:
> I am wondering whether it is possible to use standard SymPy functions like
> simplify( ) and trace( ) on special objects, i.e. if an object can overload
> the behavior of these functions when they are applied upon it.
>
> For instance, gamma matrices in physics are special objects which may be in
> some cases represented by "normal" matrices, but gamma matrices also have a
> base-independent construction, upon which trace( ) can act. Gamma matrix
> expressions can also be simplified, is it possible to simply make simplify(
> ) aware of these objects and apply related algorithms on them?
>
> Furthermore, the DifferentialOperator object can be exponentiated (though it
> is still difficult to exponentiate it, because the algorithm requires to
> solve a partial differential equation with initial conditions).
>
> I think it would be useful to have the possibility to overload all standard
> functions.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" 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/sympy.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to