freealg.eigvalsh#
- freealg.eigvalsh(A, size=None, psd=None, seed=None, plot=False, **kwargs)#
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.
- sizeint, 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.
- seedint, default=None
The seed for the Quasi-Monte Carlo sampler.
- plotbool, default=False
Print out all relevant plots for diagnosing eigenvalue accuracy.
- **kwargsdict, optional
Pass additional options to the underlying
FreeForm.decompress()
function.
- 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 utilities, 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 = eigvalsh(A)