primate
, short for Probabalistic Implicit Matrix Trace Estimator, is a Python package that provides estimators of quantities derived from matrix functions; that is, matrices parameterized by functions:
This definition is quite general in that different parameterizations of
Notable features of primate
include:
- Efficient methods for trace, quadrature, and matrix function approximation
- Various distribution / engine choices for random vector generation (the stochastic part!)
- Support for arbitrary matrix functions, i.e.
Callable
's (Python) andinvocable
's1 (C++) - Support for arbitrary
LinearOperator
's, e.g. those in SciPy or Pylops - Matrix-free interface to the Lanczos, Golub-Welsch, and Gram Schmidt methods
primate
was partially inspired by the imate
package---for a comparison of the two, see here.
Applications of matrix functions include characterizing folding in proteins, principal component regression, spectral clustering, Gaussian process likelihood estimation, counting triangles in distributed-memory networks, characterizing graph similarity, and deep neural loss landscape analysis.
primate
is a standard PEP-517 package that can be installed via pip:
python -m pip install scikit-primate
Assuming your platform is supported, no compilation is needed—see the installation page for details.
Footnotes
-
This includes std::function's, C-style function pointers, functors, and lambda expressions. ↩