# Sorting eigenvalues by the dominant contribution

[Edited to simplify the question]

I am trying to associate the eigenvalues $E$ of a matrix $H$ to the original rows of the matrix.

Moreover, it would be trivial to sort the eigenvalues in ascending order, however this throws away some of the information. For my purpose the matrix is a Hamiltonian where the different rows have physical meaning. I always want the eigenvalue that corresponds to a given row.

I have tried to sort the eigenvalues according to the dominant contribution. To do this I get the magnitudes of the eigenvectors (they are complex) for each row and pick the largest. I use this index to sort the eigenvalues.

# Get eigenvalues and vector of the Hamiltonian
E, V = eig(H)

# Now sort the eigenvalues by dominant contribution
sorted_order = []
for i in range(len(E)):
row = V[i,:]
row = np.absolute(row)           # length of complex number <-- correct?
largest_index = np.argmax(row)   # the index of the largest value
sorted_order.append(largest_index)

E_sorted = E[sorted_order]


The sorting approach works fairly well when the eigenvector matrix is dominated by the diagonal. However, if the matrix is more homogeneous the this sorting method fails.

This leads me to believe that my method of sorting is probably incorrect. Or I am running in to accuracy issues with the eig function.

Does anyone have suggestion on an alternative way to sort by the dominant contribution?

## Background

I am doing a $\mathbf{k}\cdot\mathbf{p}$ simulation for semiconductor band structure. The eigenvalues for the $\mathbf{k}\cdot\mathbf{p}$ Hamiltonian (the 8x8 matrix below) corresponds to the different semiconductor bands and the eigenvectors are the wavefunctions. (NB I have removed two rows and columns because I am not interested in their effect for by purpose.) Figure: In the plot the y-axis is the eigenvalues, the x-axis corresponds to a k-space vector which changes values in the Hamiltonian. A definition: at $k=0.5$ the system is unperturbed and the eigenvectors are dominated by the diagonal terms. This also illustrates why I cannot do a simple energy sort: because at some points the bands cross. The bands have different physical meaning which I want to preserve.

Comment. The sorting approach (the Python code above) works fairly well when $k=0.5$ because the contribution is dominated by the diagonal of the eigenvectors. However, moving away from the centre of k-space ($k>0.5$ and $k<0.5$) the eigenvector matrix becomes more homogeneous and this method of sorting fails. I am surprised that it is failing intermittently.

• What's the goal here? – Bill Barth Feb 5 '14 at 11:50
• Well actually physics. I had written a more physics type question (an earlier version) which explain the background. Basically I am solving a k.p hamiltonian and I want to be able to attribute its eigenvalues (the semiconductor bands) to a particular row in the Hamiltonian, where the row indicated how I should interpret the eigenvalue; i.e. it's a conduction band, valence band etc. Maybe I can reinstate some of the physics. – boyfarrell Feb 5 '14 at 12:38
• I don't think it works that way. The eigen-decomposition for your presumably Hermitian matrix gives you a basis for $\mathbb{C}^n$ in which you can represent your right-hand side and solution. Each eigenvalue can only really be said to attribute anything to its associated eigenvector(s). That being said, you should be able to look at the eigenvectors associated with the eigenvalues that interest you and say something about which physical bands they are associated with. – Bill Barth Feb 5 '14 at 14:35
• Thanks for the comments. I interpret this to mean that the wavefunctions by the very nature are mixed in character (they have components from all 8 bands), so there is not a unique band. I'm trying to get a method that associates the eigenvalues to the physical bands by the dominant contribution. For each band I have been using the largest $|\Psi_j|^2$ in each row (where $j$ is the row index) maybe that method is floored? Maybe there is another way to associate the eigenvalues with a band? Any clever ideas? – boyfarrell Feb 5 '14 at 15:25
• What do the eigenvectors associated with the largest (in magnitude) eigenvalues look like? Do those give you the "bands". I'm not a semiconductor person, so I'm not sure what a band is. – Bill Barth Feb 5 '14 at 16:04