A problem with eigenvectors of a Hermitian(?) Matrix

diagonalizationeigenvalues-eigenvectorslinear algebramatrices

I have this matrix:

$$A=\begin{bmatrix}
1 & -1 & 0 \\
-1 & 2 & -1 \\
0 & -1 & 1
\end{bmatrix}$$

Eigenvalues are $\lambda_i=0,1,3$

Corresponding eigenvectors:

$v_{\lambda=0}$\begin{bmatrix}
1 \\1\\1 \end{bmatrix}

$v_{\lambda=1}$\begin{bmatrix}
1 \\0\\-1 \end{bmatrix}

$v_{\lambda=3}$\begin{bmatrix}
1 \\-2\\1 \end{bmatrix}

Now, $A=XDX^{-1}$ as it should (where D is the eigenvalues matrix). But my notes say the following:enter image description here

And in a sense $A$ is hermitian (because it is symmetric), so we should have that $$A=XDX^T$$ but $XDX^T=\begin{bmatrix}
4 & -6 & 2 \\
-6 & 12 & -6 \\
1 & -2 & 1
\end{bmatrix}\neq A$

What am I doing wrong here?

EDIT: After using Jose's hint everything works:

enter image description here

Best Answer

Your matrix $X$ is not orthogonal: the columns do not have norm $1$. Divide each column by its norm, and all will be fine then. Not being orthogonal means that $X^{-1}\neq X^T$.