How I can I construct this diagonal matrix by notation?

169 Views Asked by At

Imagine the following diagonal matrix: $$\mathbf A = \begin{bmatrix}a\\ & \ddots\\ && a\\ &&& b\\ &&&& \ddots\\ &&&&& b\\ &&&&&& \ddots \end{bmatrix}\tag{1} $$ I need the entries $a$, $b$ etc. replicated equally many times $M$ along the diagonal of $\mathbf A$. Now, obviously there is a lot of redundancy in this matrix, and I would like to boil it down to a more compact description in which $$\mathbf A = f(\mathbf a)$$ where $$\mathbf a = \begin{bmatrix}a & b & \dots\end{bmatrix}$$ However, I still have not quite figured out what $f(\cdot)$ should be. I have thought of $\mathbf a \otimes \mathbf I_M$ (Kronecker product), but this becomes: $$\mathbf a \otimes \mathbf I_M = \begin{bmatrix}a\\ & \ddots\\ && a\\ b\\ & \ddots\\ && b\\ & \vdots \end{bmatrix},$$ so I am not quite there. Similarly, $\mathbf I_M \otimes \mathbf a$ does not quite fit the bill either: $$\mathbf I_M \otimes \mathbf a= \begin{bmatrix}\mathbf a\\ & \mathbf a\\ && \ddots\\ &&& \mathbf a \end{bmatrix}$$

The central requirement here is that I would like to keep $\mathbf a$, but it is less important what $f$ I get.

2

There are 2 best solutions below

1
On BEST ANSWER

I think I have found a way now: if we let: $$\operatorname{diag}(\mathbf a) = \begin{bmatrix} a\\ & b\\ && \ddots\end{bmatrix},$$ then $$\mathbf A = \operatorname{diag}(\mathbf a) \otimes \mathbf I_M$$

0
On

Following operation to get a diagonal matrix from a vector and assuming $\mathbf a$ is a column vector with $n$ entries:

$$\mathrm{diag}(\mathbf a) = (\mathbf a\mathbf 1_n^T)\odot \mathbf I_n = (\mathbf 1_n \mathbf a^T)\odot \mathbf I_n$$

where $\mathbf 1_n$ is a column vector consisting of $n$ $1$s and $\odot$ is the Hadamard product. Then,

$$\mathbf A = \mathrm{diag}(\mathbf a) \otimes\mathbf I_M = \left((\mathbf a\mathbf 1_n^T)\odot \mathbf I_n\right)\otimes\mathbf I_M.$$

That said, this is kind of an ugly hack. Following almagest's suggestion, it might be better to make up some more compact notation, like $\Delta^M(\mathbf a)$.