4

I am trying to find Eigenvalues to a 12x12 Matrix ($H$) dependent on two variables $x$ and $y$. Later I want to do a 3D plot of one eigenvalue ($E$) over $x$ and $y$.

An analytical solution is not possible so what I calculate a Table of numerical solutions and a ListPlot:

Solution = Table[
              Table[{x, y, N[Eigenvalue[H[x, y]]][[E]]}, {x, 0, 1}, {y, 0, 1}], 
              {E, 1, 12}
           ];

ListPlot3D[{Solution[[1]]}]

My Problem: apparently every time the eigenvalues to $H$ for a specific $x$ and $y$ is found, the order of eigenvalues is not the same as before. So if I do the ListPlot3D[{Solution[[1]]}] I don't actually plot the eigenvalue 1 of $H$ but points of different eigenvalues of $H$.

So my question: How can I assign an order to my eigenvalues so that I know which value belongs to which eigenstate?

(Here you can find a link to the 12x12 matrix: http://pastebin.com/kUX4gdk8)

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Manuel
  • 41
  • 1
  • 3
  • 2
    Please share your 12x12 matrix as well. Also, take a look at (59172), (63003), and (25743). – MarcoB Jun 12 '16 at 18:28
  • The matrix is to long by 8400 characters... The matrix is hermitian with constants on the diagonal and big expressions depending on x and y on the off diagonal elements. The proposed answers seam only to order the eigenvalues depending on their values which does not help me. – Manuel Jun 12 '16 at 22:02
  • 1
    You should add your matrix to your original question (use the edit link underneath it) or, perhaps preferentially, paste it somewhere online (e.g. pastebin) and provide a link to download it. – MarcoB Jun 12 '16 at 23:55
  • 1
    related http://mathematica.stackexchange.com/q/83906/2079 – george2079 Jun 13 '16 at 01:50
  • @george2079 I got the exact same problem but in a 3D situation. I have dificulties understanding and complete the code for the 3D situation. How long will this calculation approximatly take? (10 minutes or 3days?) – Manuel Jun 13 '16 at 08:40
  • Related: this answer. The technique described there may be painfully slow in your case, but it may be the best you can do. – Michael Seifert Jun 13 '16 at 14:27

1 Answers1

2

Eigenvalues are ordered by their magnitude in general. If you want to preserve the order all over the region, the only way (as much I know) is to try to get an analytical expression. For example consider this simple matrix

H[x_, y_] = {{0, Cos[x] + Cos[y]}, {Cos[x] + Cos[y], 0}} 

If I go with analytical expression

ev = Eigenvalues[H[x,y]];
Plot3D[Evaluate[ev], {x, -2, 2}, {y, -2, 2}]

enter image description here

The eigenvalues are properly ordered. But if you try to evaluate it numerically. It will always be reordered.

data = Flatten[ Table[Join[{x, y}, Eigenvalues[H[x, y]] // N]
   , {x, -2, 2, 0.1}, {y, -2., 2., 0.1}], 1];
data1 = Table[data[[All, {1, 2, 2 + n}]], {n, 2}];
ListPlot3D[data1]

enter image description here

Sumit
  • 15,912
  • 2
  • 31
  • 73
  • I believe that the OP is interested in the case where the surfaces intersect one another. – bbgodfrey Jun 13 '16 at 12:37
  • Yes indeed. surfaces might inteesct or even be degenerate for a volume in space – Manuel Jun 13 '16 at 12:56
  • I just took a simple matrix for example. The algorithm will work for any matrix. For a simple case try H[x_, y_] = {{0, Cos[x] + Cos[y]}, {Cos[x] + Cos[y], 0}}. – Sumit Jun 13 '16 at 13:07
  • This method has no use for me because I need to see the real development of one Eigenvalue. Intersections and the right color coding is essential for the interpretation of my results. – Manuel Jun 13 '16 at 13:38