Hadamard product and conventional product

258 Views Asked by At

If we consider the Hadamard product of matrices (elementwise product) and the conventional product of matrices (composition of operators), when do they coincide?

I see that if both matrices are diagonal, both types of product are the same. But is the converse true?

2

There are 2 best solutions below

0
On

More of an exploration, that's too big for a comment. Using the Hadamard product example, from Wikipedia:

$\begin{pmatrix} a_{11}&a_{12}&a_{13}\\a_{21} &a_{22}&a_{23}\\a_{31}&a_{32}&a_{33} \end {pmatrix} \circ\begin{pmatrix} b_{11}&b_{12}&b_{13}\\b_{21} &b_{22}&b_{23}\\b_{31}&b_{32}&b_{33} \end {pmatrix}=\begin{pmatrix} \color{blue}{a_{11}b_{11}}&a_{12}b_{12}&a_{13}b_{13}\\a_{21}b_{21}&\color{blue}{a_{22}b_{22}}&a_{23}b_{23}\\a_{31}b_{31}&a_{32}b_{32}&\color{blue}{a_{33}b_{33}} \end {pmatrix}$

we need to equate this to:

$\begin{pmatrix} a_{11}&a_{12}&a_{13}\\a_{21} &a_{22}&a_{23}\\a_{31}&a_{32}&a_{33} \end {pmatrix}\begin{pmatrix} b_{11}&b_{12}&b_{13}\\b_{21} &b_{22}&b_{23}\\b_{31}&b_{32}&b_{33} \end {pmatrix}=\begin{pmatrix} \color{blue}{a_{11}b_{11}}+a_{12}b_{21}+a_{13}b_{31}&a_{11}b_{12}+a_{12}b_{22}+a_{13}b_{32}&a_{11}b_{13}+a_{12}b_{23}+a_{13}b_{33}\\ a_{21}b_{11}+a_{22}b_{21}+a_{23}b_{31}&a_{21}b_{12}+\color{blue}{a_{22}b_{22}}+a_{23}b_{32}&a_{21}b_{13}+a_{22}b_{23}+a_{23}b_{33}\\ a_{31}b_{11}+a_{32}b_{21}+a_{33}b_{31}&a_{31}b_{12}+a_{32}b_{22}+a_{33}b_{32}&a_{31}b_{13}+a_{32}b_{23}+\color{blue}{a_{33}b_{33}}\\ \end {pmatrix}$

we can see that, for example, $a_{12}b_{21}+a_{13}b_{31}=0$ these sums only work if they are cancelling so either $b_{21}=b_{31}\land a_{12}+a_{13}=0$, or $a_{12}=a_{13}\land b_{21}+b_{31}=0$ are the simplest two cases ( yes there are more, where additive inverses, and equality, get involved. To keep this diagonal the same, these are neccessary, but not sufficient conditions)

0
On

Assume $$AB\simeq A\circ B$$ and calculate the double-contraction product, i.e. $$X:Y={\rm tr}(X^TY)$$ of the two products with respect to various matrices.


Let $X=I$, and consider how $A$ is constrained $$\eqalign{ I:AB &\simeq I:(A\circ B) \cr A^T:B &\simeq (I\circ A):B = {\rm Diag}(A):B \cr }$$ The rearrangement of terms on the LHS follows from the properties of the trace, and the RHS from the mutual commutivity of the contraction and hadamard products.

No matter how large we make the off-diagonal elements of $B$, the RHS is unchanged. But the sum represented on the LHS will become arbitrarily large, unless $A^T$ is in fact diagonal.

But if $A$ is diagonal, then so is $(A\circ B)$. And by assumption, $AB$ is also diagonal. But the only way that the standard matrix product can yield a diagonal matrix given that $A$ is diagonal, is if $B$ is also diagonal.

But your propostion is not quite true, since the products are also equal in two trivial cases: $$\eqalign{ A&=0 \cr B&=0 \cr }$$