# Possible bug in version 12 in solving the eigensystem

I would like to report a possible bug in solving the eigensystem, at least for certain matrix. I use version 12 in mac. I will attach the minimal working example below. Excuse me for the improper format as this is my first time to post here. I will attach a screenshot for the result at the very end. You may notice that I have restarted the kernel, but the problem is still there. Thank you in advance for the help.

Here we go the code.

H={{0,0,Exp[I k1]+m1,Exp[I k2]+m2},{0,0,Exp[I Phi](Exp[-I k2]+m2),Exp[-I k1]+m1},{Exp[-I k1]+m1,Exp[-I Phi](m2+Exp[I k2]),0,0},{Exp[-I k2]+m2,Exp[I k1]+m1,0,0}};

H // MatrixForm
{eigval, eigvec} = Eigensystem[H];
vvv = {eigvec[], eigvec[]};
diffvvv = vvv[] - vvv[];
diffvvv /. Phi -> Pi • Per policy, please do not use the Bugs tag until the community has verified the behavior is indeed caused by a bug. – ciao Feb 23 at 22:15
• Thanks for the reminder and removing the inappropriate tag. – fagd Feb 24 at 1:33
• The corresponding eigenvalues are equal for that substitution. In:= Together[eigval[] - eigval[]] /. Phi -> Pi Out= 0 (Posswibly more convincing: In:= Limit[Together[eigval[] - eigval[]], Phi -> Pi] Out= 0) – Daniel Lichtblau Feb 24 at 18:41

I think you hit an Indeterminate form.

H = {{0, 0, Exp[I k1] + m1, Exp[I k2] + m2}, {0, 0,
Exp[I Phi] (Exp[-I k2] + m2), Exp[-I k1] + m1}, {Exp[-I k1] + m1,
Exp[-I Phi] (m2 + Exp[I k2]), 0, 0}, {Exp[-I k2] + m2,
Exp[I k1] + m1, 0, 0}};
{eigval, eigvec} = Eigensystem[H];
vvv = {eigvec[], eigvec[]};


Now see what happens here

(vvv /. Phi -> Pi) // Simplify


{{0, 0, Indeterminate, 1}, {0, 0, Indeterminate, 1}}

You can see that also if you replace your code with Limit, you get different result

diffvvv = vvv[] - vvv[];
diffvvv /. Phi -> Pi
(* {0,0,0,0} *)


With

diffvvv = vvv[] - vvv[];
Limit[diffvvv, Phi -> Pi]
(* {Indeterminate, Indeterminate, Indeterminate, 0} *)


You can also see the result is different if you replace Phi with Pi in the matrix itself before finding eigenvectors

H = {{0, 0, Exp[I k1] + m1, Exp[I k2] + m2}, {0, 0,
Exp[I Phi] (Exp[-I k2] + m2), Exp[-I k1] + m1}, {Exp[-I k1] + m1,
Exp[-I Phi] (m2 + Exp[I k2]), 0, 0}, {Exp[-I k2] + m2,
Exp[I k1] + m1, 0, 0}};
H = H /. Phi -> Pi;
{eigval, eigvec} = Eigensystem[H];
vvv = {eigvec[], eigvec[]};
diffvvv = (vvv[] - vvv[]) // FullSimplify It should not have made difference if one replaces Phi with Pi before or after.

So it is safer to use Limit instead of direct substitution to avoid this problem.