[SciPy-User] scipy.sparse.linalg.lobpcg broken?

josef.pktd at gmail.com josef.pktd at gmail.com
Wed Oct 13 10:29:27 EDT 2010


On Wed, Oct 13, 2010 at 10:21 AM, Nico Schlömer
<nico.schloemer at gmail.com> wrote:
> Hi,
>
> I thought I give lobpcg a shot, and tried
>
> ====================== *snip* ======================
> from scipy.sparse.linalg import lobpcg
> from scipy.sparse import identity
> import numpy as np
>
> n = 10
> X = np.zeros( (n,1) )
> A = identity( n )
> lobpcg( A, X )
> ====================== *snap* ======================
>
> On my machine, this yields
>
> ====================== *snip* ======================
> Traceback (most recent call last):
>  File "logpcg_test.py", line 8, in <module>
>    lobpcg( A, X )
>  File "/usr/lib64/python2.6/site-packages/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py",
> line 304, in lobpcg
>    blockVectorX, blockVectorBX = b_orthonormalize( B, blockVectorX )
>  File "/usr/lib64/python2.6/site-packages/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py",
> line 130, in b_orthonormalize
>    gramVBV = sla.cholesky( gramVBV )
>  File "/usr/lib64/python2.6/site-packages/scipy/linalg/decomp_cholesky.py",
> line 66, in cholesky
>    c, lower = _cholesky(a, lower=lower, overwrite_a=overwrite_a, clean=True)
>  File "/usr/lib64/python2.6/site-packages/scipy/linalg/decomp_cholesky.py",
> line 24, in _cholesky
>    raise LinAlgError("%d-th leading minor not positive definite" % info)
> numpy.linalg.linalg.LinAlgError: 1-th leading minor not positive definite
> ====================== *snap* ======================
>
> Fail!
>
> Am I missing a library, or is that routine broken?

It looks like a bug if X is all zeros. If at least 1 element of X is
non-zero, it seems to work.

Josef

>
> Cheers,
> Nico
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



More information about the SciPy-User mailing list