Skip to main content

Free probability for large matrices

Project description

https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png

freealg is a Python package that employs free probability to evaluate the spectral densities of large matrix forms. The fundamental algorithm employed by freealg is free decompression, which extrapolates from the empirical spectral densities of small submatrices to infer the eigenspectrum of extremely large matrices.

Install

Install with pip:

pip install freealg

Alternatively, clone the source code and install with

cd source_dir
pip install .

Documentation

Documentation is available at ameli.github.io/freealg.

Quick Usage

The following code estimates the eigenvalues of a very large Wishart matrix using a much smaller Wishart matrix.

>>> import freealg as fa
>>> mp = fa.distributions.MarchenkoPastur(1/50) # Wishart matrices with aspect ratio 1/50
>>> A = mp.matrix(1000)                         # Sample a 1000 x 1000 Wishart matrix
>>> eigs = fa.eigfree(A, 100_000)               # Estimate the eigenvalues of 100000 x 100000

For more details on how to interface with freealg check out the Quick Start Guide.

Test

You may test the package with tox:

cd source_dir
tox

Alternatively, test with pytest:

cd source_dir
pytest

How to Contribute

We welcome contributions via GitHub’s pull request. Developers should review our [Contributing Guidelines](CONTRIBUTING.rst) before submitting their code. If you do not feel comfortable modifying the code, we also welcome feature requests and bug reports.

How to Cite

If you use this work, please cite the arXiv paper <https://arxiv.org/abs/2506.11994>.

@article{ameli2025spectral,
  title={Spectral Estimation with Free Decompression},
  author={Siavash Ameli and Chris van der Heide and Liam Hodgkinson and Michael W. Mahoney},
  journal={arXiv preprint arXiv:2506.11994},
  year={2025}
}

License

license

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

freealg-0.1.12.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

freealg-0.1.12-py3-none-any.whl (54.6 kB view details)

Uploaded Python 3

File details

Details for the file freealg-0.1.12.tar.gz.

File metadata

  • Download URL: freealg-0.1.12.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for freealg-0.1.12.tar.gz
Algorithm Hash digest
SHA256 f6f60e4050662ef8106e3de8189dd205408caa513630635264a7fe58daa4f14d
MD5 05b625535cb36eed636fa2974a0dd5ae
BLAKE2b-256 93645066362348bff3cc68100359fc4d4d6b8192b001ebb68a69d6b13f00a76d

See more details on using hashes here.

File details

Details for the file freealg-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: freealg-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 54.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for freealg-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 19ecf65ec81ca42c8153e436ee38410a88ebe9d6fc1f0510f2456f31b8d5b9c4
MD5 b714174ad5f29baf6f9578c512d85daf
BLAKE2b-256 1d523da5a8eb31f7a220f3fccb566d4c21cea47ee3d0a52a97e9a8b1fff53e20

See more details on using hashes here.

Supported by

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