Say I have $2k$ matrices $M_{a_1b_1}$, $M_{a_2b_2}$,..,$M_{a_kb_k}$ and their negatives. Here $M_{a_ib_i}$ is such that it has $0$ everywhere except that it has $1$ at $(a_i,b_i)$ and $(b_i,a_i)$ entry. Also all the $k$ $a$s and $b$s are distinct $2k$ integers.
One can argue that these are mutually commuting $2k$ matrices and hence are simultaneously diagonalizable.
- But can one algebraically specify as to what is the similarity transformation that will simultaneously diagonalize them? (and their diagonal forms?)
Let $e_1,\dots,e_n$ denote the canonical orthonormal basis. Let $U$ be the matrix whose columns are given by $u_1,\dots,u_n$, where $$ u_{2j-1} = \frac 1{\sqrt 2} (e_{a_j} + e_{b_j}) \qquad j = 1,\dots,k\\ u_{2j} = \frac 1{\sqrt 2} (e_{a_j} - e_{b_j}) \qquad j = 1,\dots,k $$ and $u_{2k+1},\dots,u_n$ are chosen so that the columns $u_j$ are orthonormal. Then $U$ is unitary, and for each $M$, the matrix $U^{-1}MU = U^*MU$ will be diagonal.
The matrix $M_{a_jb_j}$ is taken to the diagonal matrix $$ \pmatrix{ 0\\ &\ddots\\ &&0\\ &&&1\\ &&&&-1\\ &&&&&0\\ &&&&&& \ddots\\ &&&&&&& 0 } $$