# Diagonalise a sparse (symmetric) matrix with elements only on some diagonals

Is there an analytical way or a good approximation or any other mathematical method to diagonalise a sparse (symmetric) matrix with elements only onsome diagonals?

For example $$\begin{bmatrix} B & 0 & 0 & A & 0\\ 0 & B & 0 & 0 & A\\ 0 & 0 & B & 0 & 0\\ A & 0 & 0 & B & 0\\ 0 & A & 0 & 0 & B \\ \end{bmatrix}$$

or similar...

(is there an index notation way of writing the above matrix? Like $$A_{m,n} = \cdots$$?)

• I know there are fast solvers for this especially if the matrix is diagonally dominant. – lightxbulb Jan 18 at 0:02
• The diagonal is always roughly a factor of $2$ larger than any off diagonal. Have you got any names for these fast solvers? – SuperCiocia Jan 18 at 0:03
• Is $A$ a submatrix or a number? – Omnomnomnom Jan 18 at 0:12
• Assuming that $A$ and $B$ are square submatrices of (identical) size $n$, we can write your matrix as $$M = I_5 \otimes B + \pmatrix{0&0&0&1&0\\0&0&0&0&1\\0&0&0&0&0\\1&0&0&0&0\\0&1&0&0&0} \otimes A$$ where $\otimes$ denotes the Kronecker product – Omnomnomnom Jan 18 at 0:15
• If $A$ and $B$ are numbers, it's fairly easy to diagonalize this analytically. – Omnomnomnom Jan 18 at 0:17

By using $$Xv_i= \lambda_i v_i$$ you can derive the eigenvectors: $$(\frac{1}{\sqrt{2}},0,0,\pm\frac{1}{\sqrt{2}},0)$$, $$(0,0,1,0,0)$$, $$(0, \frac{1}{\sqrt{2}},0,0,\pm\frac{1}{\sqrt{2}})$$, with corresponding eigenvalues $$\lambda =(B\pm A, B, B\pm A)$$. Let $$Q$$'s columns be made up of the eigenvectors (in the given order), then: $$X= Qdiag(\lambda)Q^T$$, where $$X$$ is your initial matrix. Note that this can be trivially extended to higher dimensions for a matrix with the same structure.
• @SuperCiocia What do you mean bruteforce? I just wrote the equations $Xv_i = \lambda_i v_i$ and noticed the structure (3rd component doesn't affect the others, 1 and 4 affect each other, and 2 and 5 also). – lightxbulb Jan 18 at 11:08