freealg 0.3.2__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {freealg-0.3.2 → freealg-0.3.4}/PKG-INFO +16 -14
  2. {freealg-0.3.2 → freealg-0.3.4}/README.rst +13 -12
  3. freealg-0.3.4/freealg/__version__.py +1 -0
  4. {freealg-0.3.2 → freealg-0.3.4}/freealg/eigh.py +13 -2
  5. {freealg-0.3.2 → freealg-0.3.4}/freealg.egg-info/PKG-INFO +16 -14
  6. {freealg-0.3.2 → freealg-0.3.4}/freealg.egg-info/requires.txt +1 -0
  7. {freealg-0.3.2 → freealg-0.3.4}/setup.py +1 -1
  8. freealg-0.3.2/freealg/__version__.py +0 -1
  9. {freealg-0.3.2 → freealg-0.3.4}/AUTHORS.txt +0 -0
  10. {freealg-0.3.2 → freealg-0.3.4}/CHANGELOG.rst +0 -0
  11. {freealg-0.3.2 → freealg-0.3.4}/LICENSE.txt +0 -0
  12. {freealg-0.3.2 → freealg-0.3.4}/MANIFEST.in +0 -0
  13. {freealg-0.3.2 → freealg-0.3.4}/freealg/__init__.py +0 -0
  14. {freealg-0.3.2 → freealg-0.3.4}/freealg/_chebyshev.py +0 -0
  15. {freealg-0.3.2 → freealg-0.3.4}/freealg/_damp.py +0 -0
  16. {freealg-0.3.2 → freealg-0.3.4}/freealg/_decompress.py +0 -0
  17. {freealg-0.3.2 → freealg-0.3.4}/freealg/_jacobi.py +0 -0
  18. {freealg-0.3.2 → freealg-0.3.4}/freealg/_pade.py +0 -0
  19. {freealg-0.3.2 → freealg-0.3.4}/freealg/_plot_util.py +0 -0
  20. {freealg-0.3.2 → freealg-0.3.4}/freealg/_sample.py +0 -0
  21. {freealg-0.3.2 → freealg-0.3.4}/freealg/_support.py +0 -0
  22. {freealg-0.3.2 → freealg-0.3.4}/freealg/_util.py +0 -0
  23. {freealg-0.3.2 → freealg-0.3.4}/freealg/distributions/__init__.py +0 -0
  24. {freealg-0.3.2 → freealg-0.3.4}/freealg/distributions/_kesten_mckay.py +0 -0
  25. {freealg-0.3.2 → freealg-0.3.4}/freealg/distributions/_marchenko_pastur.py +0 -0
  26. {freealg-0.3.2 → freealg-0.3.4}/freealg/distributions/_meixner.py +0 -0
  27. {freealg-0.3.2 → freealg-0.3.4}/freealg/distributions/_wachter.py +0 -0
  28. {freealg-0.3.2 → freealg-0.3.4}/freealg/distributions/_wigner.py +0 -0
  29. {freealg-0.3.2 → freealg-0.3.4}/freealg/freeform.py +0 -0
  30. {freealg-0.3.2 → freealg-0.3.4}/freealg.egg-info/SOURCES.txt +0 -0
  31. {freealg-0.3.2 → freealg-0.3.4}/freealg.egg-info/dependency_links.txt +0 -0
  32. {freealg-0.3.2 → freealg-0.3.4}/freealg.egg-info/not-zip-safe +0 -0
  33. {freealg-0.3.2 → freealg-0.3.4}/freealg.egg-info/top_level.txt +0 -0
  34. {freealg-0.3.2 → freealg-0.3.4}/pyproject.toml +0 -0
  35. {freealg-0.3.2 → freealg-0.3.4}/requirements.txt +0 -0
  36. {freealg-0.3.2 → freealg-0.3.4}/setup.cfg +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: freealg
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Free probability for large matrices
5
5
  Home-page: https://github.com/ameli/freealg
