peekxc / primate

Implicit matrix function and trace estimator

Home Page:https://peekxc.github.io/primate/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build_macos build_windows build_linux Python versions

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:

$$ f(A) \triangleq U f(\Lambda) U^{\intercal}, \quad \quad f : [a,b] \to \mathbb{R}$$

Estimator approximations are obtained via the Lanczos1 and stochastic Lanczos quadrature2 methods, which are well-suited for sparse or structured operators supporting fast $v \mapsto Av$ actions.

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) and invocable's3 (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.

Footnotes

  1. Musco, Cameron, Christopher Musco, and Aaron Sidford. (2018) "Stability of the Lanczos method for matrix function approximation."

  2. Ubaru, S., Chen, J., & Saad, Y. (2017). Fast estimation of tr(f(A)) via stochastic Lanczos quadrature.

  3. This includes std::function's, C-style function pointers, functors, and lambda expressions.

About

Implicit matrix function and trace estimator

https://peekxc.github.io/primate/

License:Apache License 2.0


Languages

Language:Python 48.3%Language:C++ 41.3%Language:Meson 5.7%Language:Shell 4.1%Language:Dockerfile 0.3%Language:C 0.2%