M HYPE SPLASH
// general

Notation for sum over element wise multiplication

By John Campbell
$\begingroup$

Im looking for a typical notation for the sum over the elements after an element-wise multiplication of two matrices $A$, $B$ (hadamard product).

Is it correct to write $\sum A \odot B$ without further specifiying what $\sum$ is doing or do i need to use row and column indices? Thanks!

$\endgroup$ 4

1 Answer

$\begingroup$

$ \def\o{{\large\tt1}} \def\L{\left}\def\R{\right}\def\LR#1{\L(#1\R)} \def\trace#1{\operatorname{Tr}\LR{#1}} $The Frobenius product (aka the double-dot product) is what you want$$\eqalign{ A:B &= \sum_{i=1}^m\sum_{j=1}^n A_{ij}B_{ij} &\;=\; \trace{A^TB} \;=\; \trace{AB^T} \\ A:A &= \big\|A\big\|^2_F &\;=\; \trace{A^TA} \;=\; \trace{AA^T} \\ \\ }$$Note that the Hadamard and Frobenius products commute$$\eqalign{ (A\odot B):C &= \sum_{i=1}^m\sum_{j=1}^n A_{ij}B_{ij}C_{ij} \\ &= A:(B\odot C) \\ }$$and that the all-ones matrix $\o$ is the identity for the Hadamard product$$\o\odot A=A$$Therefore one can sum over the elements of a Hadamard product$$\eqalign{ \sum_{i=1}^m\sum_{j=1}^n \;\o_{ij}\,\LR{A\odot B}_{ij} &= \o:(A\odot B) \\ &= (\o\odot A):B \\ &= A:B \\ }$$which was your original intent.

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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