ffsim.linalg.modified_cholesky¶
- ffsim.linalg.modified_cholesky(mat, *, tol=1e-08, max_vecs=None)[source]¶
Modified Cholesky decomposition.
The modified Cholesky decomposition of a square matrix \(M\) has the form
\[M = \sum_{i=1}^N v_i v_i^\dagger\]where each \(v_i\) is a vector. \(M\) must be positive definite. No checking is performed to verify whether \(M\) is positive definite. The number of terms \(N\) in the decomposition depends on the allowed error threshold. A larger error threshold may yield a smaller number of terms. Furthermore, the
max_vecsparameter specifies an optional upper bound on \(N\). Themax_vecsparameter is always respected, so if it is too small, then the error of the decomposition may exceed the specified error threshold.References
- Parameters:
mat (
ndarray) – The matrix to decompose.tol (
float) – Tolerance for error in the decomposition. The error is defined as the maximum absolute difference between an element of the original tensor and the corresponding element of the reconstructed tensor.max_vecs (
int|None) – The maximum number of vectors to include in the decomposition.
- Return type:
- Returns:
The Cholesky vectors v_i assembled into a 2-dimensional Numpy array whose columns are the vectors.