TransWikia.com

Plotting Eigenvalues and severe Noise Problems

Mathematica Asked on June 1, 2021

I am trying to plot Eigen values of my System Hamiltonian in Mathematica. This is generating very noisy plot.
This is my code.

ϵ = 0;
A[α_, c_, b_, q_] := ϵ + 
2*Cos[k2*b + 2*π*α]*Exp[-π 1/(2*q)]*
LaguerreL[c, 0, (π*1/q)]
B[a_, q_] := Exp[I*k1*q*a]
B1[a_, q_] := Exp[-I*k1*q*a]
b[α_, q_] := 
SparseArray[{Band[{1, 1}] -> A[α, 0, 1, q], 
Band[{1, 2}] -> B[1, q], Band[{2, 1}] -> B1[1, q], 
Band[{1, q}] -> B1[1, q], Band[{q, 1}] -> B[1, q]}, {q, q}];
Plot3D[Eigenvalues[b[1, 3]][[2]], {k1, -3, 3}, {k2, -π, π}]

enter image description here

This is not even correct. Since this is mixing different eigen values solutions.
Any help will be highly appreciated.

One Answer

So my first step was to redefine your functions as such:

ClearAll[A,ε,B,B1,b];

A[α_, c_, b_, q_, ε_][k2_]:=ε + Cos[k2*b + 2*Pi*α]*Exp[-Pi 1/(2*q)]*LaguerreL[c, 0, (Pi*1/q)];

B[a_, q_][k1_]:=Exp[I*k1*q*a];

B1[a_, q_][k1_]:=Exp[-I*k1*q*a];

b[α_, q_][k1_,k2_] :=
SparseArray[{Band[{1, 1}] -> A[α, 0, 1, q, 0][k2],
Band[{1, 2}] -> B[1, q][k1], Band[{2, 1}] -> B1[1, q][k1],
Band[{1, q}] -> B1[1, q][k1], Band[{q, 1}] -> B[1, q][k1]}, {q, q}];

Then I could plot using the following:

Plot3D[Sort[Eigensystem[N[b[1,3][k1,k2]]][[1]]][[2]],{k1,-3,3},{k2,-Pi,Pi},PlotPoints->50]

Which gives:

Plot3D produced by above code.

Similarly,

Plot3D[Sort[Eigenvalues[N[b[1,3][k1,k2]]]][[2]],{k1,-3,3},{k2,-Pi,Pi},PlotPoints->50]  

And

Plot3D[Sort[Eigenvalues[b[1,3][k1,k2]]][[2]],{k1,-3,3},{k2,-Pi,Pi},PlotPoints->50]

Both give the same output due to their use of Sort.

However,

Plot3D[Eigensystem[N[b[1,3][k1,k2]]][[1]][[2]],{k1,-3,3},{k2,-Pi,Pi},PlotPoints->50]

Gives the disconnected & severely noisy plot

Noisy Plot3D of the above code that does not use Sort.

And this is due to the lack of use of Sort. We can also see this same output with:

Plot3D[Eigenvalues[N[b[1,3][k1,k2]]][[2]],{k1,-3,3},{k2,-Pi,Pi},PlotPoints->50]

And

Plot3D[Eigenvalues[b[1,3][k1,k2]][[2]],{k1,-3,3},{k2,-Pi,Pi},PlotPoints->50]

Which both produce the same noisy & mixed eigenvalue plot seen previously.

If this is not what you are looking for, please, let me know? I hope this helps!


After realizing an error in translating OP’s initial codeblock, the following no longer applies:

You might also speed up your matrix assembly by observing that your setting of ε = 0 makes the diagonal go to 0, which could prevent the need to do such extraneous computations when assembling runs of your matrices.


Tl;dr: Using Sort is key to helping eliminate the noise that was present.

Correct answer by CA Trevillian on June 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP