# Sort eigenvectors of a list of matrices

I have a list of matrices and want to obtain a list of eigenvectors and eigenvalues for each matrix, both sorted by the size of the eigenvalue. If I write system={eigenvalues, eigenvectors}, where eigenvalues is a list of lists of eigenvalues for each of the matrices, I would like to sort the eigenvectors by writing

Map[Sort[#, #1[[1]] < #2[[1]]] &, Transpose[system]]


of some sort, but this does nothing useful.

• Please provide system. Looks like you got some surplus & there as well. Commented Oct 13, 2014 at 11:39
• @ joe8: the function Eigensystem[m] gives you {List of eigenvectors, List of Eigenvalues}. You can use Norm[] to check the order of the eigenvectors. As far as I have seen in some examples they are ordered in descending order. Commented Oct 13, 2014 at 12:01
• @ybeltukov: I meant to sort by the size of the eigenvalue; corrected my mistake.
– joe8
Commented Oct 13, 2014 at 20:51
• @joe8 OK, now it is well posed problem. Do this answer your question? Commented Oct 13, 2014 at 20:54

Ordering[Norm /@ Last @ N[Eigensystem[system]]];


gives you the ordering by norm. You can apply this on your eigenvalues and eigenvectors, e.g.

Eigenvectors[system][[%]]


EDIT

To apply this on a list of matrices:

(# &@Ordering[Norm /@ N[#]]) & /@ Eigenvectors[#] & /@ {mat1,mat2,...,matn}

• this solutions seems to work for a single matrix, but not for a list of several matrices. I am unable to generalize it to my problem.
– joe8
Commented Oct 13, 2014 at 20:58
• I guess the questions then is whether Ordering can be used on sublists only.
– joe8
Commented Oct 13, 2014 at 21:06
• That should not be a huge problem; you can wrap the above in a function and then apply that to your list of matrices, but before I update my answer, please clarify if you want to sort the eigenvectors per matrix, or the matrixes based on their eigenvector norms. If the latter, can I assume sorting is based on largest eigenvector norm? Commented Oct 13, 2014 at 23:59
• I want to sort per matrix.
– joe8
Commented Oct 14, 2014 at 11:59
• updated to accommodate per matrix sorting. Commented Oct 14, 2014 at 12:34