Package daredare :: Package extern :: Module qz
[hide private]
[frames] | no frames]

Module qz

source code

QZ alias generalized Schur decomposition (complex or real) for Python/Numpy.

You need to import the qz() function of this module, check out its docstring, especially what it says about the required lapack shared library. Run this module for some quick tests of the setup.

This is free but copyrighted software, distributed under the same license as Python 2.5, copyright Sven Schreiber.

If you think a different license would make (more) sense, please say so on the Numpy mailing list (see scipy.org).

Functions [hide private]
 
setuplapack4xgges(A, B, lpname, lppath)
Loads the lapack shared lib and does some input checks.
source code
 
dgges4numpy(A, B, jobvsl='V', jobvsr='V', lapackname='', lapackpath='')
wraps lapack function dgges, no sorting done
source code
 
zgges4numpy(A, B, jobvsl='V', jobvsr='V', lapackname='', lapackpath='')
Wraps lapack function zgges, no sorting done.
source code
 
qz(A, B, mode='complex', lapackname='', lapackpath='')
Equivalent to Matlab's qz function [AA,BB,Q,Z] = qz(A,B).
source code
 
eig2(A, B, lapackname='', lapackpath='')
Calculates generalized eigenvalues of pair (A,B).
source code
 
eigwithqz(A, B, lapackname='', lapackpath='')
Does complex QZ decomp.
source code
Function Details [hide private]

setuplapack4xgges(A, B, lpname, lppath)

source code 
Loads the lapack shared lib and does some input checks.

The defaults for lapackname and location are platform-specific:
    Win32: 'lapack' (due to scilab's lapack.dll)
           'c:\winnt\system32\'
    Otherwise: 'liblapack' 
               '/usr/lib/'

zgges4numpy(A, B, jobvsl='V', jobvsr='V', lapackname='', lapackpath='')

source code 

Wraps lapack function zgges, no sorting done.

Returns complex arrays, use real_if_close() if needed/possible.

qz(A, B, mode='complex', lapackname='', lapackpath='')

source code 
Equivalent to Matlab's qz function [AA,BB,Q,Z] = qz(A,B).

Requires Lapack as a shared compiled library on the system (one that
contains the functions dgges for real and zgges for complex use -- on 
Windows the one shipped with Scilab works). The underlying defaults for 
lapackname and lapackpath are platform-specific:
    Win32: 'lapack' (due to scilab's lapack.dll)
           'c:\winnt\system32\'
    Otherwise: 'liblapack' 
               '/usr/lib/'

This function should exactly match Matlab's usage, unlike octave's qz 
function which returns the conjugate-transpose of one of the matrices. Thus
it holds that 
    AA = Q*A*Z
    BB = Q*B*Z,
where Q and Z are unitary (orthogonal if real).
 
If mode is 'complex', then:
 returns complex-type arrays, 
 AA and BB are upper triangular, 
 and diag(AA)/diag(BB) are the generalized eigenvalues of (A,B).
 
If the real qz decomposition is explicitly requested --as in Matlab:  
qz(A,B,'real')-- then:
 returns real-type arrays,
 AA is only block upper triangular,
 and calculating the eigenvalues is more complicated.
 
Other variants like [AA,BB,Q,Z,V,W] = qz(A,B) are not implemented, i.e.
no generalized eigenvectors are calculated.

eig2(A, B, lapackname='', lapackpath='')

source code 

Calculates generalized eigenvalues of pair (A,B).

This should correspond to Matlab's lambda = eig(A,B), and also to some (the same?) scipy function.

Eigenvalues will be of complex type, are unsorted, and are returned as 1d.

eigwithqz(A, B, lapackname='', lapackpath='')

source code 

Does complex QZ decomp. and also returns the eigenvalues