TITLE: Can someone resolve my confusion about uniqueness of diagonalization?
QUESTION [5 upvotes]: I am a bit confused about diagonalization. I have $A$ which I know is diagonalizable. I want to find $P$ such that $A = P \Sigma P^{-1}$ where $\Sigma$ is diagonal. Under what circumstances is $P$ unique, if ever? If it is not unique, is it at least unique up to some operation?

REPLY [4 votes]: For any diagonalizible matrix $n\times n$, for $n\geq 2$, $P$ is not unique. If the eigenvalues of $A$ are not all equal, then $\Sigma$ is not unique as well. If you change the columns of $P$ that will correspond to changing the appropriate columns in $\Sigma$. Even if, suppose, you fix $\Sigma$, even then you can change the columns in $P$ that correspond to eigenvectors of the same eigenvalue, or you can multiply them by scalar or make linear combinations. In short, in this case (when you fix $\Sigma$), $P$ will be unique up to elementary matrix column operations, but only between columns that correspond to the same eigenvalue.

REPLY [4 votes]: In general, $P$ won't be unique. You can always:

Change the order of different eigenvalues in $\Sigma$; that is, the values along the main diagonal. This will produce changes in the order of the corresponding eigenvectors; that is, the columns of $P$.
Even keeping $\Sigma$ untouched, if you have eigenvalues with multiplicity greater than 1, this will produce subspaces of eigenvectors with dimension greater than one. Any basis of which can be used for the columns of $P$.

For instance, take $A$ to be the diagonal matrix
$$
A = 
\begin{pmatrix}
1  &  0  &  0  \\
0  &  1  &  0  \\
0  &  0  &  2
\end{pmatrix}
$$
Then you can obviously take $\Sigma = A$ and $P$ to be the unit matrix, but any matrix of the form
$$
P = 
\begin{pmatrix}
a  &  b  &  0  \\
c  &  d  &  0  \\
0  &  0  &  e
\end{pmatrix}
$$
will do (as long as $ad - bc \neq 0$ and $e \neq 0$).
Or, for the same $A$, you could also take
$$
\Sigma = 
\begin{pmatrix}
2  &  0  &  0  \\
0  &  1  &  0  \\
0  &  0  &  1
\end{pmatrix}
$$
and any
$$
P = 
\begin{pmatrix}
e  &  0  &  0  \\
0  &  a  &  b  \\
0  &  c  &  d
\end{pmatrix}
$$
with the same restrictions as before is ok.