# [SciPy-dev] lobpcg: removed symeig dependence

Nils Wagner nwagner@iam.uni-stuttgart...
Tue Apr 8 10:49:34 CDT 2008

```On Tue, 08 Apr 2008 15:58:56 +0200
Robert Cimrman <cimrman3@ntc.zcu.cz> wrote:
> Hi,
>
> so it is done, thanks again, Pearu, for your hint.
>
> could someone try on the fresh SVN version (4114):
>
> \$ cd
><your_path_to_scipy_sources>/scipy/sparse/linalg/eigen/lobpcg
> \$ python lobpcg.py
>
> the output should end with:
> [ 4.  5.  6.]
>
> r.

Hi Robert,

Works for me. Thank you very much !!

Cheers
Nils

Here is the full output

python lobpcg.py
/usr/lib/python2.4/site-packages/numpy/lib/utils.py:111:
DeprecationWarning: ('speye is deprecated, use
scipy.sparse.eye',)
warnings.warn(str1, DeprecationWarning)
Solving generalized eigenvalue problem with
preconditioning

matrix size 100
block size 3

3 constraints

iteration 0
current block size: 3
eigenvalue: [ 50.16603296  51.25237413  55.80526208]
residual norms: [ 28.41337687  28.73028907  29.82590999]
iteration 1
current block size: 3
eigenvalue: [  5.69942153   9.10470514  11.78759315]
residual norms: [ 5.60832687  7.51508501  7.88648963]
iteration 2
current block size: 3
eigenvalue: [ 4.13720512  5.45430399  7.66390996]
residual norms: [ 1.37078739  2.47960467  2.52320209]
iteration 3
current block size: 3
eigenvalue: [ 4.00936839  5.03454726  7.09804759]
residual norms: [ 0.38117189  0.71527311  2.20847017]
iteration 4
current block size: 3
eigenvalue: [ 4.00043005  5.00184096  6.27945283]
residual norms: [ 0.08700255  0.21163672  1.88467025]
iteration 5
current block size: 3
eigenvalue: [ 4.00000785  5.00006727  6.02517101]
residual norms: [ 0.01364081  0.03834687  0.59292732]
iteration 6
current block size: 3
eigenvalue: [ 4.00000012  5.00000191  6.00286877]
residual norms: [ 0.00155469  0.0072571   0.19477203]
iteration 7
current block size: 3
eigenvalue: [ 4.          5.00000006  6.00037219]
residual norms: [ 0.00020097  0.00111362  0.08918231]
iteration 8
current block size: 2
eigenvalue: [ 4.          5.00000001  6.00004161]
residual norms: [  3.24468469e-05   3.10698977e-04
2.47415455e-02]
iteration 9
current block size: 1
eigenvalue: [ 4.          5.          6.00000402]
residual norms: [  1.44290611e-05   8.30172695e-05
9.47072140e-03]
iteration 10
current block size: 1
eigenvalue: [ 4.          5.          6.00000052]
residual norms: [  1.42516389e-05   7.25968963e-05
2.56545826e-03]
iteration 11
current block size: 1
eigenvalue: [ 4.          5.          6.00000015]
residual norms: [  1.39884037e-05   7.28790926e-05
9.90709310e-04]
iteration 12
current block size: 1
eigenvalue: [ 4.          5.          6.00000005]
residual norms: [  1.38176556e-05   7.11253299e-05
6.92343064e-04]
iteration 13
current block size: 1
eigenvalue: [ 4.          5.          6.00000001]
residual norms: [  1.40526840e-05   7.49691661e-05
4.12650573e-04]
iteration 14
current block size: 1
eigenvalue: [ 4.  5.  6.]
residual norms: [  1.38113346e-05   6.82994247e-05
1.00085913e-04]
iteration 15
final eigenvalue: [ 4.  5.  6.]
final residual norms: [  1.37083440e-05   6.79150257e-05
4.57570552e-05]
solution time: 0.18
[[  0.00000000e+00   0.00000000e+00   0.00000000e+00]
[  0.00000000e+00   0.00000000e+00   0.00000000e+00]
[  0.00000000e+00   0.00000000e+00   0.00000000e+00]
[ -1.00000000e-00  -2.70166100e-12  -4.49407572e-13]
[  3.45135382e-12  -1.00000000e-00  -3.31004270e-11]
[  1.43272265e-12   4.16009456e-11  -1.00000000e-00]
[ -3.01389337e-08   1.04266891e-09  -2.03536622e-06]
[ -2.09568203e-07  -1.60001860e-06  -4.27908244e-06]
[ -1.34192993e-07   8.93748787e-08   1.11527829e-06]
[ -9.54056973e-09   1.65761534e-08  -7.28293414e-07]
[  5.80623027e-08  -6.78924269e-07   1.28523801e-07]
[  2.46652882e-08   2.81056345e-07   8.41732884e-07]
[ -2.81842377e-07   2.11865121e-07  -5.11925778e-07]
[  3.79119237e-08  -4.94179195e-07  -9.66429188e-07]
[  3.87690758e-07   7.47167491e-07   1.46782419e-08]
[ -2.78202949e-08  -1.26548930e-06   4.29164218e-07]
[  1.59183735e-07   1.61269484e-06   7.67351913e-07]
[ -1.98747612e-08  -5.08476559e-07  -2.03110237e-08]
[ -2.06671565e-07   4.88730427e-08   1.59871138e-07]
[  5.27846912e-08   1.83780694e-07  -5.21864962e-07]
[ -2.77838525e-08   4.18872863e-08  -4.20896367e-07]
[  8.03607930e-09   2.21719430e-07   1.74850575e-08]
[ -6.65735713e-08  -9.96554778e-08  -2.66443931e-07]
[ -5.86778608e-09   3.58000119e-07   5.33751877e-08]
[ -7.04258383e-08  -1.11932530e-06  -2.46227247e-07]
[  1.39589354e-08  -2.44617669e-07  -1.19422327e-07]
[ -8.78909615e-09  -1.21292653e-07   2.67872685e-07]
[ -4.36250627e-08  -2.18902034e-07   3.97840323e-07]
[  8.33167577e-08  -5.12521808e-07  -2.32577046e-07]
[  1.91312002e-08  -8.86341001e-08   1.51961315e-07]
[ -3.77761175e-08   2.11412046e-08   3.88146759e-07]
[  1.25522710e-07  -3.78933326e-07  -2.14288715e-08]
[ -1.13179554e-09  -1.30570575e-07   1.01778213e-07]
[  1.62448418e-08   3.44350353e-08  -2.75283159e-08]
[  1.71774982e-08  -2.20277907e-07   3.82335074e-08]
[ -2.62120118e-08  -1.77989065e-07  -1.19618064e-07]
[ -4.28509480e-08  -3.11927590e-07  -1.61041412e-07]
[ -1.42879894e-08  -2.01377283e-07  -1.58396601e-07]
[  4.55012564e-08   2.81283225e-07   6.95463005e-08]
[  3.01461234e-09   2.47687731e-07   3.22956377e-08]
[  1.49037369e-09   8.06908264e-08   2.08576615e-08]
[ -1.76935675e-08   1.27197878e-08  -9.27809622e-08]
[ -2.21573205e-08   2.36424514e-07   4.14499817e-08]
[ -2.25901032e-09   8.98625917e-08   9.71048798e-08]
[ -1.19762775e-08   1.66612827e-08   2.99754656e-08]
[  3.58501864e-08  -2.85612797e-07  -8.90575990e-09]
[ -1.01618372e-08   1.89155074e-08  -1.92595357e-08]
[ -9.79953541e-09  -3.66627417e-08   4.34605597e-08]
[ -8.81422746e-08   3.25839765e-07   5.96807928e-08]
[ -5.28638450e-08   1.41856053e-07   3.45967672e-08]
[ -5.18085576e-08   6.93031478e-08   8.80196848e-08]
[ -1.52218053e-08  -1.37899359e-07   1.04478564e-07]
[ -2.69589941e-08  -5.93106849e-08   1.08700966e-07]
[ -3.53545293e-08   8.19458663e-08   7.20559393e-08]
[  1.45946266e-09   3.31589157e-08   5.47101871e-08]
[ -5.57443827e-10  -4.21819711e-08   2.67719546e-08]
[ -3.55174528e-08   8.36400386e-08   9.51545029e-08]
[  3.24829200e-09   6.65526482e-08   4.00465143e-08]
[  1.34456481e-08  -6.03579314e-08   1.58145041e-07]
[  1.94699367e-08  -9.97358384e-08   1.70036092e-07]
[ -1.15524633e-08  -2.12045092e-07   1.10068499e-07]
[  8.07683355e-09   1.26033397e-08   8.47700021e-08]
[ -8.97404149e-09  -4.63495668e-08   4.12649793e-09]
[ -7.26964073e-09  -1.76366897e-07   1.10018048e-07]
[ -2.79732271e-09  -6.42588660e-08  -1.74486154e-08]
[  4.36118457e-09  -9.54737197e-08  -2.61915884e-09]
[ -5.51719031e-09  -1.50083864e-07   8.42135138e-09]
[ -2.44170002e-09  -1.35763732e-07  -3.17630000e-08]
[  1.58753411e-08  -5.95644323e-08  -1.26448328e-08]
[ -9.60388044e-09  -3.16397182e-08   7.64129944e-08]
[  1.63884199e-08  -7.09138585e-08   1.62298772e-08]
[  1.57829668e-09  -2.45320884e-08   2.00587307e-08]
[ -2.00664528e-09  -1.73441494e-08   2.94430307e-08]
[  2.43650546e-08  -9.48698823e-08  -1.84003993e-08]
[ -8.54173260e-09   1.19209149e-08   2.76477653e-08]
[ -1.81906746e-08   6.75961095e-08   5.55658348e-08]
[ -1.91225406e-08   4.44607252e-08   1.76471499e-08]
[  3.59126559e-08  -9.07891824e-08   3.30484683e-09]
[ -1.49658559e-08   5.63993043e-09  -1.19076779e-08]
[  4.59041803e-08  -1.35202754e-07   1.62406623e-09]
[  1.89965469e-08  -5.78088704e-08  -6.41497552e-09]
[  1.14943654e-09  -6.67217334e-08  -2.91756305e-08]
[  2.13037665e-08  -9.37118168e-08  -5.55942868e-09]
[ -9.19599377e-09   1.04534807e-07  -7.11401211e-09]
[  1.90727833e-08  -1.79862773e-07  -9.87066470e-09]
[  3.76495941e-08  -2.04832062e-07   2.31035468e-08]
[  9.00764569e-09  -1.21537959e-07   1.19765925e-08]
[ -1.93891210e-09  -3.68929944e-08  -1.34838406e-08]
[  1.08746120e-08  -3.10136621e-08   1.06506222e-08]
[ -9.79450248e-10   1.70759840e-08  -1.22923235e-08]
[ -5.38118244e-09   1.31639610e-07  -9.29980232e-08]
[ -9.87081445e-10   1.17067886e-08  -4.15305552e-09]
[ -5.25364357e-09   3.43422921e-08   1.57743361e-08]
[ -8.88358916e-09  -5.62225135e-08   8.34315725e-08]
[ -6.18017047e-09  -7.98718649e-09   3.50353549e-08]
[  4.98672743e-09   1.26197815e-07   5.40157214e-08]
[ -5.11599732e-08  -6.47092989e-08   2.17719994e-07]
[  2.72320287e-09  -3.24432174e-08  -1.43940020e-07]
[ -3.17446906e-09  -3.00975281e-08  -9.30229880e-08]
[  7.62584618e-09   1.00928621e-07   8.24283838e-08]]
[ 4.  5.  6.]
```