How to use eig with the nobalance option, as in MATLAB?

In MATLAB, I can execute the command:

[X,L] = eig(A,'nobalance'); 

To calculate eigenvalues ​​without a balance parameter.

What is the equivalent command in NumPy? When I launch the eig NumPy version, it does not give the same result as the MATLAB result with nobalance enabled.

+6
source share
2 answers

NumPy cannot do this at this time. As horchler said, an open ticket is currently open for this. However, this can be done using external libraries. Here I am writing how to do this using Python bindings to the NAG library.

http://www.walkingrandomly.com/?p=5303

It should be possible to do something similar using any interface for LAPACK, such as Intel MKL, etc.

+2
source

You can also consider installing GNU Octave and embedding it in Python using oct2py. For example, to determine the eigenvalue of matrix A without balancing,

 from oct2py import octave ... [X,L] = octave.eig(A) 

Octave eig does not balance matrix A.

If you want to balance matrix A, you can go ahead and write:

 from oct2py import octave ... A = octave.balance(A) [X,L] = octave.eig(A) 

oct2py can be downloaded from this website: https://pypi.python.org/pypi/oct2py

Before installing oct2py, you need to make sure that SciPy and GNU Octave are already installed. Good luck

+3
source

All Articles