71

This is a notation question. Assume one is given two vector $\mathbf{a}$ and $\mathbf{b}$, and one constructs a third vector $\mathbf{c}$ whose elements are given by $$c_k=a_k b_k$$ Is there any standard notation for this simple operation? Is the notation below acceptable? $$\mathbf{c}=\mathbf{a}\otimes \mathbf{b}$$

joriki
  • 238,052
D R
  • 1,158
  • 3
    Related questions: http://math.stackexchange.com/questions/20412/element-wise-or-pointwise-operations-notation and http://math.stackexchange.com/questions/32516/is-this-vector-operation-defined-does-it-have-a-name – Martin Sleziak Jul 20 '11 at 06:37
  • Also related: http://tex.stackexchange.com/questions/19180/which-dot-character-to-use-in-which-context – Albert Mar 03 '16 at 13:56
  • since vector multiplication is overloaded quite a lot as is, you can't trust that any arbitrary reader will understand your notation; to avoid this problem, use any symbol you want as long as you leave a "let () denote pairwise multiplication of vectors" before using it or "where () denotes pairwise multiplication" after using it, and make sure that you only use this operator in this way in the context of (*) :: vector -> vector -> vector. – Dmytro Dec 06 '17 at 17:47

4 Answers4

65

(Minor edits.)

It turns out that the symbol $\odot$ is often used to denote component-wise multiplication (a few examples are given in the comments below); $\circ$ and $*$ are common alternatives.

Shai Covo
  • 24,077
  • Example 1: Last sentence in page 29 here: http://www.columbia.edu/~nsa2106/Aybat_Paper4_FALC.pdf – Shai Covo Jul 20 '11 at 06:33
  • Example 2: The sentence above Equation (8) here: http://www.uow.edu.au/~mwand/publicns/Gangu07.pdf – Shai Covo Jul 20 '11 at 06:38
  • Example 3: Line 10 on page 14 here http://www.stanford.edu/~tsachy/pdf_files/Algorithms%20for%20Discrete%20Denoising%20Under%20Channel%20Uncertainty.pdf. – Shai Covo Jul 20 '11 at 06:43
  • Example 4: Last sentence on page 16 here: http://alphard.ethz.ch/Hafner/Workshop/Sandfort2010.pdf – Shai Covo Jul 20 '11 at 06:47
  • Example 5: End of page 2 here: http://www.tu-ilmenau.de/fakia/fileadmin/template/startIA/neuroinformatik/publications/conferences_int/2007/Rebhan-ICANN-07.pdf – Shai Covo Jul 20 '11 at 06:50
  • The links for the examples 1, 2, and 5 are broken at the time this written. – Herpes Free Engineer Apr 18 '18 at 12:34
  • 9
    For latex users, the command for the symbol is \odot. – npit Aug 21 '18 at 21:17
  • I do like this description, since $\otimes$ represents the Kronecker product as well. Whereas $\odot$ is very clear that element-wise operations are intended. –  Jan 29 '20 at 02:53
24
  • Wikipedia uses $\circ$ (\circ) to denote the Hadamard product (which is the operation you describe)
  • This answer makes a good case for $\odot$ (\odot) being used instead.
Tom Hale
  • 602
11

No, I would be concerned about $\otimes$ causing confusion with the outer product (although the outer product will produce a matrix, and the componentwise product will produce a vector, so if the context is clear enough perhaps this will not be a problem).

I recommend writing componentwise multiplication of vectors using some symbol that does not have a standard meaning, perhaps $\star$ (\star) or $\diamond$ (\diamond), so that people reading won't have any preconceptions about what might be meant.

Zev Chonoles
  • 129,973
11

If I ever needed to perform a Hadamard product of two vectors $\mathbf a$ and $\mathbf b$, apart from the usual MATLAB notation (as mentioned in the first linked question in the comments), I'd probably use $\mathrm{diag}(\mathbf a)\cdot\mathbf b$, where $\mathrm{diag}(\mathbf a)$ is the diagonal matrix with diagonal entries $a_k$.