# Noise in Eigenvalues plot

Mathematica Asked by Hazoor Imran on December 7, 2020

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 π}]


Any help will be highly appreciated.

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 π}]


Answered by Michael E2 on December 7, 2020

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[[email protected][H[0.1, 0.5, 0.7, 0.]], {x, -Pi, Pi}, {z, 0, 2 Pi}]


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}]


Answered by Henrik Schumacher on December 7, 2020

## Related Questions

### How to have a common input for different nb file

1  Asked on December 7, 2021

### Mean of ItoProcess

0  Asked on December 7, 2021

### How to generate non interfering SVGs (Cloud embedded)?

1  Asked on December 7, 2021

### Numerical Integration of MeijerG function in the form MeijerG[{{-2,-8.5,-3.5},{}},{{0},{-1.5}},theta]

1  Asked on December 7, 2021

### Using NIntegrate to reproduce NProbability over joint Gaussian distribution

1  Asked on December 6, 2021

### Twisted Bilayer Graphene Mathematica Plots

1  Asked on December 6, 2021

### FileNames becomes extremely slow when there are large number of files under a directory

1  Asked on December 6, 2021

### How to find all sets of elements smaller than another group

2  Asked on December 6, 2021

1  Asked on December 2, 2021

### Using functions instead of lists in physics numerical problems

1  Asked on December 2, 2021

### Evaluate function at “good” points used by Plot in numerical problems

2  Asked on December 2, 2021

### How to multiply the elements of each site of tensor products to each other while using symbolic representation?

1  Asked on November 30, 2021

### How to discretize a parametric polar surface ensuring the correct periodicity of the mesh

3  Asked on November 30, 2021

### Correcting error messages emitted by ListPlot

1  Asked on November 28, 2021

### Mathematica v 12.1.1.0 FrontEnd Autoformatting Bug (?)

2  Asked on November 28, 2021

### How to solve a nonlinear second order ODE

2  Asked on November 28, 2021

### Derivation of Interpolation function

0  Asked on November 28, 2021

### Finding 36 integer solutions to a set of 14 equations using various boundary conditions

2  Asked on November 25, 2021

### Show Graphics on top of ParametricPlot3D

1  Asked on November 25, 2021

### How to write to a VARBINARY field using a stored procedure

0  Asked on November 25, 2021