I need to find an eigenvector of a (numerically calculated) square matrix M
corresponding to the eigenvalue 0. The methods I know are
es=Eigensystem[M, -1]; Last@es
(I use Eigensystem instead of Eigenvectors, because I then can verify that the eigenvalue is indeed numerically 0, that is, I can catch programming errors in the calculation of the matrix; it is my understanding that this does not significantly add to the execution time. Am I right here?)
ns=NullSpace[M]; First@ns
However I believe both should give a complexity $O(N^3)$ (am I right here?)
The following I understand should be more efficient if it worked, but doesn't work because it gives the (valid, but useless) zero vector as result:
LinearSolve[M, Table[0, {Length@M}]]
So my question is:
Is there a more efficient solution to my problem? And if not, which of the two solutions I know is more efficient?
NullSpace[]
uses SVD under the hood; this is of course equivalent to eigendecomposition in the symmetric case, but not in general. So, for the symmetric case at least, the eigendecomposition looks to be the more efficient route, as it exploits structure. But you will need to do tests anyway to be sure… $\endgroup$