# Building matrices from eigenvalues

I saw a question some time ago, asking about the eigenvalues of the matrix $$A=\begin{pmatrix}5&-3&0\\-3&5&0\\0&0&2\end{pmatrix}$$ which were then shown to be $\lambda=\left\{8,2,2\right\}$; and I thought, what a nice feature, we have a symmetric matrix and the eigenvalues seem to be $\lambda=\left\{5-(-3),5+(-3),2\right\}$. So I tried to show that it was indeed a property of the more general matrix $$M=\begin{pmatrix}a&b&0\\b&a&0\\0&0&c\end{pmatrix}$$ and sure enough, I found $\lambda=\left\{a+b,a-b,c\right\}$.

And I remembered that in fact, I had seen a few of these matrices in a Quantum Mechanics course, in the context of perturbation theory, where an Hamiltonian $\hat{H_0}=\text{diag}(a,a,c)$ was said to be degenerate as its eigenvalues were $\lambda=\left\{a,a,c\right\}$, but it was possible to lift the degeneracy by applying a perturbation $\hat{H_p}=\begin{pmatrix}0&b&0\\b&0&0\\0&0&0\end{pmatrix}$, leading to an overall Hamiltonian described by the matrix $M$ above, with distinct eigenvalues.

But I digress. My question is: knowing the eigenvalues, can we build a corresponding matrix? This question (or something close to it) has probably already been asked, but I'm not only interested in building one matrix from a set of eigenvalues, but all possible matrices.

Going back to perturbation theory, my question is directly motivated by trying to find perturbation matrices $\hat{H_p}$ that do not modify the eigenvalues of the unperturbed system $\hat{H_0}$. An (almost trivial) example is $$\hat{H}=\begin{pmatrix}a&0&b\\0&a&0\\0&0&c\end{pmatrix},\quad\hat{H_0}=\begin{pmatrix}a&0&0\\0&a&0\\0&0&c\end{pmatrix},\quad\hat{H_p}=\begin{pmatrix}0&0&b\\0&0&0\\0&0&0\end{pmatrix}$$ where $\hat{H}$ and $\hat{H_0}$ obviously have the same eigenvalues.

Thus, given a set of eigenvalues, is there a way of determining the set of matrices to which they belong?

• Yes, we can at least determine the similarity classes using canonical forms. – Daniel May 25 '15 at 16:06
• @SolidSnake How? – Demosthene May 25 '15 at 16:07
• It's not clear what you mean with 'determine'. One could say the set you're looking for is the set of all matrices with such and such eigenvalues. There, it's determined. I think the best you can hope for is what the Legendary Hero said. – Git Gud May 25 '15 at 16:09
• @Demonsthene Now that think about it, we need the multiplicity of each eigenvalue too (which is equivalent to knowing the characteristic polynomial). The idea is the following: assume you have the characteristic polynomial of the matrix, then you can all possible minimal polynomials for a matrix with that char and therefore all matrices with those eigenvalues (all similarity classes I mean). – Daniel May 25 '15 at 16:13
• @Demosthene That's a fascinating subject! math.niu.edu/~beachy/courses/423/canon07.pdf – Daniel May 25 '15 at 16:40

Matrix_with_those_eigenvalues = P * diag([eigenvalues]) * inv(P)