freealg 0.3.2__tar.gz → 0.3.3__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.3}/PKG-INFO +21 -14
  2. {freealg-0.3.2 → freealg-0.3.3}/README.rst +18 -12
  3. freealg-0.3.3/freealg/__version__.py +1 -0
  4. {freealg-0.3.2 → freealg-0.3.3}/freealg/eigh.py +13 -2
  5. {freealg-0.3.2 → freealg-0.3.3}/freealg.egg-info/PKG-INFO +21 -14
  6. {freealg-0.3.2 → freealg-0.3.3}/freealg.egg-info/requires.txt +1 -0
  7. {freealg-0.3.2 → freealg-0.3.3}/setup.py +1 -1
  8. freealg-0.3.2/freealg/__version__.py +0 -1
  9. {freealg-0.3.2 → freealg-0.3.3}/AUTHORS.txt +0 -0
  10. {freealg-0.3.2 → freealg-0.3.3}/CHANGELOG.rst +0 -0
  11. {freealg-0.3.2 → freealg-0.3.3}/LICENSE.txt +0 -0
  12. {freealg-0.3.2 → freealg-0.3.3}/MANIFEST.in +0 -0
  13. {freealg-0.3.2 → freealg-0.3.3}/freealg/__init__.py +0 -0
  14. {freealg-0.3.2 → freealg-0.3.3}/freealg/_chebyshev.py +0 -0
  15. {freealg-0.3.2 → freealg-0.3.3}/freealg/_damp.py +0 -0
  16. {freealg-0.3.2 → freealg-0.3.3}/freealg/_decompress.py +0 -0
  17. {freealg-0.3.2 → freealg-0.3.3}/freealg/_jacobi.py +0 -0
  18. {freealg-0.3.2 → freealg-0.3.3}/freealg/_pade.py +0 -0
  19. {freealg-0.3.2 → freealg-0.3.3}/freealg/_plot_util.py +0 -0
  20. {freealg-0.3.2 → freealg-0.3.3}/freealg/_sample.py +0 -0
  21. {freealg-0.3.2 → freealg-0.3.3}/freealg/_support.py +0 -0
  22. {freealg-0.3.2 → freealg-0.3.3}/freealg/_util.py +0 -0
  23. {freealg-0.3.2 → freealg-0.3.3}/freealg/distributions/__init__.py +0 -0
  24. {freealg-0.3.2 → freealg-0.3.3}/freealg/distributions/_kesten_mckay.py +0 -0
  25. {freealg-0.3.2 → freealg-0.3.3}/freealg/distributions/_marchenko_pastur.py +0 -0
  26. {freealg-0.3.2 → freealg-0.3.3}/freealg/distributions/_meixner.py +0 -0
  27. {freealg-0.3.2 → freealg-0.3.3}/freealg/distributions/_wachter.py +0 -0
  28. {freealg-0.3.2 → freealg-0.3.3}/freealg/distributions/_wigner.py +0 -0
  29. {freealg-0.3.2 → freealg-0.3.3}/freealg/freeform.py +0 -0
  30. {freealg-0.3.2 → freealg-0.3.3}/freealg.egg-info/SOURCES.txt +0 -0
  31. {freealg-0.3.2 → freealg-0.3.3}/freealg.egg-info/dependency_links.txt +0 -0
  32. {freealg-0.3.2 → freealg-0.3.3}/freealg.egg-info/not-zip-safe +0 -0
  33. {freealg-0.3.2 → freealg-0.3.3}/freealg.egg-info/top_level.txt +0 -0
  34. {freealg-0.3.2 → freealg-0.3.3}/pyproject.toml +0 -0
  35. {freealg-0.3.2 → freealg-0.3.3}/requirements.txt +0 -0
  36. {freealg-0.3.2 → freealg-0.3.3}/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.3
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,14 @@ 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
+ .. .. image:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
78
+ .. :align: left
79
+ .. :width: 240
80
+ .. :class: custom-dark
81
+
82
+ .. figure:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
77
83
  :align: left
78
84
  :width: 240
79
- :class: custom-dark
80
85
 
