# Precision of Eigensystem? [closed]

I was using Eigensystem to obtain the rotation matrix. However, I find out Mathematica does not fully diagonalize my matrix (or say not precise enough). My matrix is the following

TestM={{6.42497*10^-22, -9.48449*10^-24 - 3.32568*10^-23 I, 0., 0., 0.,
0.}, {-9.48449*10^-24 + 3.32568*10^-23 I, 6.42497*10^-22, 0., 0.,
0., 0.}, {0., 0.,
1.28499*10^-21, -9.48449*10^-24 - 3.32568*10^-23 I, 0., 0.}, {0.,
0., -9.48449*10^-24 + 3.32568*10^-23 I, 1.28499*10^-21, 0.,
0.}, {0., 0., 0., 0.,
1.28499*10^-21, -9.48449*10^-24 - 3.32568*10^-23 I}, {0., 0., 0.,
0., -9.48449*10^-24 + 3.32568*10^-23 I, 1.28499*10^-21}};


And I tried

{\[CapitalEpsilon], Ev} = Eigensystem[TestM];
R = ConjugateTranspose[Ev] // N;
Rv = Inverse[R] // N; T2 = Rv.(TestM).R;
T2 // MatrixForm


And T2 gives me

{{1.25561*10^-21 - 2.05712*10^-38 I,
0. + 0. I, -1.88079*10^-37 + 1.82417*10^-23 I, 0. + 0. I, 0. + 0. I,
0. + 0. I}, {0. + 0. I, 1.25561*10^-21 - 2.05712*10^-38 I,
0. + 0. I, -1.88079*10^-37 + 1.82417*10^-23 I, 0. + 0. I,
0. + 0. I}, {9.40395*10^-38 - 1.82417*10^-23 I, 0. + 0. I,
1.31437*10^-21 - 1.46937*10^-38 I, 0. + 0. I, 0. + 0. I,
0. + 0. I}, {0. + 0. I, 9.40395*10^-38 - 1.82417*10^-23 I,
0. + 0. I, 1.31437*10^-21 - 1.46937*10^-38 I, 0. + 0. I,
0. + 0. I}, {0. + 0. I, 0. + 0. I, 0. + 0. I, 0. + 0. I,
6.13117*10^-22 - 1.91018*10^-38 I, -1.41059*10^-37 +
1.82417*10^-23 I}, {0. + 0. I, 0. + 0. I, 0. + 0. I, 0. + 0. I,
0. - 1.82417*10^-23 I, 6.71878*10^-22 + 1.6163*10^-38 I}}


The answer contains some off-diagonal term with two orders smaller than the diagonal terms, which is far less precise than I needed for my calculation. Is there anyway I can improve the calculation precision? Or precisely speaking, make the off-diagonal term to be smaller than 10^-32 ?

## closed as off-topic by Daniel Lichtblau, user9660, MarcoB, C. E., Sjoerd C. de VriesDec 7 '15 at 19:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, Community, MarcoB, C. E., Sjoerd C. de Vries
If this question can be reworded to fit the rules in the help center, please edit the question.

• You could try using all rational numbers by applying Rationalize to your approximate scalars. The calculation may take longer but it should avoid any approximate zeroes off the diagonal in your resulting system. – IPoiler Dec 6 '15 at 12:02
• This is not a precision issue. The correct diagonalization formulation will use the transpose of the eigenvectors, not the conjugate-treanspose. – Daniel Lichtblau Dec 7 '15 at 15:07
• yep @DanielLichtblau is right, I corrected my code too - see below. – Vitaliy Kaurov Dec 7 '15 at 20:44

All of your numbers have about the same small factor. Let's say it is 10^-24.Then doing the same with 10^24 TestM matrix

Ev = Eigenvectors[10^24 TestM];
R = Transpose[Ev];
Rv = Inverse[R];
T2 = Rv.(10^24 TestM).R;
T2 // Chop // MatrixForm


gives you a matrix with much smaller off-diagonal terms:

• Thanks for helping. Actually this gives the same answer as what I had in the question... – Dhwister Dec 7 '15 at 3:56
• @Dhwister sorry there was a typo - corrected. – Vitaliy Kaurov Dec 7 '15 at 19:50