0

I get some unexpected behaviour from building block matrices of implicit matrices in Mathematica. Using this initial setup

$Assumptions = 
  A \[Element] Matrices[{3, 3}, Reals] &&  
   B \[Element] Matrices[{3, 3}, Reals] && 
   a \[Element] Vectors[3, Reals] && 
   b \[Element] Vectors[3, Reals] && \[Alpha] \[Element] 
    Reals &&  \[Beta] \[Element] Reals;
\[DoubleStruckCapitalA] = {{-\[Alpha], a\[Transpose]}, {a, A}};
\[DoubleStruckCapitalB] = {{-\[Beta], b\[Transpose]}, {b, B}};

1) For the product I get

{{\[Alpha] \[Beta] + b Transpose[a], 
  B Transpose[a] - \[Alpha] Transpose[b]}, {A b - a \[Beta], 
  A B + a Transpose[b]}}

But this is not correct, e.g. the top left should be αβ+Transpose[a].b. I've tried to exchange where I put the transpose, but with no difference. And b.Transpose[a] is not even a scalar! And Mathematica knows this from the fact that using TensorReduce returns "TensorDimenstions: Inhomogeneous dimensions in sum αβ+bTranspose[a]."

2) The transpose of the matrix is not correct:

Transpose[\[DoubleStruckCapitalA]]

Returns

{{-\[Alpha], a}, {Transpose[a], A}}

So it's missing the transpose of A.

I have plenty of more things that do not work, but I'd be happy if there is a way to get these examples to work.

I'm likely using this in the wrong way? If so, what is a good way to go?

  • In your definitions of AA and BB, try doing away with the Transpose altogether. Mathematica does not differentiate between row and column vectors so you often don't need to either. Then the result would be {{a b + α β, a B - b α}, {A b - a β, a b + A B}}. Would that be more along the lines of what you seek? – MarcoB Oct 07 '21 at 16:07
  • Not really... Let say that I define a and b as {3,1} matrices instead. Then it does matter, but this sadly does not change what Mathematica does... – Running_Quark Oct 07 '21 at 16:44
  • I don't think mixing explicit and symbolic matrices will work well. Mathematica works best when you stick to one or the other. – Carl Woll Oct 07 '21 at 18:36
  • 1
    I guess one is restricted to writing something like this: https://mathematica.stackexchange.com/questions/37808/block-matrix-algebra-with-mathematica – Running_Quark Oct 08 '21 at 05:35

0 Answers0