6
6
  Download-URL: https://github.com/ameli/freealg/archive/main.zip
7
- Project-URL: Documentation, https://github.com/ameli/freealg/blob/main/README.rst
7
+ Project-URL: Documentation, https://ameli.github.io/freealg
8
8
  Project-URL: Source, https://github.com/ameli/freealg
9
9
  Project-URL: Tracker, https://github.com/ameli/freealg/issues
10
10
  Keywords: linalg,free-probability
@@ -59,6 +59,7 @@ Requires-Dist: sphinx-gallery; extra == "docs"
59
59
  Requires-Dist: sphinxcontrib-youtube; extra == "docs"
60
60
  Requires-Dist: sphinxext-opengraph; extra == "docs"
61
61
  Requires-Dist: sphinx-argparse; extra == "docs"
62
+ Requires-Dist: sphinx-sitemap; extra == "docs"
62
63
  Dynamic: classifier
63
64
  Dynamic: description
64
65
  Dynamic: description-content-type
@@ -73,10 +74,9 @@ Dynamic: requires-dist
73
74
  Dynamic: requires-python
74
75
  Dynamic: summary
75
76
 
76
- .. image:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
77
+ .. figure:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
77
78
  :align: left
78
79
  :width: 240
79
- :class: custom-dark
80
80
 
81
81
  `Paper <https://arxiv.org/abs/2506.11994>`__ |
82
82
  `Slides <https://www.dropbox.com/scl/fi/03gjuyz17k9yhsqy0isoz/free_decomporession_slides.pdf?rlkey=8f82mhciyl2ju02l7hv1md5li&st=26xmhjga&dl=0>`__ |
@@ -85,10 +85,11 @@ Dynamic: summary
85
85
 
86
86
  .. `Slides <https://ameli.github.io/freealg/_static/data/slides.pdf>`__ |
87
87
 
88
- *freealg* is a Python package that employs **free** probability to evaluate the spectral
89
- densities of large matrix **form**\ s. The fundamental algorithm employed by *freealg* is
90
- **free decompression**, which extrapolates from the empirical spectral densities of small
91
- submatrices to infer the eigenspectrum of extremely large matrices.
88
+ *freealg* is a Python package that employs **free** probability to evaluate the
89
+ spectral densities of large matrix **form**\ s. The fundamental algorithm
90
+ employed by *freealg* is **free decompression**, which extrapolates from the
91
+ empirical spectral densities of small submatrices to infer the eigenspectrum
92
+ of extremely large matrices.
92
93
 
93
94
  Install
94
95
  =======
@@ -114,8 +115,8 @@ Documentation is available at `ameli.github.io/freealg <https://ameli.github.io/
114
115
  Quick Usage
115
116
  ===========
116
117
 
117
- The following code estimates the eigenvalues of a very large Wishart matrix using a much
118
- smaller Wishart matrix.
118
+ The following code estimates the eigenvalues of a very large Wishart matrix
119
+ using a much smaller Wishart matrix.
119
120
 
120
121
  .. code-block:: python
121
122
 
@@ -124,7 +125,8 @@ smaller Wishart matrix.
124
125
  >>> A = mp.matrix(1000) # Sample a 1000 x 1000 Wishart matrix
125
126
  >>> eigs = fa.eigfree(A, 100_000) # Estimate the eigenvalues of 100000 x 100000
126
127
 
127
- For more details on how to interface with *freealg* check out the `Quick Start Guide <https://github.com/ameli/freealg/blob/main/notebooks/quick_start.ipynb>`__.
128
+ For more details on how to interface with *freealg* check out the
129
+ `Quick Start Guide <https://github.com/ameli/freealg/blob/main/notebooks/quick_start.ipynb>`__.
128
130
 
129
131
 
130
132
  Test
@@ -148,9 +150,9 @@ How to Contribute
148
150
  =================
149
151
 
