freealg.eigh#
- freealg.eigh(A, N=None, psd=None, plots=False)#
Estimate the eigenvalues of a matrix.
This function estimates the eigenvalues of the matrix \(\mathbf{A}\) or a larger matrix containing \(\mathbf{A}\) using free decompression.
- Parameters:
- Anumpy.ndarray
The symmetric real-valued matrix \(\mathbf{A}\) whose eigenvalues (or those of a matrix containing \(\mathbf{A}\)) are to be computed.
- Nint, default=None
The size of the matrix containing \(\mathbf{A}\) to estimate eigenvalues of. If None, returns estimates of the eigenvalues of \(\mathbf{A}\) itself.
- psdbool, default=None
Determines whether the matrix is positive-semidefinite (PSD; all eigenvalues are non-negative). If None, the matrix is considered PSD if all sampled eigenvalues are positive.
- plotsbool, default=False
Print out all relevant plots for diagnosing eigenvalue accuracy.
- Returns:
- eigsnumpy.array
Eigenvalues of decompressed matrix
See also
Notes
This is a convenience function for the
freealg.FreeForm
class with some effective defaults that work well for common random matrix ensembles. For improved performance and plotting utilites, consider fine-tuning parameters using the FreeForm class.References
[1]Reference.
Examples
>>> from freealg import cond >>> from freealg.distributions import MarchenkoPastur >>> mp = MarchenkoPastur(1/50) >>> A = mp.matrix(3000) >>> eigs = eigh(A)