# Inverse of "diagonal block" matrix

Let

$$A = \begin{bmatrix} A_{11} & \cdots & A_{1m} \\ \vdots & \ddots & \vdots \\ A_{m1} & \cdots & A_{mm} \end{bmatrix}$$ be a block matrix where each matrix $$A_{ij} \in \mathbb{R}^{n\times n}$$ is diagonal. What is $$A^{-1}$$?

It seems that it's possible to iteratively apply the usual $$2 \times 2$$ inverse formula. However, since that seems as though it would produce something very complicated, I'm not sure if there's a more clever way.

• Why do you suspect that $A$ is invertible? For instance, the $2 \times 2$ zero matrix satisfies this property — each of the four matrices $A_{ij}$ is the $1 \times 1$ zero matrix, and of course, a $1 \times 1$ matrix is diagonal — but it is not invertible. Commented Jul 5, 2020 at 4:40
• These blocks, by virtue of being diagonal, will commute multiplicatively. However I suspect we ought to try an arrangement as a block diagonal matrix, rather than a diagonal block matrix. Do you really want to compute the inverse, or will it,suffice to be able to solve linear systems? Commented Jul 5, 2020 at 5:03

Any matrix with diagonal blocks (assuming the blocks have the same size) can be converted to a block-diagonal matrix. In particular, suppose that $$a_{ijk}$$ denotes the $$k$$th diagonal entry of the block $$A_{ij}$$, so that $$A_{ij} = \pmatrix{a_{ij1} \\ & \ddots \\ && a_{ijn}}.$$ There exists a permutation matrix $$P$$ such that $$P^TAP = \pmatrix{B_1\\ & \ddots \\ && B_n},$$ where $$B_k = \pmatrix{ a_{11k} & \cdots & a_{1mk}\\ \vdots & \ddots & \vdots \\ a_{m1k} & \cdots & a_{mmk}}.$$
It follows that the inverse of $$A$$ (assuming it exists) satisfies $$A^{-1} = P\pmatrix{B_1^{-1}\\ & \ddots \\ && B_n^{-1}}P^T.$$ In other words, $$A^{-1}$$ will have the block-structure $$A^{-1} = \pmatrix{C_{11} & \cdots & C_{1m}\\ \vdots & \ddots & \vdots\\ C_{m1} & \cdots & C_{mm}},$$ where $$C_{ij}$$ is a diagonal matrix whose $$k$$th diagonal entry is the $$i,j$$ entry of $$B_k^{-1}$$.
If you're interested in what the matrix $$P$$ looks like, it can be written as $$P = \sum_{i,j = 1}^{m,n} (e_{i}^{(m)} \otimes e_j^{(n)})(e_j^{(n)} \otimes e_i^{(m)})^T$$ where $$e_i^{(n)}$$ denotes the $$i$$th canonical basis vector of $$\Bbb R^n$$ (the $$i$$th column of the size $$n$$ identity matrix), and $$\otimes$$ denotes the Kronecker product.
• @BenGrossmann Can you please provide some material for the step: "There exists a permutation matrix P such that $P^TAP = B$" ? Is it a theorem? Commented Jun 6, 2023 at 5:25