# What does the notation $D = \mathrm{diag}(W\cdot1)$ mean?

What does the notation $$D = \mathrm{diag}(W\cdot1)$$ mean in the following excerpt from this paper?

• The answers given below are right. I just want to point out that that paper provides a good example of what not to do when expressing ideas mathematically—failing to define notations before using them (what's $m_i$)?), using different font variants in a way that obscures the underlying type ($\mathbf{W}_{ij}$ and $\mathbf{x}(t)$ are actually scalars), and failing to change human-readable words from italic to roman in equations ("diag", "seg", "otherwise"). – K B Dave Jul 10 '19 at 23:10
• – Rodrigo de Azevedo Jul 11 '19 at 10:29

When $$v=(v_1,\ldots,v_K)^\top\in\Bbb C^K$$, one often writes

$$\mathrm{diag}(v)=\begin{pmatrix} v_1 & 0 & \dots & 0 \\ 0 & v_2 & \ddots & \vdots \\ \vdots & \ddots & \ddots& 0 \\ 0 & \dots & 0 & v_K \end{pmatrix} \in\Bbb C^{K\times K}.$$

Here,

$$v=W\cdot \mathbf{1},$$

where $$\mathbf{1}$$ means the vector $$(1,\ldots,1)^\top\in\Bbb C^K$$, so

$$v_i = \sum_{j=1}^K W_{ij}\cdot 1, \quad i=1,\ldots,K.$$

• Ewww, writing $1$ to mean a vector is so gross . . . surely there’s something better – gen-ℤ ready to perish Jul 11 '19 at 0:08
• @ChaseRyanTaylor $$\sum_{j=1}^{n} e_j?$$ :P – Xander Henderson Jul 11 '19 at 1:26
• @XanderHenderson Ahhhhh much better. Maybe call it . . . $E$. It’s not your fault though! – gen-ℤ ready to perish Jul 11 '19 at 1:27
• @ChaseRyanTaylor $E$ could work. It might cause some ambiguity with, for example, a matrix containing only $1$s... maybe $E_{m\times 1}$ if we are worried about such an ambiguity (drop the subscript if not)? – Xander Henderson Jul 11 '19 at 1:28
• @XanderHenderson What a headache – gen-ℤ ready to perish Jul 11 '19 at 1:29

$$L$$ is a sort of Laplacian matrix, defined by subtracting the original matrix $$W$$ from the matrix whose diagonal contains its row sums. In other words, $$D$$ is the diagonal matrix with $$D_{ij}=0$$ when $$i\neq j$$ and $$D_{ii}=\sum_j W_{ij}$$.

The notation "$$\operatorname{diag}(v)$$" means to make a matrix whose diagonal is the vector $$v$$, with zeros off the diagonal.

Here, $$W\cdot 1$$ means the multiplication of $$W$$ with the vector of ones, which turns out to compute the row sums: $$[W1]_i=\sum_j W_{ij}1_j=\sum_{j}W_{ij}$$.

• It might be worth noting that (in contrast to your answer) the $1$ in the paper is bolded. – Xander Henderson Jul 11 '19 at 1:25
• Totally. Don't know what I was looking at... – cwindolf Jul 11 '19 at 14:13