[SciPy-dev] Please help!

Niall Moran niall.moran@gmail....
Thu Aug 20 04:52:46 CDT 2009


Hi,

I am trying to find the lowest eigenvalues and eigenvectors of a
sparse complex matrix using
scipy. I could not find any suitable looking routines in the stable
version 0.6.0 so I have compiled the
and installed the development version 0.8.0.dev5798 and have been
trying to use the scipy.sparse.linalg.eigen routine which calls the
relevant fortran arpack routines.
This is working great for real matrices but is not working for complex
matrices. Even when all the matrix
elements are real and the matrix is just of complex type. The error I get is
"RuntimeError: Error info=-9999 in arpack".
on line 224 of .../python2.6/dist-packages/scipy/sparse/linalg/eigen/arpack/arpack.py.

The matrix I am using is of type complex128 so the arpack function
called is znaupd
(http://www.caam.rice.edu/software/ARPACK/UG/node138.html). Looking at
the documentation for a return value of info=-9999

"= -9999: Could not build an Arnoldi factorization.
c                   User input error highly likely.  Please
c                   check actual array dimensions and layout.
c                   IPARAM(5) returns the size of the current Arnoldi
c                   factorization."

suggests a user input error is likely. IPARAM(5) has a value of 4. The
page for znaupd (linked above) gives details on the expected size and
type of each of the arguments. I have went through each of these in
the arpack.py file and checked to make sure the python code is
creating the correct size arrays and everything looks fine so I am at
a complete loss as to what is going wrong as the real version is
working fine.

The only thing I have been thinking is that maybe there is something
different about the way python and fortran store complex arrays and
maybe there is some problem in the crossover. Can anyone suggest how I
may debug this further?

Please see the attached source (test_complex.py) which creates a
simple 16x16 matrix with all real elements and tries to find the
eigenvalues when this is stored as a complex sparse matrix and when it
is stored as a real sparse matrix.

Niall.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_complex.py
Type: application/octet-stream
Size: 2699 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-dev/attachments/20090820/01565668/attachment.obj 


More information about the Scipy-dev mailing list