# How to improve accuracy of calculating eigenvalues of Non-Hermitian matrix?

I have a non-Hermitian Matrix nonHM whose size is $$n \times n$$ and is a function of $$c1$$.the Eigenvalues are symmetric with respect to $$c1$$, i.e. $$E(c1)=E(-c1)$$, however, MMA gives correct results only for small $$n$$ but we lose the symmetry for large $$n$$ which is expected (not sure!) to be a matter of accuracy? So, how can increase the accuracy?

here I am calculating the imaginary part of the eigenvalues

org = c1 PauliMatrix[1] + I c2/2 PauliMatrix[2];
cp = 1/2 (PauliMatrix[1]  + I PauliMatrix[2]);
nonHM[n_] :=
SparseArray[{Band[{1, 1}, {2 n, 2 n}] -> {org},
Band[{1, 3}, {2 n, 2 n}] -> {cp},
Band[{3, 1}, {2 n, 2 n}] -> {ConjugateTranspose[cp]}}]
c2 = 4/3; sizn = 40;
Eign0 = ParallelTable[{c1, Eigenvalues[N@nonHM[sizn]]}, {c1, -3, 3,
0.01}];
listIm = Table[{-3 + 0.01 i, Im[Eign0[[i]][[2, j]]]}, {i, 1,
Length[Eign0]}, {j, 1, 2 sizn}];
ListPlot[Transpose[listIm], Frame -> True,
FrameLabel -> {"c1", "ImE"}, LabelStyle -> {FontSize -> 18, Black},
PlotRange -> {-0.8, 0.8}, Axes -> True,
PlotStyle -> Directive[Red, PointSize[Small]], AspectRatio -> 1,
ImageSize -> 400]


this is for $$n=5$$

and for $$n=40$$

Rationalize .01 in the lines Eign0=... and listIm=...:

To get finite evaluation time I decreased the increment {c1, -3, 3,1/10 }

Eign0 = ParallelTable[{c1, Eigenvalues[nonHM[sizn] ]}, {c1, -3, 3,1/10  }];


In the next line index i must be replaced by i-1 I think.

listIm = Table[{-3 + 1/10  (i-1), Im[Eign0[[i]][[2,j]]]}, {i, 1,Length[Eign0]}, {j, 1, 2 sizn}];

ListPlot[Transpose[listIm], Frame -> True,FrameLabel -> {"c1", "ImE"}, LabelStyle ->{FontSize -> 18, Black}, PlotRange -> {-0.8, 0.8}, Axes -> True,PlotStyle -> Directive[Red, PointSize[Small]],AspectRatio -> 1,ImageSize -> 400]


Hope it helps!

• it takes too long and is not finished?! I am using MMA 12.3.0 on win64 Commented Nov 4, 2021 at 14:26
• @valarmorghulis See my modified answer. I decreased the discretisation of c1 to get finite evaluation time. Commented Nov 4, 2021 at 14:32
• thanks for the help! correct $(i-1)$ but this way it becomes time expensive! Commented Nov 4, 2021 at 14:51
• Using Eigenvalues[N[nonHM[sizn], 30]] is faster than calculating analytical Eigenvalues and also more accurate. Commented May 26, 2022 at 19:55