81
86
  `Paper <https://arxiv.org/abs/2506.11994>`__ |
82
87
  `Slides <https://www.dropbox.com/scl/fi/03gjuyz17k9yhsqy0isoz/free_decomporession_slides.pdf?rlkey=8f82mhciyl2ju02l7hv1md5li&st=26xmhjga&dl=0>`__ |
@@ -85,10 +90,11 @@ Dynamic: summary
85
90
 
86
91
  .. `Slides <https://ameli.github.io/freealg/_static/data/slides.pdf>`__ |
87
92
 
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.
93
+ *freealg* is a Python package that employs **free** probability to evaluate the
94
+ spectral densities of large matrix **form**\ s. The fundamental algorithm
95
+ employed by *freealg* is **free decompression**, which extrapolates from the
96
+ empirical spectral densities of small submatrices to infer the eigenspectrum
97
+ of extremely large matrices.
92
98
 
93
99
  Install
94
100
  =======
@@ -114,8 +120,8 @@ Documentation is available at `ameli.github.io/freealg <https://ameli.github.io/
114
120
  Quick Usage
115
121
  ===========
116
122
 
117
- The following code estimates the eigenvalues of a very large Wishart matrix using a much
118
- smaller Wishart matrix.
123
+ The following code estimates the eigenvalues of a very large Wishart matrix
124
+ using a much smaller Wishart matrix.
119
125
 
120
126
  .. code-block:: python
121
127
 
@@ -124,7 +130,8 @@ smaller Wishart matrix.
124
130
  >>> A = mp.matrix(1000) # Sample a 1000 x 1000 Wishart matrix
125
131
  >>> eigs = fa.eigfree(A, 100_000) # Estimate the eigenvalues of 100000 x 100000
126
132
 
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>`__.
133
+ For more details on how to interface with *freealg* check out the
134
+ `Quick Start Guide <https://github.com/ameli/freealg/blob/main/notebooks/quick_start.ipynb>`__.
128
135
 
129
136
 
130
137
  Test
@@ -148,9 +155,9 @@ How to Contribute
148
155
  =================
149
156
 
150
157
  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.
