Package linear_operators :: Module operators :: Class EigendecompositionOperator
[hide private]
[frames] | no frames]

Class EigendecompositionOperator

source code

              object --+        
                       |        
interface.LinearOperator --+    
                           |    
           SymmetricOperator --+
                               |
                              EigendecompositionOperator


Define a SymmetricOperator from the eigendecomposition of another
SymmetricOperator. This can be used as an approximation for the
operator.

Inputs
-------

A: LinearOperator (default: None)
  The LinearOperator to approximate.
v: 2d ndarray (default: None)
  The eigenvectors as given by arpack.eigsh
w: 1d ndarray (default: None)
  The eigenvalues as given by arpack.eigsh
**kwargs: keyword arguments
  Passed to the arpack.eigsh function.

You need to specify either A or v and w.

Returns
-------

An EigendecompositionOperator instance, which is a subclass of the
SymmetricOperator.

Notes
-----

This is really a wrapper for
scipy.sparse.linalg.eigen.arpack.eigsh

Instance Methods [hide private]
 
__init__(self, A=None, v=None, w=None, **kwargs)
Returns a SymmetricOperator of given shape and matvec function.
source code
 
det(self)
Output an approximation of the determinant from the eigenvalues.
source code
 
logdet(self)
Output the log of the determinant.
source code
 
__pow__(self, n)
Raising an eigendecomposition to an integer power requires only raising the eigenvalues to this power.
source code
 
inv(self)
Returns the pseudo-inverse of the operator.
source code
 
trace(self) source code
 
cond(self)
Output an approximation of the condition number by taking the ratio of the maximum over the minimum eigenvalues, removing the zeros.
source code

Inherited from interface.LinearOperator: __add__, __iadd__, __imul__, __isub__, __mul__, __neg__, __radd__, __repr__, __rmul__, __rsub__, __sub__, matmat, matvec, todense

Inherited from interface.LinearOperator (private): _matmat

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from interface.LinearOperator: T

Inherited from object: __class__

Method Details [hide private]

__init__(self, A=None, v=None, w=None, **kwargs)
(Constructor)

source code 
Returns a SymmetricOperator of given shape and matvec
function.

Parameters
----------

shape : length 2 tuple
    The shape of the operator. Should be square.

matvec : function
    The matrix-vector operation.

Returns
-------
A SymmetricOperator instance.

Overrides: object.__init__
(inherited documentation)

logdet(self)

source code 

Output the log of the determinant. Useful as the determinant of large matrices can exceed floating point capabilities.

__pow__(self, n)

source code 

Raising an eigendecomposition to an integer power requires only raising the eigenvalues to this power.

Overrides: interface.LinearOperator.__pow__

cond(self)

source code 

Output an approximation of the condition number by taking the ratio of the maximum over the minimum eigenvalues, removing the zeros.

For better approximation of the condition number, one should consider generating the eigendecomposition with the keyword which='BE', in order to have a correct estimate of the small eigenvalues.