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);
E:=Matrix([A, B]); 

which results in

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

If I now try to evaluate


I end up with

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

instead of

$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?

  • 2
    $\begingroup$ Also, have you tried assume(A,'Nonsymmetric')? $\endgroup$ Jul 17 '14 at 9:26
  • $\begingroup$ 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" $\endgroup$ Jul 17 '14 at 11:01
  • 1
    $\begingroup$ Sorry, I misread the documentation -- it's supposed to be assume(A,'Non(symmetric)'), see maplesoft.com/support/help/Maple/view.aspx?path=property $\endgroup$ Jul 17 '14 at 11:13
  • $\begingroup$ Even setting it to Non(symmetric) does not change the above described behavior. $\endgroup$ Jul 17 '14 at 13:09
  • 2
    $\begingroup$ Then it sounds like a bug or peculiarity in Maple, and you it would be better to ask the experts on mapleprimes.com. $\endgroup$ 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]])

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]])

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).

(If this makes you want to switch to SymPy, this page may be helpful.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.