How to collect eigenvectors corresponding to only positive eigenvalues?
The method proceeds in two stages: use Eigensystem[]
to compute the set of eigenvalues and eigenvectors, and then use Pick[]
to retain the eigenvectors corresponding to the positive eigenvalues.
As a concrete example, take the Clement-Kac matrices:
ckmat[n_Integer?Positive] :=
SparseArray[{{i_, j_} /; Abs[i - j] == 1 :>
With[{k = Min[i, j]}, Sqrt[k (n - k)]]}, {n, n}]
Get the eigensystem for the $8\times 8$ case:
{vals, vecs} = Eigensystem[N[ckmat[8]]];
The desired eigenvector set can then be obtained as
Pick[vecs, Positive[vals]]
You can check that the right set was picked out by comparing the result of that with vals
and vecs
(keeping in mind that the eigenvectors are stored by rows).