Package overview
primate
, short for Probabilistic Implicit Matrix Trace Estimator, is a Python package that provides estimators of quantities from matrices, linear operators, and matrix functions:
f(A) \triangleq U f(\Lambda) U^{\intercal}, \quad \quad f : [a,b] \to \mathbb{R}
Different parameterizations of f encompass a wide variety of spectral quantities, including the matrix inverse A^{-1}, the matrix exponential \mathrm{exp}(A), the matrix logarithm \mathrm{log}(A), etc.
Similarly, trace or diagonal estimators may be used to approximate the numerical rank, the log-determinant, the Schatten norms, the eigencount, the Estrada index, the Heat Kernel Signature, etc.
Notable features of primate
include:
- Efficient methods for trace, diagonal, and matrix function approximation
- Support for arbitrary matrix types, e.g. NumPy arrays, sparse matrices, or LinearOperator’s
- Support for arbitrary matrix functions, i.e.
Callable
’s (Python) andinvocable
’s1 (C++) - Matrix-free interface to the Lanczos and Golub-Welsch methods
- Various composable stopping criteria for easy and adaptive convergence checking
primate
was partially inspired by the imate
package—for a comparison of the two, see here.
Footnotes
This includes std::function’s, C-style function pointers, functors, and lambda expressions.↩︎