I’m trying to look at the evolution of the eigenvalues of a matrix as a function of magnetic field. My problem is that the eigenvectors are not ordered according to their eigenvector. I can sort these for a particular magnetic field value but I haven’t been able to extend this to include a table of values of the magnetic field and get this to work. The code I have is
{evals, evecs} = Eigensystem[H[1, 0, Pi/2, 0, 2/3, 0.004, 0.042]]; list1 = Partition[Riffle[evals, evecs], 2]; list2 = Sort[list1, #1[[1]] < #2[[1]] & ];
where H[] is a Hamiltonian I have defined, where one of the inputs (the second input) is the value of the magnetic field. I want something where I have a table of how each individual eigenvalue of a specific eigenvector evolves, i.e.
{evals, evecs} = Table[Eigensystem[H[1, B, Pi/2, 0, 2/3, 0.004, 0.042]],{B,0,5}]; list1 = Partition[Riffle[evals, evecs], 2]; list2 = Sort[list1, #1[[1]] < #2[[1]] & ];
I understand that this doesn’t work because of how the list is defined but I want to write some code that does the equivalent of this.