150
152
  We welcome contributions via GitHub's pull request. Developers should review
151
- our [Contributing Guidelines](CONTRIBUTING.rst) before submitting their code.
152
- If you do not feel comfortable modifying the code, we also welcome feature
153
- requests and bug reports.
153
+ our [Contributing Guidelines](https://github.com/ameli/freealg/blob/main/CONTRIBUTING.rst)
154
+ before submitting their code. If you do not feel comfortable modifying the
155
+ code, we also welcome feature requests and bug reports.
154
156
 
155
157
  How to Cite
156
158
  ===========
@@ -1,7 +1,6 @@
1
- .. image:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
1
+ .. figure:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
2
2
  :align: left
3
3
  :width: 240
4
- :class: custom-dark
5
4
 
6
5
  `Paper <https://arxiv.org/abs/2506.11994>`__ |
7
6
  `Slides <https://www.dropbox.com/scl/fi/03gjuyz17k9yhsqy0isoz/free_decomporession_slides.pdf?rlkey=8f82mhciyl2ju02l7hv1md5li&st=26xmhjga&dl=0>`__ |
@@ -10,10 +9,11 @@
10
9
 
11
10
  .. `Slides <https://ameli.github.io/freealg/_static/data/slides.pdf>`__ |
12
11
 
13
- *freealg* is a Python package that employs **free** probability to evaluate the spectral
14
- densities of large matrix **form**\ s. The fundamental algorithm employed by *freealg* is
15
- **free decompression**, which extrapolates from the empirical spectral densities of small
16
- submatrices to infer the eigenspectrum of extremely large matrices.
12
+ *freealg* is a Python package that employs **free** probability to evaluate the
13
+ spectral densities of large matrix **form**\ s. The fundamental algorithm
14
+ employed by *freealg* is **free decompression**, which extrapolates from the
15
+ empirical spectral densities of small submatrices to infer the eigenspectrum
16
+ of extremely large matrices.
17
17
 
18
18
  Install
19
19
  =======
@@ -39,8 +39,8 @@ Documentation is available at `ameli.github.io/freealg <https://ameli.github.io/
39
39
  Quick Usage
40
40
  ===========
41
41
 
42
- The following code estimates the eigenvalues of a very large Wishart matrix using a much
43
- smaller Wishart matrix.
42
+ The following code estimates the eigenvalues of a very large Wishart matrix
43
+ using a much smaller Wishart matrix.
44
44
 
45
45
  .. code-block:: python
46
46
 
@@ -49,7 +49,8 @@ smaller Wishart matrix.
49
49
  >>> A = mp.matrix(1000) # Sample a 1000 x 1000 Wishart matrix
50
50
  >>> eigs = fa.eigfree(A, 100_000) # Estimate the eigenvalues of 100000 x 100000
51
51
 
52
- For more details on how to interface with *freealg* check out the `Quick Start Guide <https://github.com/ameli/freealg/blob/main/notebooks/quick_start.ipynb>`__.
52
+ For more details on how to interface with *freealg* check out the
53
+ `Quick Start Guide <https://github.com/ameli/freealg/blob/main/notebooks/quick_start.ipynb>`__.
53
54
 
54
55
 
55
56
  Test
@@ -73,9 +74,9 @@ How to Contribute
73
74
  =================
74
75
 
75
76
  We welcome contributions via GitHub's pull request. Developers should review
76
- our [Contributing Guidelines](CONTRIBUTING.rst) before submitting their code.
77
- If you do not feel comfortable modifying the code, we also welcome feature
78
- requests and bug reports.
77
+ our [Contributing Guidelines](https://github.com/ameli/freealg/blob/main/CONTRIBUTING.rst)
78
+ before submitting their code. If you do not feel comfortable modifying the
79
+ code, we also welcome feature requests and bug reports.
79
80
 
80
81
  How to Cite
81
82
  ===========
@@ -0,0 +1 @@
1
+ __version__ = "0.3.4"
@@ -17,12 +17,19 @@ from .freeform import FreeForm
17
17
  __all__ = ['eigh', 'cond', 'norm', 'trace', 'slogdet']
18
18
 
19
19
 
20
+ # ===============
21
+ # subsample apply
22
+ # ===============
23
+
20
24
  def _subsample_apply(f, A, output_array=False):
21
- """Compute f(A_n) over subsamples A_n of A. If the output of
22
- f is an array (e.g. eigvals), specify output_array to be True."""
25
+ """
26
+ Compute f(A_n) over subsamples A_n of A. If the output of
27
+ f is an array (e.g. eigvals), specify output_array to be True.
28
+ """
23
29
 
24
30
  if A.ndim != 2 or A.shape[0] != A.shape[1]:
25
31
  raise RuntimeError("Only square matrices are permitted.")
32
+
26
33
  n = A.shape[0]
27
34
 
28
35
  # Size of sample matrix
@@ -30,6 +37,7 @@ def _subsample_apply(f, A, output_array=False):
30
37
  # If matrix is not large enough, return eigenvalues
31
38
  if n < n_s:
32
39
  return f(A), n, n
40
+
33
41
  # Number of samples
34
42
  num_samples = int(10 * (n / n_s)**0.5)
35
43
 
@@ -38,6 +46,7 @@ def _subsample_apply(f, A, output_array=False):
38
46
  for _ in range(num_samples):
39
47
  indices = numpy.random.choice(n, n_s, replace=False)
40
48
  samples.append(f(A[numpy.ix_(indices, indices)]))
49
+
41
50
  if output_array:
42
51
  return numpy.concatenate(samples).ravel(), n, n_s
43
52
 
@@ -113,6 +122,7 @@ def eigh(A, N=None, psd=None, plots=False):
113
122
  >>> A = mp.matrix(3000)
114
123
  >>> eigs = eigh(A)
115
124
  """
125
+
116
126
  samples, n, n_s = _subsample_apply(compute_eig, A, output_array=True)
117
127
 
118
128
  if N is None:
@@ -367,6 +377,7 @@ def trace(A, N=None, p=1.0):
367
377
  >>> A = mp.matrix(3000)
368
378
  >>> trace(A, 100_000)
369
379
  """
380
+
370
381
  if numpy.isclose(p, 1.0):
371
382
  samples, n, n_s = _subsample_apply(numpy.trace, A, output_array=False)
372
383
  if N is None:
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: freealg
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Free probability for large matrices
5
5
  Home-page: https://github.com/ameli/freealg
6
6
  Download-URL: https://github.com/ameli/freealg/archive/main.zip
7
- Project-URL: Documentation, https://github.com/ameli/freealg/blob/main/README.rst
7
+ Project-URL: Documentation, https://ameli.github.io/freealg
8
8
  Project-URL: Source, https://github.com/ameli/freealg
9
9
  Project-URL: Tracker, https://github.com/ameli/freealg/issues
10
10
  Keywords: linalg,free-probability
@@ -59,6 +59,7 @@ Requires-Dist: sphinx-gallery; extra == "docs"
59
59
  Requires-Dist: sphinxcontrib-youtube; extra == "docs"
60
60
  Requires-Dist: sphinxext-opengraph; extra == "docs"
61
61
  Requires-Dist: sphinx-argparse; extra == "docs"
62
+ Requires-Dist: sphinx-sitemap; extra == "docs"
62
63
  Dynamic: classifier
63
64
  Dynamic: description
64
65
  Dynamic: description-content-type
@@ -73,10 +74,9 @@ Dynamic: requires-dist
73
74
  Dynamic: requires-python
74
75
  Dynamic: summary
75
76
 
76
- .. image:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
77
+ .. figure:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
77
78
  :align: left
78
79
  :width: 240
79
- :class: custom-dark
80
80
 
81
81
  `Paper <https://arxiv.org/abs/2506.11994>`__ |
82
82
  `Slides <https://www.dropbox.com/scl/fi/03gjuyz17k9yhsqy0isoz/free_decomporession_slides.pdf?rlkey=8f82mhciyl2ju02l7hv1md5li&st=26xmhjga&dl=0>`__ |
@@ -85,10 +85,11 @@ Dynamic: summary
85
85
 
86
86
  .. `Slides <https://ameli.github.io/freealg/_static/data/slides.pdf>`__ |
87
87
 
88
- *freealg* is a Python package that employs **free** probability to evaluate the spectral
89
- densities of large matrix **form**\ s. The fundamental algorithm employed by *freealg* is
90
- **free decompression**, which extrapolates from the empirical spectral densities of small
91
- submatrices to infer the eigenspectrum of extremely large matrices.
88
+ *freealg* is a Python package that employs **free** probability to evaluate the
89
+ spectral densities of large matrix **form**\ s. The fundamental algorithm
90
+ employed by *freealg* is **free decompression**, which extrapolates from the
91
+ empirical spectral densities of small submatrices to infer the eigenspectrum
92
+ of extremely large matrices.
92
93
 
93
94
  Install
94
95
  =======
@@ -114,8 +115,8 @@ Documentation is available at `ameli.github.io/freealg <https://ameli.github.io/
114
115
  Quick Usage
115
116
  ===========
116
117
 
117
- The following code estimates the eigenvalues of a very large Wishart matrix using a much
118
- smaller Wishart matrix.
118
+ The following code estimates the eigenvalues of a very large Wishart matrix
119
+ using a much smaller Wishart matrix.
119
120
 
120
121
  .. code-block:: python
121
122
 
@@ -124,7 +125,8 @@ smaller Wishart matrix.
124
125
  >>> A = mp.matrix(1000) # Sample a 1000 x 1000 Wishart matrix
125
126
  >>> eigs = fa.eigfree(A, 100_000) # Estimate the eigenvalues of 100000 x 100000
126
127
 
127
- For more details on how to interface with *freealg* check out the `Quick Start Guide <https://github.com/ameli/freealg/blob/main/notebooks/quick_start.ipynb>`__.
128
+ For more details on how to interface with *freealg* check out the
129
+ `Quick Start Guide <https://github.com/ameli/freealg/blob/main/notebooks/quick_start.ipynb>`__.
128
130
 
129
131
 
130
132
  Test
@@ -148,9 +150,9 @@ How to Contribute
148
150
  =================
149
151
 
150
152
  We welcome contributions via GitHub's pull request. Developers should review
151
- our [Contributing Guidelines](CONTRIBUTING.rst) before submitting their code.
152
- If you do not feel comfortable modifying the code, we also welcome feature
153
- requests and bug reports.
153
+ our [Contributing Guidelines](https://github.com/ameli/freealg/blob/main/CONTRIBUTING.rst)
154
+ before submitting their code. If you do not feel comfortable modifying the
155
+ code, we also welcome feature requests and bug reports.
154
156
 
155
157
  How to Cite
156
158
  ===========
@@ -24,6 +24,7 @@ sphinx-gallery
24
24
  sphinxcontrib-youtube
25
25
  sphinxext-opengraph
26
26
  sphinx-argparse
27
+ sphinx-sitemap
27
28
 
28
29
  [test]
29
30
  tox
@@ -161,7 +161,7 @@ def main(argv):
161
161
  # URLs
162
162
  url = 'https://github.com/ameli/freealg'
163
163
  download_url = url + '/archive/main.zip'
164
- documentation_url = url + '/blob/main/README.rst'
164
+ documentation_url = 'https://ameli.github.io/freealg'
165
165
  tracker_url = url + '/issues'
166
166
 
167
167
  # Inputs to setup
@@ -1 +0,0 @@
1
- __version__ = "0.3.2"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes