Linear Algebra

This module contains specialised linear algebra tools that are not currently available in the python standard scientific libraries.

Kronecker tools

A kronecker matrix is matrix that can be written as a kronecker matrix of the individual matrices i.e.

\[\begin{split}K = K_0 \\otimes K_1 \\otimes K_2 \\otimes \\cdots\end{split}\]

Matrices which exhibit this structure can exploit properties of the kronecker product to avoid explicitly expanding the matrix \(K\). This module implements some common linear algebra operations which leverages this property for computational gains and a reduced memory footprint.

Numpy

kron_matvec(A, b) Computes the matrix vector product of a kronecker matrix in linear time.
kron_cholesky(A) Computes the Cholesky decomposition of a kronecker matrix as a kronecker matrix of Cholesky factors.
africanus.linalg.kron_matvec(A, b)[source]

Computes the matrix vector product of a kronecker matrix in linear time. Assumes A consists of kronecker product of square matrices.

Parameters:

A : numpy.ndarray

An array of arrays holding matrices [K0, K1, …] where \(A = K_0 \otimes K_1 \otimes \cdots\)

b : numpy.ndarray

The right hand side vector

Returns:

x : numpy.ndarray

The result of A.dot(b)

africanus.linalg.kron_cholesky(A)[source]

Computes the Cholesky decomposition of a kronecker matrix as a kronecker matrix of Cholesky factors.

Parameters:

A : numpy.ndarray

An array of arrays holding matrices [K0, K1, …] where \(A = K_0 \otimes K_1 \otimes \cdots\)

Returns:

L : numpy.ndarray

An array of arrays holding matrices [L0, L1, …] where \(L = L_0 \otimes L_1 \otimes \cdots\) and each Li = cholesky(Ki)