Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. data[W_, q_, {xmin_, xmax_, dx_}] := Thread[Table[
  2. ({x, #} &) /@ Sort[ Eigenvalues[Energies[x, q, W]] ],
  3. {x, xmin, xmax, dx}]];
  4.  
  5. Energies[_, _, x_, y_] := SparseArray[
  6. {Band[{1, 2}] -> Cos[x] Sin[y], Band[{2, 1}] -> Cos[x] Sin[y]}
  7. , {3, 3}]
  8.  
  9. Plot3D[Evaluate @ Sort @ Eigenvalues @ Energies[W, q, x, y]
  10. , {x, 0, 1}, {y, 0, 1}
  11. , PlotPoints -> 10]
  12.  
  13. data[W_, q_, {xmin_, xmax_, dx_}, {ymin_, ymax_, dy_}] := Transpose[
  14. Flatten[
  15. Table[
  16. {x, y, #} & /@ Sort[Eigenvalues[Energies[W, q, x, y]]]
  17. , {x, xmin, xmax, dx}
  18. , {y, ymin, ymax, dy}]
  19. , {1, 2}]
  20. , {2, 1}]
  21.  
  22. Energies[_, _, x_, y_] := RandomReal[{-x, y}, {3, 3}]
  23.  
  24. data1[W, q, {0, 1, 0.05}, {-3, 3, 0.1}]
  25.  
  26. ListPlot3D[ data1[W, q, {0, 1, 0.05}, {-3, 3, 0.1}] ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement