<s>[INST] Matrix diagonalization. Is $A = PDP^{-1} = P^{-1}DP$? Diagonalization of a square matrix $A$ consists in finding matrices $P$ and $D$ such that $A=PD P^{-1}$ where $P$ is a matrix composed of the eigenvectors of $A$, $D$ is the diagonal matrix constructed from the corresponding eigenvalues, and $P^{-1}$ is the matrix inverse of $P$
I wonder if $PDP^{-1} = P^{-1}DP$ ?
Can I say $A=P^{-1}DP$ too?
 [/INST] No,
$$\begin{pmatrix}1&2\\1&0\end{pmatrix}
\begin{pmatrix}2&0\\0&1\end{pmatrix}
\begin{pmatrix}0&1\\\frac12&-\frac12\end{pmatrix}
=\begin{pmatrix}1&1\\0&2\end{pmatrix}$$
while
$$\begin{pmatrix}0&1\\\frac12&-\frac12\end{pmatrix}
\begin{pmatrix}2&0\\0&1\end{pmatrix}
\begin{pmatrix}1&2\\1&0\end{pmatrix}=\begin{pmatrix}1&0\\\frac12&2\end{pmatrix}.$$
</s>