pdk.Math.LinAlgebra ($Date: 2002/12/04 10:16:02 $)
index
pdk/Math/LinAlgebra.py

Linear Algebra routines.

FOG 11.1999

 
Functions
            
matrix_square_root(M, andInverseFlag=0, onlyInverseFlag=0)
Purpose:find the square root of the square matrix M.
Detail:

use the eigendecomposition of M:

M = W * S * transpose(W)

and compute the square root as

sqrt(M) = W * sqrt(S) * transpose(W)
matrix_symmetric_square_root(M, andInverseFlag=0, onlyInverseFlag=0, checkForApproxErrorFlag=0)
Purpose:find the square root of the symmetric square matrix <M>.
Detail:

use the SVD of M:

M = U * S * transpose(V)

and compute the square root as

sqrt(M) = U * sqrt(S) * transpose(V)

If andInverseFlag is set, the inverse square root is also returned, if onlyInverseFlag is set, only the inverse is returned.

For rank deficient input matrices M, the inverse of sqrt(M[:rank,:rank]) is returned.

Note: theoretically, U and V should be IDENTICAL if M is symmetric. Practically, though, they will be different, and computing sqrt(M) as U * sqrt(S) * transpose(U) does not work. Using the SVD still seems to be numerically much more reliable than using the eigendecomposition.

 
Author
            
$Author: gathmann $