4

I have just started learning about matrix and tensor calculus. I was introduced to different products: Kronecker, Hadamard, Frobenius, row-wise products and obviously standard matrix and scalar multiplications. I am not sure yet what is the order in which they can be executed.

I think they are not mutually associative. It is, if you consider the following expression: $$ \mathbf{A} \mathbf{B} \odot \mathbf{C} \centerdot \mathbf{D} $$ where all matrices are $2 \times 2$ matrices ($ \mathbf{A, B, C, D} \in \mathcal{M}_{2 \times 2} $), $\odot$ refers to Hadamard product and $\centerdot$ to Frobenius product. Then I think matrix multiplication should be executed first, then Hadamard product and finally Frobenius product. But it is very specific example and I am not sure if it works in general.

What are the rules concerning these operations' order in an expression?

Szpilona
  • 151
  • 1
    The precedence rules that you've enunciated are pretty standard. Instead of square matrices, you might want to work through some rectangular examples. Then you'll find that, like addition and subtraction, Frobenius and Hadamard products require matrices of the same shape. The standard matrix product also has a rule for dimensional compatibility. The Kronecker product is the odd-man-out, since it places no restrictions on the shape of the matrices. So dimensional considerations alone are often enough to determine the order of evaluation, Use parentheses if there's any ambiguity. – lynn Jun 14 '17 at 15:56

1 Answers1

2

The first consideration is about the dimension of the matrices that are multiplied and of the result of the product.

The Frobenius inner product takes two matrices of the same dimension and gives a scalar, so the ''triple product'' $B\odot C\cdot D$ can be interpreted only as $(B\odot C)\cdot D$ because the oter $B\odot (C\cdot D)$ is not defined.

The Hadamard product take two matrices of the same dimension and gives another matrix of the same dimension, so for $AB\odot C$ the two possibilities $A(B\odot C)$ and $(AB)\odot C$ are well defined. Since the two results are different (in general) it is better to specify with parentheses what is the choice.

Emilio Novati
  • 62,675
  • I do understand that dimensions always come first. But what should I do if multiple possible choices of order are well defined (like e.g. in $\mathbf{AB}\odot\mathbf{C}$ above)? – Szpilona Jun 14 '17 at 16:00
  • As far as I know there is no shared priority rule, so it's best to use parentheses to avoid ambiguity. – Emilio Novati Jun 14 '17 at 16:52