# [Trilinos-Users] Strange eigen vectors in Anasazi

Davood Ansari david.ansari at gmail.com
Sat Mar 8 22:27:49 MST 2008

```Hi

I have been playing with this for a few days.
I found that the eigen values and eigen vectors obtained using LOBPCG
does not match to those found using other tools (mathematica and matlab).
Strangely I tired this for a very simple case:

A x = lambda B x

where

A= [
1.000e+00 -0.000e+00 0.000e+00
-0.000e+00 1.000e+00 0.000e+00
0.000e+00 0.000e+00 1.000e+00]

B=[
1.000e+00 0.000e+00 0.000e+00
0.000e+00 1.000e+00 -0.000e+00
0.000e+00 -0.000e+00 1.000e+00]

The eigen values for this case happened to be all right but the eigen
vectors are far from acceptable:

V1 =
-0.776427
0.000922122
-0.630206
V2 =
-0.365404
-0.815406
0.448992
V3 =
0.51346
-0.578889
-0.63344

Solver manager returned converged.
------------------------------------------------------
Eigenvalue   Direct Residual
------------------------------------------------------
1                 0
1                 0
1                 0
------------------------------------------------------

Well my code is a modification of the example LOBPCGEpetraExGen.cpp.
For the eigen vectors to be printed I do the following :

double ** EVECS = new double*[sol.numVecs] ;
for(int i = 0 ; i < sol.numVecs ; i++)
{
EVECS[i] = new double[(*A).RowMap().NumGlobalElements()] ;
}
evecs->Epetra_MultiVector::ExtractCopy(EVECS) ;

for(int i = 0 ; i < sol.numVecs ; i++)
{
printf("\n\tXXX %d *", i) ;
for(int j = 0 ; j < (*A).RowMap().NumGlobalElements() ; j++) cout<<
"\n\t" <<std::setw(16)<<  EVECS[i][j];
}

and I get those incorrect eigen vectors printed right away.
I guess I am unknowingly doing some thing wrong in there.

The LOBPCG parameters are:
which = "SM"
blockSize=3
maxIters=500
tol=1e-08