How to simultaneously diagonalize two commuting matrices?

430 Views Asked by At

I'm working on a numerical problem involving simultaneous diagonalization.

I have two matrices, $K$ and $B$, for which $[K,B]=0$. I want to use the eigenvectors of $B$ to diagonalize $K$. Here is the $B$ matrix,

\begin{equation} B = \begin{pmatrix} 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \end{pmatrix} \end{equation}

$B$ is singular, is it still possible to use it to diagonalize $K$? First I get the eigenvectors of $B$, which MATLAB will return in a matrix $V$ with the $B$ eigenvectors as it's columns. Then I use this matrix $V$ to block diagonalize $K$, i.e.

\begin{align} V^{-1}KV = [K]_{BD} \end{align}

$[K]_{BD}$ denotes that $K$ is in the basis where it is now block diagonal. Then I can diagonalize each of $[K]_{BD}$'s blocks, getting eigenvectors of those blocks. Padding those block-eigenvectors with zeros should give me the eigenvectors of the full $[K]_{BD}$. I assemble these into a matrix, let's call it $S$. Then I can diagonalize $S$ by performing,

\begin{align} S^{-1}[K]_{BD}S = K_D \end{align}

where $K_D$ is the now diagonal $K$. I can apply

\begin{align} S^{-1}(V^{-1}BV)S = B_D \end{align}

and I will have simultaneously diagonalized the $K$ and $B$ matrix as desired.

Some issues I'm facing / questions I have are:

  1. MATLAB tends to return the matrix of eigenvectors (the $V$ or the $S$) with an arbitrary ordering of the columns (it's at the whims of algorithmic efficiency). Does this matter for my procedure? I think this is a problem because the procedure relies on a correspondence between the degenerate subspaces of $B$ and the blocks of $[K]_{BD}$.

  2. As mentioned, is $B$ being singular a problem? It seems like it is because MATLAB is throwing an error when I try to use $V^{-1}$ in the computation.

  3. My understanding of this whole topic isn't great. I'm trying to follow the procedure shown in this video. But maybe someone that reads this post can direct me to a good textbook section to clear up any misconceptions you notice in the above.