158
+ our [Contributing Guidelines](https://github.com/ameli/freealg/blob/main/CONTRIBUTING.rst)
159
+ before submitting their code. If you do not feel comfortable modifying the
160
+ code, we also welcome feature requests and bug reports.
154
161
 
155
162
  How to Cite
156
163
  ===========
@@ -1,7 +1,11 @@
1
- .. image:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
1
+ .. .. image:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
2
+ .. :align: left
3
+ .. :width: 240
4
+ .. :class: custom-dark
5
+
6
+ .. figure:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
2
7
  :align: left
3
8
  :width: 240
4
- :class: custom-dark
5
9
 
6
10
  `Paper <https://arxiv.org/abs/2506.11994>`__ |
7
11
  `Slides <https://www.dropbox.com/scl/fi/03gjuyz17k9yhsqy0isoz/free_decomporession_slides.pdf?rlkey=8f82mhciyl2ju02l7hv1md5li&st=26xmhjga&dl=0>`__ |
@@ -10,10 +14,11 @@
10
14
 
11
15
  .. `Slides <https://ameli.github.io/freealg/_static/data/slides.pdf>`__ |
12
16
 
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.
17
+ *freealg* is a Python package that employs **free** probability to evaluate the
18
+ spectral densities of large matrix **form**\ s. The fundamental algorithm
19
+ employed by *freealg* is **free decompression**, which extrapolates from the
20
+ empirical spectral densities of small submatrices to infer the eigenspectrum
21
+ of extremely large matrices.
17
22
 
18
23
  Install
19
24
  =======
@@ -39,8 +44,8 @@ Documentation is available at `ameli.github.io/freealg <https://ameli.github.io/
39
44
  Quick Usage
40
45
  ===========
41
46
 
42
- The following code estimates the eigenvalues of a very large Wishart matrix using a much
43
- smaller Wishart matrix.
47
+ The following code estimates the eigenvalues of a very large Wishart matrix
48
+ using a much smaller Wishart matrix.
44
49
 
45
50
  .. code-block:: python
46
51
 
@@ -49,7 +54,8 @@ smaller Wishart matrix.
49
54
  >>> A = mp.matrix(1000) # Sample a 1000 x 1000 Wishart matrix
50
55
  >>> eigs = fa.eigfree(A, 100_000) # Estimate the eigenvalues of 100000 x 100000
51
56
 
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>`__.
57
+ For more details on how to interface with *freealg* check out the
58
+ `Quick Start Guide <https://github.com/ameli/freealg/blob/main/notebooks/quick_start.ipynb>`__.
53
59
 
54
60
 
55
61
  Test
@@ -73,9 +79,9 @@ How to Contribute
73
79
  =================
74
80
 
75
81
  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.
82
+ our [Contributing Guidelines](https://github.com/ameli/freealg/blob/main/CONTRIBUTING.rst)
83
+ before submitting their code. If you do not feel comfortable modifying the
84
+ code, we also welcome feature requests and bug reports.
79
85
 
80
86
  How to Cite
81
87
  ===========
@@ -0,0 +1 @@
1
+ __version__ = "0.3.3"
@@ -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.3
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,14 @@ 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
+ .. .. image:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
78
+ .. :align: left
79
+ .. :width: 240
80
+ .. :class: custom-dark
81
+
82
+ .. figure:: https://raw.githubusercontent.com/ameli/freealg/refs/heads/main/docs/source/_static/images/icons/logo-freealg-light.png
77
83
  :align: left
78
84
  :width: 240
79
- :class: custom-dark
80
85
 
81
86
  `Paper <https://arxiv.org/abs/2506.11994>`__ |
82
87
  `Slides <https://www.dropbox.com/scl/fi/03gjuyz17k9yhsqy0isoz/free_decomporession_slides.pdf?rlkey=8f82mhciyl2ju02l7hv1md5li&st=26xmhjga&dl=0>`__ |
@@ -85,10 +90,11 @@ Dynamic: summary
85
90
 
86
91
  .. `Slides <https://ameli.github.io/freealg/_static/data/slides.pdf>`__ |
87
92
 
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.
93
+ *freealg* is a Python package that employs **free** probability to evaluate the
94
+ spectral densities of large matrix **form**\ s. The fundamental algorithm
95
+ employed by *freealg* is **free decompression**, which extrapolates from the
96
+ empirical spectral densities of small submatrices to infer the eigenspectrum
97
+ of extremely large matrices.
92
98
 
93
99
  Install
94
100
  =======
@@ -114,8 +120,8 @@ Documentation is available at `ameli.github.io/freealg <https://ameli.github.io/
114
120
  Quick Usage
115
121
  ===========
116
122
 
117
- The following code estimates the eigenvalues of a very large Wishart matrix using a much
118
- smaller Wishart matrix.
123
+ The following code estimates the eigenvalues of a very large Wishart matrix
124
+ using a much smaller Wishart matrix.
119
125
 
120
126
  .. code-block:: python
121
127
 
@@ -124,7 +130,8 @@ smaller Wishart matrix.
124
130
  >>> A = mp.matrix(1000) # Sample a 1000 x 1000 Wishart matrix
125
131
  >>> eigs = fa.eigfree(A, 100_000) # Estimate the eigenvalues of 100000 x 100000
126
132
 
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>`__.
133
+ For more details on how to interface with *freealg* check out the
134
+ `Quick Start Guide <https://github.com/ameli/freealg/blob/main/notebooks/quick_start.ipynb>`__.
128
135
 
129
136
 
130
137
  Test
@@ -148,9 +155,9 @@ How to Contribute
148
155
  =================
149
156
 
150
157
  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.
158
+ our [Contributing Guidelines](https://github.com/ameli/freealg/blob/main/CONTRIBUTING.rst)
159
+ before submitting their code. If you do not feel comfortable modifying the
160
+ code, we also welcome feature requests and bug reports.
154
161
 
155
162
  How to Cite
156
163
  ===========
@@ -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