I want to use ROOT to calculate the eigenvalues and eigenvectors of a symmetric matrix. In my simple example I do not get the expected values. I’m not sure if I did something wrong in my code or if there is a problem in the internal calculation of the eigenvalues.
The output of the attached script gives
2x2 matrix is as follows
| 0 | 1 |
0 | 1 2
1 | 3 4
Vector (2) is as follows
| 1 |
0 |5.8541
1 |-0.854102
2x2 matrix is as follows
| 0 | 1 |
0 | 0.5257 -0.8507
1 | 0.8507 0.5257
But the true eigenvalues are 5.3723 and -0.3723.
The true eigenvectors are (-0.8246, 0.5658) and (-0.4160, -0.9094).
I just realized that the matrix I used in the example is not good, because it is not symmetric. Using a symmetric matrix I get reasonable results.
However, when I test that the inverted matrix of eigenvectors times the original matrix times the matrix of eigenvectors indeed gives a diagonal matrix with the eigenvalues on the diagonal, then my test fails.