# TransportMaps.LinAlg._linalg¶

## Module Contents¶

### Functions¶

 square_root(A[, square_root_type]) Factorizes $$A$$ and returns the square root it inverse_square_root(A[, square_root_type]) Factorizes $$A$$ and returns the square root of $$A^{-1}$$ solve_linear_system(A, b[, transposed]) Solve the system $$Ax = b$$ Solve the system $$AA^{\top}x = b$$ Compute $$\log\det A$$
TransportMaps.LinAlg._linalg.square_root(A, square_root_type='sym')[source]

Factorizes $$A$$ and returns the square root it

Parameters:

A (ndarray [$$d,d$$]) – matrix

Kwargs:
square_root_type (str): type of square root.

For square_root_type=='sym', $$L=U\Lambda^{\frac{1}{2}}U^T$$ where $$A = U\Lambda U^T$$ is the eigenvalue decomposition of $$A$$. For square_root_type=='tri' or square_root_type=='chol', $$L=C$$ where $$A=CC^T$$ is the Cholesky decomposition of $$A$$. For square_root_type=='kl', $$L=U\Lambda^{\frac{1}{2}}$$ where $$A = U\Lambda U^T$$ is the eigenvalue decomposition of $$A$$ (this corresponds to the Karuenen-Loeve expansion). The eigenvalues and eigenvectors are ordered with $$\lambda_i\geq\lambda_{i+1}$$.

Returns:

$$L$$ – square root

TransportMaps.LinAlg._linalg.inverse_square_root(A, square_root_type='sym')[source]

Factorizes $$A$$ and returns the square root of $$A^{-1}$$

Parameters:

A (ndarray [$$d,d$$]) – matrix

Kwargs:
square_root_type (str): type of square root.

For square_root_type=='sym', $$L=U\Lambda^{\frac{1}{2}}U^T$$ where $$A = U\Lambda U^T$$ is the eigenvalue decomposition of $$A$$. For square_root_type=='tri' or square_root_type=='chol', $$L=C$$ where $$A=CC^T$$ is the Cholesky decomposition of $$A$$. For square_root_type=='kl', $$L=U\Lambda^{\frac{1}{2}}$$ where $$A = U\Lambda U^T$$ is the eigenvalue decomposition of $$A$$ (this corresponds to the Karuenen-Loeve expansion). The eigenvalues and eigenvectors are ordered with $$\lambda_i\geq\lambda_{i+1}$$.

Returns:

$$L^{-1}$$ – square root of the inverse

TransportMaps.LinAlg._linalg.matrix_inverse(A)[source]
TransportMaps.LinAlg._linalg.solve_linear_system(A, b, transposed=False)[source]

Solve the system $$Ax = b$$

It checks whether A has some good properties.

TransportMaps.LinAlg._linalg.solve_square_root_linear_system(A, b)[source]

Solve the system $$AA^{\top}x = b$$

TransportMaps.LinAlg._linalg.log_det(A)[source]

Compute $$\log\det A$$