3

My matrix $M$ is huge, but I know that $1$ is an eigenvalue.

I need to extract the corresponding eigenvector, which corresponds to this eigenvalue $\lambda=1$.

There could be $1000$ other eigenvalues, but I need only to know what happens for $\lambda=1$

I currently set up an if procedure, which evaluates all 1000, checks if it's eigenvalue is 1, if true then print the result. However this is taking forever to run for big matrices.

Can somebody help me out with an efficient code? I should use the LinearAlgebra[EigenVectors] command.

I was thinking something along eval (eigenvalue - 1)<0.01, then evaluate the vector. But I can't seem to put it into code.

GRS
  • 2,495
  • Just compute the null space of $A-I$... – user251257 Mar 26 '16 at 03:40
  • not sure if it helps but I had a similar issue recently: I solved it by doing it in python using numpy instead, which returns as a list and is far easier to perform fast searches – Alexander McFarlane Mar 26 '16 at 06:35
  • @user251257 thanks, I think I will endup doing it this way, I was wondering if there is an Eigenvector command to do this – GRS Mar 26 '16 at 09:57
  • @AlexanderMcFarlane I need to use maple :) Anyway I think I will just do it using nullspace – GRS Mar 26 '16 at 09:58

1 Answers1

1

An implementation of the nullspace approach suggested by user251257 is simply:

use LinearAlgebra in v := NullSpace(M-IdentityMatrix(RowDimension(M))) end use;

Another, costlier approach is to use the output=list version of Eigenvectors; of course, this is only worth doing if you need to associate many or all eigenvalues with their corresponding eigenvectors.

From the help page for LinearAlgebra:-Eigenvectors:

The format in which the Eigenvectors of A are returned is determined by parameter out. By default, an expression sequence is returned as described above. In the case that the output is specified as list, a list of lists is returned. The first element of each sublist is an eigenvalue, the second element is its multiplicity, and the third element is a set of linearly independent eigenvectors corresponding to that eigenvalue.

So compute Eigenvectors(M, output=list), and process the result elementwise. To find the eigenvector corresponding an eigenvalue of 1, just find the sublist whose first element is 1.

saforrest
  • 116