2

I have a huge sparse matrix and I want to have the smallest eigenvalue and its corresponding eingenvector. I use this code (a used a smaller matrix for the example):

A = {{1,0,0},{0,-2,0},{0,0,5}};
{val,vec}  = Eigensystem[A,-1];
Print[val];
Print[vec];

I want to have -2 and {0,1,0} as output, but instead I get the eigenvalue with the lowest magnitude, here 1 and {1,0,0}. Is there a way to get the eigenvalue with the lowest value?

Henry
  • 21
  • 1
  • Surprisingly, the "Criteria" suboption seems to be completely ignored in the exact case... – J. M.'s missing motivation Mar 18 '16 at 12:29
  • @Henry Do you mean something like this {m = Min[val], vec[[Position[val, m][[1, 1]]]]} – Dr. Wolfgang Hintze Mar 18 '16 at 12:53
  • First@Sort[Transpose[Eigensystem[A]]] – george2079 Mar 18 '16 at 14:00
  • (1) Pick a value that is larger than the most negative eigenvalue (use whatever convenient bound). (2) Find the eigenvalue closest to its negative. I'll show this with 10 as my choice. `In[1705]:= A = {{1, 0, 0}, {0, -2, 0}, {0, 0, 5}}; {val, vec} = Eigensystem[A + 10*IdentityMatrix[3], -1] + {-10, 0}

    Out[1706]= {{-2}, {{0, 1, 0}}}`

    – Daniel Lichtblau Mar 18 '16 at 15:47
  • Alternatively and maybe more reliably: `In[1709]:= A = {{1, 0, 0}, {0, -2, 0}, {0, 0, 5}}; {val, vec} = Eigensystem[A - 10*IdentityMatrix[3], 1] + {10, 0}

    Out[1710]= {{-2}, {{0, 1, 0}}}` (I'd figure out which is the better way to go about this, but I need more coffee...)

    – Daniel Lichtblau Mar 18 '16 at 15:50

1 Answers1

1

What about this?

This is your matrix.

A = {{1, 0, 0}, {0, -2, 0}, {0, 0, 5}};

We consider a table of all eigenvalues, and then find the position of minimum.

myDesiredPosition = Position[Eigenvalues[A], Min[Eigenvalues[A]]];

From eigenvectors table, we call the one corresponding to position calculated in previous step.

Eigenvectors[A][[myDesiredPosition[[1]]]]
Fierce82
  • 543
  • 1
  • 4
  • 14