6
$\begingroup$

I am trying to Plot Eigenvalues of a Hamiltonian, but I am getting noisy plot, which is incorrect. Here is the code.

A1 = {{0, 1, 0, 0}, {1, 0, 0, 0}, {0, 0, 0, -1}, {0, 0, -1, 0}};
   A2 = {{0, -I, 0, 0}, {I, 0, 0, 0}, {0, 0, 0, -I}, {0, 0, I, 0}};
   A3 = {{0, 0, 0, -1}, {0, 0, 1, 0}, {0, 1, 0, 0}, {-1, 0, 0, 0}};
   A4 = {{0, -I, 0, 0}, {I, 0, 0, 0}, {0, 0, 0, I}, {0, 0, -I, 0}};
   A5 = {{1, 0, 0, 0}, {0, -1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, -1}};
   A6 = {{0, 0, 0, -I}, {0, 0, I, 0}, {0, -I, 0, 0}, {I, 0, 0, 0}};
   A7 = {{0, 0, 1, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {0, 1, 0, 0}};
   A8 = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, -1, 0}, {0, 0, 0, -1}};
H[d_, λ_, β_, m_] := 
  a (Sin[x] A1 + Sin[ky] A2) + A3 β + 
   d A4 + (t Cos[z] + 2 b (2 - Cos[x] - Cos[ky])) A5 + α*
    Sin[ky] A6 + λ Sin[z] A7+m*A8;
   ky = 0;
   a = 1;
   b = 1;
   t = 1.5;
   α = 0.3;
   Plot3D[Eigenvalues[H[0.1, 0.5, 0.7, 0]][[4]], {x, -π, π}, {z, 0, 2 π}]

Mathematica graphics

Any help will be highly appreciated.

$\endgroup$

2 Answers 2

10
$\begingroup$

By default, the eigenvalues are ordered by absolute value. All the eigenvalues of this particular matrix have the same absolute value plus some rounding errors. Thus, it can easily happen, that the fourth eigenvalue is positive or negative, depending on the parameters.

You can use Max to plot the largest eigenvalue:

Plot3D[Max@Eigenvalues[H[0.1, 0.5, 0.7, 0.]], {x, -Pi, Pi}, {z, 0, 2 Pi}]

enter image description here

Alternatively, you may use the "Criteria" suboption of the Method "Arnoldi":

Plot3D[
  Eigenvalues[
   H[0.1, 0.5, 0.7, 0], -1, 
   Method -> {"Arnoldi", "Criteria" -> "RealPart"}
   ], 
  {x, - Pi, Pi}, {z, 0, 2 Pi}]
$\endgroup$
2
  • $\begingroup$ Thanks @ Henrik Schumacher $\endgroup$ Commented Apr 21, 2019 at 22:17
  • $\begingroup$ You're welcome. $\endgroup$ Commented Apr 21, 2019 at 22:40
4
$\begingroup$

Not sure why you pick the 4th element, but maybe this will help:

ev4 = Eigenvalues[H[p, q, r, s]][[4]] /. 
   Thread[{p, q, r, s} -> {0.1, 0.5, 0.7, 0}];
Plot3D[ev4, {x, -π, π}, {z, 0, 2 π}]

enter image description here

$\endgroup$
3
  • $\begingroup$ Thanks @ Michael E2, Is it possible to do this with an equation by the contourplot. Like ev4 = Eigenvalues[H[p, q, r, s]][[4]] /. Thread[{p, q, r, s} -> {0.1, 0.5, 0.7, 0}]; ContourPlot[ev4==-0.5, {x, -[Pi], [Pi]}, {z, 0, 2 [Pi]}]. In my case this is not working. $\endgroup$ Commented Apr 21, 2019 at 22:01
  • $\begingroup$ @HazoorImran Yes, but set the value -0.5 on the right hand side to something bigger. For example ContourPlot[ev4 == 2, {x, -\[Pi], \[Pi]}, {z, 0, 2 \[Pi]}]. $\endgroup$
    – Michael E2
    Commented Apr 21, 2019 at 22:09
  • $\begingroup$ Thanks @ Michael E2, Yes this work. $\endgroup$ Commented Apr 21, 2019 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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