Thanks.  But I don't want to specify the size of the matrices, and I don't 
want the result to be in terms of matrix elements; I want it to still 
appear as A*(B.*C) or something similar, as the purpose is generation of 
MATLAB or numpy code that won't index into the matrices.  I just need two 
different kinds of multiplication operators for non-commutative symbols.

David


On Sunday, October 21, 2012 11:31:12 AM UTC+3, smichr wrote:
>
> On Sun, Oct 21, 2012 at 1:58 PM, David Ketcheson 
> <[email protected]<javascript:>> 
> wrote: 
> > I would like to express formulas that involve both traditional 
> matrix-matrix 
> > multiplication and elementwise multiplication.  To be clear, these are 
> the 
>
> The following is from the docs on Matrix Expressions: 
>
>
> >>> from sympy import MatrixSymbol, Matrix 
> >>> X = MatrixSymbol('X', 3, 3) 
> >>> Y = MatrixSymbol('Y', 3, 3) 
> >>> (X.T*X).I*Y 
> X^-1*X'^-1*Y 
>
> >>> Matrix(X) 
> [X_00, X_01, X_02] 
> [X_10, X_11, X_12] 
> [X_20, X_21, X_22] 
>
> >>> (X*Y)[1, 2] 
> X_10*Y_02 + X_11*Y_12 + X_12*Y_22 
>
> So yes, you can do abstract value-agnostic manipulations. Although 
> there is a matrix_multiply_elementwise function that operates on 
> regular matrices, I don't think that there is an implementation yet 
> for MatrixExpr. 
>
> Chris 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sympy/-/mcrYhSuqpukJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to