integration of symeig in SciPy
![](https://secure.gravatar.com/avatar/158d7ca423031a69f866131f36994fab.jpg?s=120&d=mm&r=g)
Dear SciPy devs, there has been some discussion about integrating symeig in SciPy. symeig <http://mdp-toolkit.sourceforge.net/symeig.html> is a Python wrapper for the LAPACK functions to solve the standard and generalized eigenvalue problems for symmetric (hermitian) positive definite matrices. It is superior to the scipy "linalg.eigh" wrapper because it wraps *all* relevant LAPACK routines, enabling for example to just return a subset of all egenvectors/eigenvalues, which is a killer feature if you are dealing with huge-nonsparse matrices. Some of these LAPACK routines are available in scipy.lib.lapack.flapack and can be accessed through scipy.lib.lapack.get_lapack_funcs . Some of them are still missing in scipy, while symeig offers a unified interface to all relevant LAPACK functions. symeig has been dowloaded more than 1300 times since its first public appearance on sourceforge (under the mdp-toolkit package) in 2004. It features a complete unit test and a telling doc-string. I am one of the authors of symeig and have been contacted by some scipy devs to discuss the integration of symeig in scipy. I am more than willing to help doing this. The most difficult part (the LGPL license) has been addressed already: I've re-issued symeig under a BSD license. Next step would be to adapt symeig code and tests to the scipy framework. Some questions to you: - where would you like to have symeig? (I would suggest scipy.linalg) - should we change the signature to match or resamble that of other eigenproblem-related functions in scipy? - is there a responsible scipy dev for the linalg package I can bother with any questions I may have in the process? - do I get svn commit rights or should I work on a local copy and send a patch? let me know, tiziano
![](https://secure.gravatar.com/avatar/764323a14e554c97ab74177e0bce51d4.jpg?s=120&d=mm&r=g)
On Thu, Oct 23, 2008 at 11:04, Tiziano Zito <opossumnano@gmail.com> wrote:
Dear SciPy devs,
there has been some discussion about integrating symeig in SciPy. symeig <http://mdp-toolkit.sourceforge.net/symeig.html> is a Python wrapper for the LAPACK functions to solve the standard and generalized eigenvalue problems for symmetric (hermitian) positive definite matrices. It is superior to the scipy "linalg.eigh" wrapper because it wraps *all* relevant LAPACK routines, enabling for example to just return a subset of all egenvectors/eigenvalues, which is a killer feature if you are dealing with huge-nonsparse matrices. Some of these LAPACK routines are available in scipy.lib.lapack.flapack and can be accessed through scipy.lib.lapack.get_lapack_funcs . Some of them are still missing in scipy, while symeig offers a unified interface to all relevant LAPACK functions. symeig has been dowloaded more than 1300 times since its first public appearance on sourceforge (under the mdp-toolkit package) in 2004. It features a complete unit test and a telling doc-string. I am one of the authors of symeig and have been contacted by some scipy devs to discuss the integration of symeig in scipy. I am more than willing to help doing this. The most difficult part (the LGPL license) has been addressed already: I've re-issued symeig under a BSD license. Next step would be to adapt symeig code and tests to the scipy framework. Some questions to you:
- where would you like to have symeig? (I would suggest scipy.linalg)
Yup.
- should we change the signature to match or resamble that of other eigenproblem-related functions in scipy?
Probably.
- is there a responsible scipy dev for the linalg package I can bother with any questions I may have in the process?
You can bother the list.
- do I get svn commit rights or should I work on a local copy and send a patch?
We'll get you commit rights. Thanks! I'm looking forward to seeing this in scipy. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
![](https://secure.gravatar.com/avatar/573ed3088eea742af8bcfeac90bc882d.jpg?s=120&d=mm&r=g)
Tiziano Zito wrote:
Dear SciPy devs,
there has been some discussion about integrating symeig in SciPy. symeig <http://mdp-toolkit.sourceforge.net/symeig.html> is a Python wrapper for the LAPACK functions to solve the standard and generalized eigenvalue problems for symmetric (hermitian) positive definite matrices. It is superior to the scipy "linalg.eigh" wrapper because it wraps *all* relevant LAPACK routines, enabling for example to just return a subset of all egenvectors/eigenvalues, which is a killer feature if you are dealing with huge-nonsparse matrices. Some of these LAPACK routines are available in scipy.lib.lapack.flapack and can be accessed through scipy.lib.lapack.get_lapack_funcs . Some of them are still missing in scipy, while symeig offers a unified interface to all relevant LAPACK functions. symeig has been dowloaded more than 1300 times since its first public appearance on sourceforge (under the mdp-toolkit package) in 2004. It features a complete unit test and a telling doc-string. I am one of the authors of symeig and have been contacted by some scipy devs to discuss the integration of symeig in scipy. I am more than willing to help doing this. The most difficult part (the LGPL license) has been addressed already: I've re-issued symeig under a BSD license. Next step would be to adapt symeig code and tests to the scipy framework. Some questions to you:
This is really good news. I had to use the missing functions directly via scipy.lib.lapack.get_lapack_funcs which was not very convenient. For example the lobpcg sparse eigensolver requires the symmetric routines. Thank you! r.
![](https://secure.gravatar.com/avatar/fc2baa22f0b0e9fc8dc93733cb94103c.jpg?s=120&d=mm&r=g)
Tiziano Zito wrote:
Dear SciPy devs,
there has been some discussion about integrating symeig in SciPy. symeig <http://mdp-toolkit.sourceforge.net/symeig.html> is a Python wrapper for the LAPACK functions to solve the standard and generalized eigenvalue problems for symmetric (hermitian) positive definite matrices. It is superior to the scipy "linalg.eigh" wrapper because it wraps *all* relevant LAPACK routines, enabling for example to just return a subset of all egenvectors/eigenvalues, which is a killer feature if you are dealing with huge-nonsparse matrices. Some of these LAPACK routines are available in scipy.lib.lapack.flapack and can be accessed through scipy.lib.lapack.get_lapack_funcs . Some of them are still missing in scipy, while symeig offers a unified interface to all relevant LAPACK functions. symeig has been dowloaded more than 1300 times since its first public appearance on sourceforge (under the mdp-toolkit package) in 2004. It features a complete unit test and a telling doc-string. I am one of the authors of symeig and have been contacted by some scipy devs to discuss the integration of symeig in scipy. I am more than willing to help doing this. The most difficult part (the LGPL license) has been addressed already: I've re-issued symeig under a BSD license. Next step would be to adapt symeig code and tests to the scipy framework. Some questions to you:
- where would you like to have symeig? (I would suggest scipy.linalg)
- should we change the signature to match or resamble that of other eigenproblem-related functions in scipy?
- is there a responsible scipy dev for the linalg package I can bother with any questions I may have in the process?
- do I get svn commit rights or should I work on a local copy and send a patch?
let me know,
tiziano
This sounds like it would be very useful for scipy although I am just a user not a dev. Could I use symeig to extract only the eigenvector corresponding to the largest eigenvalue, given a non-sparse symmetric real matrix whose eigenvalues are all positive except for exactly one that is zero? The documentation for symeig says that it works for "symmetric (hermitian) definite positive matrices" but I guess mine would be a "symmetric (hermitian) semi-definite positive matrix". If symeig wouldn't work, is there another way I could do this without using eigh to get the full eigendecomposition? Thanks, Alex
![](https://secure.gravatar.com/avatar/612395b66b3e7959997007b342b3688a.jpg?s=120&d=mm&r=g)
On Fri, 24 Oct 2008 08:04:46 -0400 alex griffing <argriffi@ncsu.edu> wrote:
Tiziano Zito wrote:
Dear SciPy devs,
there has been some discussion about integrating symeig in SciPy. symeig <http://mdp-toolkit.sourceforge.net/symeig.html> is a Python wrapper for the LAPACK functions to solve the standard and generalized eigenvalue problems for symmetric (hermitian) positive definite matrices. It is superior to the scipy "linalg.eigh" wrapper because it wraps *all* relevant LAPACK routines, enabling for example to just return a subset of all egenvectors/eigenvalues, which is a killer feature if you are dealing with huge-nonsparse matrices. Some of these LAPACK routines are available in scipy.lib.lapack.flapack and can be accessed through scipy.lib.lapack.get_lapack_funcs . Some of them are still missing in scipy, while symeig offers a unified interface to all relevant LAPACK functions. symeig has been dowloaded more than 1300 times since its first public appearance on sourceforge (under the mdp-toolkit package) in 2004. It features a complete unit test and a telling doc-string. I am one of the authors of symeig and have been contacted by some scipy devs to discuss the integration of symeig in scipy. I am more than willing to help doing this. The most difficult part (the LGPL license) has been addressed already: I've re-issued symeig under a BSD license. Next step would be to adapt symeig code and tests to the scipy framework. Some questions to you:
- where would you like to have symeig? (I would suggest scipy.linalg)
- should we change the signature to match or resamble that of other eigenproblem-related functions in scipy?
- is there a responsible scipy dev for the linalg package I can bother with any questions I may have in the process?
- do I get svn commit rights or should I work on a local copy and send a patch?
let me know,
tiziano
This sounds like it would be very useful for scipy although I am just a user not a dev. Could I use symeig to extract only the eigenvector corresponding to the largest eigenvalue, given a non-sparse symmetric real matrix whose eigenvalues are all positive except for exactly one that is zero? The documentation for symeig says that it works for "symmetric (hermitian) definite positive matrices" but I guess mine would be a "symmetric (hermitian) semi-definite positive matrix". If symeig wouldn't work, is there another way I could do this without using eigh to get the full eigendecomposition?
Thanks, Alex _______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
from symeig import symeig from numpy import diag, ones n = 10 M = 2.0*diag(ones(n)) K = 2*diag(ones(n))-diag(ones(n-1),1)-diag(ones(n-1),-1) print M print K lo = n hi = n w,Z = symeig(K,M,range=(lo,hi)) print print 'Largest eigenvalue',w print print 'Corresponding eigenvector' print print Z Nils
![](https://secure.gravatar.com/avatar/612395b66b3e7959997007b342b3688a.jpg?s=120&d=mm&r=g)
On Fri, 24 Oct 2008 08:04:46 -0400 alex griffing <argriffi@ncsu.edu> wrote:
Tiziano Zito wrote:
Dear SciPy devs,
there has been some discussion about integrating symeig in SciPy. symeig <http://mdp-toolkit.sourceforge.net/symeig.html> is a Python wrapper for the LAPACK functions to solve the standard and generalized eigenvalue problems for symmetric (hermitian) positive definite matrices. It is superior to the scipy "linalg.eigh" wrapper because it wraps *all* relevant LAPACK routines, enabling for example to just return a subset of all egenvectors/eigenvalues, which is a killer feature if you are dealing with huge-nonsparse matrices. Some of these LAPACK routines are available in scipy.lib.lapack.flapack and can be accessed through scipy.lib.lapack.get_lapack_funcs . Some of them are still missing in scipy, while symeig offers a unified interface to all relevant LAPACK functions. symeig has been dowloaded more than 1300 times since its first public appearance on sourceforge (under the mdp-toolkit package) in 2004. It features a complete unit test and a telling doc-string. I am one of the authors of symeig and have been contacted by some scipy devs to discuss the integration of symeig in scipy. I am more than willing to help doing this. The most difficult part (the LGPL license) has been addressed already: I've re-issued symeig under a BSD license. Next step would be to adapt symeig code and tests to the scipy framework. Some questions to you:
- where would you like to have symeig? (I would suggest scipy.linalg)
- should we change the signature to match or resamble that of other eigenproblem-related functions in scipy?
- is there a responsible scipy dev for the linalg package I can bother with any questions I may have in the process?
- do I get svn commit rights or should I work on a local copy and send a patch?
let me know,
tiziano
This sounds like it would be very useful for scipy although I am just a user not a dev. Could I use symeig to extract only the eigenvector corresponding to the largest eigenvalue, given a non-sparse symmetric real matrix whose eigenvalues are all positive except for exactly one that is zero? The documentation for symeig says that it works for "symmetric (hermitian) definite positive matrices" but I guess mine would be a "symmetric (hermitian) semi-definite positive matrix". If symeig wouldn't work, is there another way I could do this without using eigh to get the full eigendecomposition?
Thanks, Alex _______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
Here is an example where K is positive semidefinite. from symeig import symeig from numpy import diag, ones, r_ n = 10 M = 2.0*diag(ones(n)) # # Symmetric positive-semidefinite # K = diag(r_[1.0,2*ones(n-2),1])-diag(ones(n-1),1)-diag(ones(n-1),-1) K[0,0] = 1.0 K[-1,-1] = 1.0 print M print K lo = 1 hi = 1 w,Z = symeig(K,M,range=(lo,hi)) print print 'Smallest eigenvalue',w print print 'Rigid body mode' print print Z lo = n hi = n w,Z = symeig(K,M,range=(lo,hi)) print print 'Largest eigenvalue',w print print 'Corresponding eigenvector' print print Z Nils
participants (5)
-
alex griffing
-
Nils Wagner
-
Robert Cimrman
-
Robert Kern
-
Tiziano Zito