[sympy] Matrix expression canonicalization

2013-11-21 Thread Mark Dewing
I would like to write an expression using Matrix symbols, and then evaluate it by substituting concrete Matrix values. However, the resulting Matrix expression will not simplify. # set up general expression n = Symbol('n') r1 = MatrixSymbol('r1',n,1) r2 = MatrixSymbol('r2',n,1) d = r2 - r1 #

Re: [sympy] Matrix expression canonicalization

2013-11-22 Thread Matthew Rocklin
When used with explicitly defined Matrix objects, MatrixExpressions were intended to be lazy by default. The idea here is that if you wanted immediate evaluation you would have used standard arithmetic operators which would have pointed you to Matrix.__add__ etc. and forced immediate evaluation.

Re: [sympy] Matrix expression canonicalization

2013-11-22 Thread Aaron Meurer
Usually the doit() method applies such rules. Aaron Meurer On Nov 22, 2013, at 9:07 AM, Matthew Rocklin wrote: When used with explicitly defined Matrix objects, MatrixExpressions were intended to be lazy by default. The idea here is that if you wanted immediate evaluation you would have used