New answers tagged

0

This is how you can do what you are asking for. np = 6 (*no of k points*) ne = 8 (*no of bands*) norm = Table[ Map[Norm[#] &, (data[[i, 2]] - data[[i - 1, 2]])], {i, 2, np}]; norm = Join[{Range[ne]}, norm]; (*norm contains Norm of difference between the eigen vectors. you can use some other quantity as well *) data1 = Map[Transpose[Join[{data[[#, 1]...


4

Make a list of your matrices, called myMatrices, and then: SortBy[myMatrices, -Norm[#]&] or Reverse@SortBy[myMatrices, Norm]


7

What I think you are asking for can be achieved by 1) pairing up the values in the two rows (using Transpose) 2) Sorting by the First value in each pair using SortBy 3) Unpairing, again using Transpose. Specifically lists = {{2, 1, 0, 2}, {2, 1, 2, 0}} SortBy[Transpose[lists], First] // Transpose



Top 50 recent answers are included