3
$\begingroup$

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[[1]], eigvec[[3]]};
diffvvv = vvv[[1]] - vvv[[2]];
diffvvv /. Phi -> Pi

enter image description here

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

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[[1]], eigvec[[3]]};

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[[1]] - vvv[[2]];
diffvvv /. Phi -> Pi
(* {0,0,0,0} *)

With

diffvvv = vvv[[1]] - vvv[[2]];
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[[1]], eigvec[[3]]};
diffvvv = (vvv[[1]] - vvv[[2]]) // FullSimplify

Mathematica graphics

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.

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.