# Symbolic Computations with Block Matrices in Maple

Due to the derivation of an algorithm I tried to use Maple (9.5) to calculate some block matrix expression. Unfortunately Maple seems to ignore the assumption I set on the variable. Lets consider the following minimal example:

restart; with(LinearAlgebra);
assume(A,'SquareMatrix');
assume(B,'SquareMatrix');
E:=Matrix([A, B]);


which results in

$E:=\begin{pmatrix} A & B \end{pmatrix}$

If I now try to evaluate

Transpose(E).E


I end up with

$E:=\begin{pmatrix} A^2 & AB\\AB & B^2 \end{pmatrix}$

$E:=\begin{pmatrix} A^TA & A^TB\\B^TA & B^TB \end{pmatrix}$

My question is now why does Maple ignore the assumption set to the variables A and B?

• Also, have you tried assume(A,'Nonsymmetric')? – Christian Clason Jul 17 '14 at 9:26
• The assume(E... was a type here, but not in my Maple worksheet. Assuming that A is non symmetric results in "Error, (in ConvertProperty) Nonsymmetric is an invalid property" – M.K. aka Grisu Jul 17 '14 at 11:01
• Sorry, I misread the documentation -- it's supposed to be assume(A,'Non(symmetric)'), see maplesoft.com/support/help/Maple/view.aspx?path=property – Christian Clason Jul 17 '14 at 11:13
• Even setting it to Non(symmetric) does not change the above described behavior. – M.K. aka Grisu Jul 17 '14 at 13:09
• Then it sounds like a bug or peculiarity in Maple, and you it would be better to ask the experts on mapleprimes.com. – Christian Clason Jul 17 '14 at 13:15

This is not precisely an answer to your question, but too long for a comment: In SymPy (called via isympy to set up the symbols), this works as intended:

A = MatrixSymbol('A',n,n)
B = MatrixSymbol('B',n,n)
E = BlockMatrix([[A,B]])
block_collapse(E.T*E)


results in the desired output

⎡ T     T  ⎤
⎢A ⋅A  A ⋅B⎥
⎢          ⎥
⎢ T     T  ⎥
⎣B ⋅A  B ⋅B⎦


But if I do

E = Matrix([[A,B]])
E.T*E


I get

⎡A⋅A  A⋅B⎤
⎢        ⎥
⎣B⋅A  B⋅B⎦


similar to your output (at least SymPy respects that matrix multiplication is non-commutative). This suggests that you should explicitly declare your E as a block matrix, but I don't know if this is possible with Maple's LinearAlgebra (it was with the deprecated linalg package).

My recommendation is to ask your question on Maple's Q&A, http://www.mapleprimes.com/ (it's technically off topic on this site, since it about a bug or problem with a specific software package).