Actually, fixing this just involves fixing https://code.google.com/p/sympy/issues/detail?id=1799, because Pow already has this logic (_eval_power).
Oh, and I guess Matrix._eval_power would need to be implemented (currently it raises NotImplementedError, but this is easy to fix, just make a**Matrix give exp(log(a)*Matrix). Even with that fixed, you could do E**Matrix, before issue 1799 is fixed. Aaron Meurer On Mon, Jun 24, 2013 at 12:37 PM, F. B. <[email protected]> wrote: > Hi, I noticed the Matrix.exp() function which calculates the exponential of > a Matrix. > > The exp() function fails when calling exp(matrix) because it does not > recognize the matrix object. > > exp is a class inheriting the "Function" object. > > What about creating an "ForwardFunction" object which tries to look for > methods having the same name of the class to apply it? > > For example, the exp() function would not recognize a Matrix object in its > algorithm, but would notice the Matrix.exp() method on its arg and call it. > > -- > 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.
