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_vecs parameter specifies an optional upper bound on \(N\). The max_vecs parameter 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:

ndarray

Returns:

The Cholesky vectors v_i assembled into a 2-dimensional Numpy array whose columns are the vectors.