Comparison to imate
primate
’s namesake (and some of the original code1) was inspired from the (excellent) imate
package, prompting questions about their differences. In general, primate
was developed with slightly different goals in mind than imate
, most of which have to do with things like integrability, extensibility, and choice of FFI / build system.
Notable differences between the two packages include:
Feature | primate |
imate |
---|---|---|
Matrix support | Symmetric only2 | Symmetric or Rectangular |
Parallel support | Limited3 | CPU / GPU |
Function support | Arbitrary | Package supported4 |
Operator support | Arbitrary | Matrix-derived |
Linking strategy | Header only | Dynamically linked |
C++ version | \geq C++20 | Any |
FFI | Pybind11 / Pythran | Cython |
Build tool | Meson | CMake |
One motivation for developing primate
was to modularize and streamline access to Lanczos-based approximation methods, which is achieved through the use of things like function templates, type erasure, and header-only definitions. These modifications not only simplify access from user (i.e. dependent) packages, but they enable native support for arbitrary classes adhering to the LinearOperator concept. For more details on this, see the integration guides.
Footnotes
Before v0.2, much of
primate
’s code was essentially ported and refactored fromimate
. The code for v0.2+ has been re-written using the Eigen template C++ library. In v0.5+,primate
was refactored again, migrating most of the codebase to Python or Pythran for maintainability.↩︎With matrix functions,
primate
only supports symmetric operators; however, many quantities from rectangular matrices can be obtained from e.g. A^T A↩︎Parallel support w/ OpenMP was dropped in v0.5 in favor moving to a ThreadPoolExecutor in the future (yet to be implemented). Moreover, unlike
imate
,primate
does not provide native GPU-implemented Linear operators. However, one may always wrap a e.g. CUDA- or ROCm-based GPU-backed tensor as aLinearOperator
to accelerate matrix-vector products.↩︎See imates documentation for the list of supported functions.↩︎