What do you call this kind of matrix product? Let&rsquo;s say I am using multiple polls to evaluate a politician&rsquo;s popularity. Each poll&rsquo;s rating goes into the column vector $v$. Then, I want to take the weighted average of these entries, using weights that I store in the column vector $w$. Then the weighted average is $w^T v = p$. 

Now, I want to track how her popularity changes over time. I collect the popularity vectors $v_i$ at times $i = 1$ through $n$. My poll rating system is constantly being refined based on the outcomes of other races, so for every popularity vector $v_i$, there is a corresponding weight vector $w_i$ that gives the weights used at time $i$. 

Then we have 
$$\begin{align}
W = \begin{bmatrix}
\mid &amp; \mid &amp; &amp; \mid \\
w_1 &amp; w_2 &amp; \cdots &amp; w_n \\
\mid &amp; \mid &amp; &amp; \mid \\
\end{bmatrix}
&amp; \qquad V = \begin{bmatrix}
\mid &amp; \mid &amp; &amp; \mid \\
v_1 &amp; v_2 &amp; \cdots &amp; v_n \\
\mid &amp; \mid &amp; &amp; \mid \\
\end{bmatrix}\end{align}
$$

I want to multiply $W$ (or $W^T$) and $V$ together in such a way that 

$$W \boxtimes V = \begin{bmatrix} w_1^T v_1  \\ w_2^T v_2  \\ \vdots \\ w_n^T v_n \end{bmatrix} = \vec p$$

and the resultant vector contains the weighted averages at each time.

I can see that $\vec p = \mathrm{diag}( W^T V )$, but this requires lots of unnecessary computations. 

A better definition might be to sum the rows of $W \circ V$ and then transpose, where $\circ$ is the Hadamard product. This is how I do it in numpy:

np.random.seed(123)
w = np.random.rand(5, 7)
w = w / np.sum(w, axis=0)
v = np.random.rand(5,7)

np.sum(w*v, axis=0)


yields 

array([0.42125858, 0.50186797, 0.82132014, 0.63440834, 0.48432466,
       0.52752764, 0.31076101])


(np.diag(w.T @ v) also works.)

It seems like this product should have a name, as it has many applications in statistics and optimization.
$${\rm W} \boxtimes {\rm V} := \mbox{diag} \left( {\rm w}_1^\top, {\rm w}_2^\top, \dots, {\rm w}_n^\top \right) \mbox{vec} \left( {\rm V} \right)$$
$${\rm W} \boxtimes {\rm V} := \mbox{diag} \left( {\rm w}_1^\top, {\rm w}_2^\top, \dots, {\rm w}_n^\top \right) \mbox{vec} \left( {\rm V} \right)$$