# Partially diagonalizing a matrix

Suppose I have an $n\times n$ matrix. I would like to keep an $m\times m$ subblock undiagonized, while keeping the rest diagonized. Is there any algorithm for this?

More precisely, I mean using unitary matrix $U$ to realize

$$U^* \pmatrix{ A & B \\ C & D } U = \pmatrix{A' & 0 \\ 0 & D' }$$ where submatrix $A'$ is diagonal, and $D' \approx D$.

• I had a similar problem where I thought I would need such a partial diagonalization but finally did not actually need it. I wanted to approximate a matrix M by a sum of rank-1 matrices $\sum_i \lambda_i·x_i·y_i^T$. But to this end I only need left ($y_i$) and right ($x_i$) eigenvectors of M scaled by $y_i^T·x_i$. – Lemming Feb 14 '18 at 7:40
• Btw. if the diagonalization shall be performed by a unitary transformation $U$, then $\begin{pmatrix}A & B \\ C & D\end{pmatrix}$ must be Hermitian, that is $A=A^*, D=D^*, B=C^*$. – Lemming Feb 14 '18 at 9:37

In general $U$ will only be unitary if your composed matrix is hermitian. I will answer the more general problem that the matrix is partially diagonalizable: $$U^{-1} \begin{pmatrix}A & B \\ C & D\end{pmatrix} U = \begin{pmatrix}A' & 0 \\ 0 & D'\end{pmatrix}.$$ The diagonal matrix $A'$ contains the eigenvalues on its diagonal. You must already know them and their corresponding left and right eigenvectors. Now let $U_\text{eig}$ consist of the right eigenvectors and $V_\text{eig}$ consist of the left eigenvectors as columns. Then choose $$U=(U_\text{eig}|V_\text{eig}^\perp)$$ where $\perp$ denotes an orthogonal complement (a basis of the null space).
Proof: Say, you have a matrix $U$ represented by $(U_\text{eig}|U_\text{rem})$ that partially diagonalizes your matrix. Then split its inverse like so: $V = (V_\text{eig}|V_\text{rem})$ with $U^{-1} = V^T$. We know that $V_\text{eig}$ contains left eigenvectors as columns. It holds $$I = U^{-1}·U = V^T·U = (V_\text{eig}|V_\text{rem})^T · (U_\text{eig}|U_\text{rem}).$$ Separated: $$\begin{array}{cc} I = V_\text{eig}^T · U_\text{eig} & 0 = V_\text{eig}^T · U_\text{rem} \\ 0 = V_\text{rem}^T · U_\text{eig} & I = V_\text{rem}^T · U_\text{rem} \end{array}$$ The equation $0 = V_\text{eig}^T · U_\text{rem}$ means that $U_\text{rem}$ is an orthogonal complement to $V_\text{eig}^T$. You may not know the precise content of $V_\text{eig}$, but orthogonality to $U_\text{rem}$ is invariant under change of the basis or re-ordering of columns. Thus for your computation you can choose any left eigenbasis for your selected eigenvalues.