Skip to main content

Package for implicit matrix function, trace, and diagonal estimation.

Project description

GH wheel build Coveralls coverage Python versions PyPI Version Ruff

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}$$

This definition is quite general in that different parameterizations of $f$ produce a variety of spectral quantities, including the matrix inverse $A^{-1}$, the matrix exponential $\mathrm{exp}(A)$, the matrix logarithm $\mathrm{log}(A)$, and so on.

Composing these with trace and diagonal estimators yields approximations for the numerical rank, the log-determinant, the Schatten norms, the eigencount, the Estrada index, the Heat Kernel Signature, and so on.

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) and invocable's[^3] (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.

Installation

primate is a standard PEP-517 package, and thus 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.

Applications

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.

If you have a particular application, feel free to make a computational notebook to illustrate it as a use-case!

[^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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scikit_primate-0.5.6.tar.gz (5.7 MB view details)

Uploaded Source

Built Distributions

scikit_primate-0.5.6-cp313-cp313-win_amd64.whl (375.9 kB view details)

Uploaded CPython 3.13Windows x86-64

scikit_primate-0.5.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (261.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

scikit_primate-0.5.6-cp313-cp313-macosx_11_0_arm64.whl (176.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

scikit_primate-0.5.6-cp313-cp313-macosx_10_13_x86_64.whl (173.1 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

scikit_primate-0.5.6-cp312-cp312-win_amd64.whl (375.9 kB view details)

Uploaded CPython 3.12Windows x86-64

scikit_primate-0.5.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (261.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

scikit_primate-0.5.6-cp312-cp312-macosx_11_0_arm64.whl (176.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

scikit_primate-0.5.6-cp312-cp312-macosx_10_13_x86_64.whl (173.1 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

scikit_primate-0.5.6-cp311-cp311-win_amd64.whl (375.8 kB view details)

Uploaded CPython 3.11Windows x86-64

scikit_primate-0.5.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (263.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

scikit_primate-0.5.6-cp311-cp311-macosx_11_0_arm64.whl (176.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

scikit_primate-0.5.6-cp311-cp311-macosx_10_9_x86_64.whl (173.7 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

scikit_primate-0.5.6-cp310-cp310-win_amd64.whl (373.5 kB view details)

Uploaded CPython 3.10Windows x86-64

scikit_primate-0.5.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (261.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

scikit_primate-0.5.6-cp310-cp310-macosx_11_0_arm64.whl (175.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

scikit_primate-0.5.6-cp310-cp310-macosx_10_9_x86_64.whl (172.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

scikit_primate-0.5.6-cp39-cp39-win_amd64.whl (374.2 kB view details)

Uploaded CPython 3.9Windows x86-64

scikit_primate-0.5.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (261.9 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

scikit_primate-0.5.6-cp39-cp39-macosx_11_0_arm64.whl (175.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

scikit_primate-0.5.6-cp39-cp39-macosx_10_9_x86_64.whl (172.2 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file scikit_primate-0.5.6.tar.gz.

File metadata

  • Download URL: scikit_primate-0.5.6.tar.gz
  • Upload date:
  • Size: 5.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for scikit_primate-0.5.6.tar.gz
Algorithm Hash digest
SHA256 3c72ca722a65fd0af2376f0352265d0468bde6693eea37db3e9b879e548efaad
MD5 34295dd4f4c56bb49f2ef981fe04d314
BLAKE2b-256 4f034e4029d412dacf42a955831fd6de8e5031316084f1a4eb688c57955b7f43

See more details on using hashes here.

File details

Details for the file scikit_primate-0.5.6-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b004a81262372f18dc284f6b131db36fa91b84b786d3ada8d6a3ac832f131243
MD5 ac99f6fd644acf12e32e467dbd812ce3
BLAKE2b-256 4e084d955e1aa4f7a6a95adc668b2c1b37646475ae30049981f31851979ee45a

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp313-cp313-win_amd64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ffa8d60701b8b992d0c8faaa0284aba3362fdf3be8c3ab1a747dfba82500106
MD5 95260c7e7a1f0f9a36c7ed0b0928db4e
BLAKE2b-256 5806ddd4dcc97163080f704237570111a2d148d91a53c5150242d12dfdd1a254

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9de26475e9a0e5c4a9f6ef99caa611abc8da84ec94622fe5f9d0e9fa6e158c8
MD5 6f02700822d1d8f5fa1304fa9f6bd329
BLAKE2b-256 7bf8f15ed58119e57688bf1a953d1c0ce559eea7cd82ca3346bd9fd184ee03ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 05336e8c93b4fb07fdab06128433cc860e2f170139e30cc595d34c1dd21d37e8
MD5 e2acbbd096b3e5953d3ce8bd1ed0bdc5
BLAKE2b-256 3717d94793f3f7149a7a1e17d29987472efd0b8c576ef39b6139016f20f162fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp313-cp313-macosx_10_13_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ea772b8cc61072c2d31e5d53d0e4de44a45e6e3cdf21e54e2199814cd954146a
MD5 3d7bade1596f62d3955c4016f2b5d6ea
BLAKE2b-256 e5868b2a1625d62712c829018a720eb1248b3f97357bdf1c3c1482508a119547

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp312-cp312-win_amd64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb19935a8fee6a1cdbc8c613ae2e81d68c40adef2fd3595ed29f39ad8f7d41b9
MD5 133b0f8fce8011c8f1d5021037379100
BLAKE2b-256 1cb967663b10c2940886da22bdaf765bb70d5914407a74f3906105463ab591ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 750b3afad420351ac438794302852823d49a078fa836d42e210e0cef72c5c8fc
MD5 11fdfd02fba6dd0c244ed5461a258690
BLAKE2b-256 7fe8e400bcb6a200e0a53fb78a935f113a16a170ed9da9a30f173f48df8c20e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 eb3caa73e439f75f81dffe0e310df09a58a00ea34c68591fa621290de3f4e18b
MD5 ca18e8d3c6896a6f3ad8d4438742fff1
BLAKE2b-256 b2d4382b9ca43d8d58e428fca9c1dd49d885e79df4c2d7dfa6807099b4acae02

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp312-cp312-macosx_10_13_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b90c9e76657369efeed4eeca68255cbda8a46c516c742119fd7f3871d024e247
MD5 f432b2fa97175660d50c31c00002ab4a
BLAKE2b-256 19832dfcb975f79f9569e385003f4e6ea5a98b818fc59479d14c36990c5c9102

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp311-cp311-win_amd64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a232f6a56d71f068689c178d6b89bf63125b83a15b3f8b8e9e74e6d4ee544c9f
MD5 7f080ff3ca97284c0c4beb52e6f8af8a
BLAKE2b-256 e0dd2f4824416cea2606476e95b12a15720d1b2acba49558c8e56dd0ef6f0e7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b2b0d4d7b7267e8ac2d74dc80c3f14235e8e46720efd457209459754f0c1333
MD5 a1e915b92f4aebd76aacc2d926a73608
BLAKE2b-256 37eeff82d77924d6439ae0d15242a73d0d364e53426f3c122b2222fd180e8e81

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a6e2c7437abbb7a25946ddabac4261ac174632afa2774638d41ab5ac5a30fd06
MD5 8b0c85e2537836f8cdd7a3c937ddac77
BLAKE2b-256 df947636e0257c151fdec22e2f2464e9f057d71ce8c73aeb5ee55b0f6e895be9

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp311-cp311-macosx_10_9_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a9531cbe9f6e97f79792b6bab29d9b267187acd1d7c848809ff8ea880d16efd3
MD5 0d8fcd067894678e9c21e340afcb8dee
BLAKE2b-256 6a4e0212071d739f14556e0945a2e25839d2b9f5faab972424d06ad40c57d0f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp310-cp310-win_amd64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f70fbac377c39db756ba79be694be9cbce26d965ee02c00a194d12eb5700e0f7
MD5 b0a429bc3347363c92df8d4b0a97ecaf
BLAKE2b-256 495749028f7cdcec8faeb17a759f280536a17439fcefcc70eff2b4537bcc7c49

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af12e0ac18cc381f5f8d198605a5cb78190b38b676ed64fdf1d4e07e60581d80
MD5 20f869e131b4cdebbfe7348eee4395fc
BLAKE2b-256 3d71f86f847a56b6ca6e1b2522b38572c1bf37ba92d2d97d998a00dc5bc9dc7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2015c56d35b8cc999f93a66479ed4e542da39159fea3bb37e4697ff4d9784d2e
MD5 e8fa7628ef4ed6e94b7b6f03ede18682
BLAKE2b-256 287c5ada3778659a8a95826ee8a39bfa044228151186c81623a853d26fd83ab1

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp310-cp310-macosx_10_9_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8b015d638cf14a2f590da4c67ea904ea14ed4bd7fc7147fe15c2d72f148d6771
MD5 a68ffaafbe68deb5af7744e8b93049de
BLAKE2b-256 5124fba2d21190144aea076ed5fdf478e4fcab4585c7493ab841a7e7a0926242

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp39-cp39-win_amd64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b0adf1c90f01e87508a6b7075fbd642cfd8a4ad0f4cc7ab4c2731aaeca1bd47
MD5 c5df6accf7b69495429fc77d85f30bd6
BLAKE2b-256 412516f518984e9032da6a7c298caf6fce64674c55746016be2ce9889b1f877e

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d82342e9bf88023b9694a1e505f050438edbdf76f47c9c33755c950d42161516
MD5 a47217ffd17ae73aaac371e1742c473f
BLAKE2b-256 3952cfe3fe204d9a1b01d30655481a06609bdcc062f55ffe1095529422032fbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_primate-0.5.6-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for scikit_primate-0.5.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c5639ede89b8c3ba6aba1a7e2aba7b51f3bb1e7995d062c4cefd218f86547e52
MD5 6a670f2c42af92fcac81b1ce5a155630
BLAKE2b-256 4412d227bd446d7611ac36281d5f84cd33951509966babb18764cbf27a12ceb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_primate-0.5.6-cp39-cp39-macosx_10_9_x86_64.whl:

Publisher: wheels.yml on peekxc/primate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page