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

Paper | Slides | Docs | Live Demo

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

pypi

Install with pip:

pip install freealg

Alternatively, clone the source code and install with

cd source_dir
pip install .

Documentation

deploy-docs

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.eigvalsh(A, 100_000)              # Estimate the eigenvalues of 100000 x 100000

For more details on how to interface with freealg check out the Live Demo.

Test

build-linux

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 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 our paper.

@inproceedings{
      AMELI-2025,
      title={Spectral Estimation with Free Decompression},
      author={Siavash Ameli and Chris van der Heide and Liam Hodgkinson and Michael W. Mahoney},
      booktitle={The Thirty-ninth Annual Conference on Neural Information Processing Systems},
      year={2025},
      url={https://openreview.net/forum?id=2CeGVUpOd7}
}

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.12.1.tar.gz (279.7 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.12.1-py3-none-any.whl (355.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for freealg-0.12.1.tar.gz
Algorithm Hash digest
SHA256 d184719bf5f1a8c7a9c011acfbabb83d979de06ce53c29a5f047ea6d4501a3a8
MD5 98f089c43e16afca008ff870e2392f98
BLAKE2b-256 e63807cd423535c745086c023d7c02bcc607222ef3e137dbd046467e919aa42a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for freealg-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f1d9fa2753634a7cbb27accf929616854a6c572408c483b8ea01102e45deab0
MD5 cf6bb997bb79996f843ed1f184ecfadb
BLAKE2b-256 1bd45f78f49db9d1bf8b6bf0c783a68493d9710860b03add186351190f4c17df

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