freealg.cond#

freealg.cond(A, size=None, seed=None, **kwargs)#

Estimate the condition number of a Hermitian positive-definite matrix.

This function estimates the condition number 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 condition number (or that 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.

seedint, default=None

The seed for the Quasi-Monte Carlo sampler.

**kwargsdict, optional

Pass additional options to the underlying FreeForm.decompress() function.

Returns:
cfloat

Condition number

Notes

This is a convenience function using freealg.eigvalsh().

Examples

>>> from freealg import cond
>>> from freealg.distributions import MarchenkoPastur

>>> mp = MarchenkoPastur(1/50)
>>> A = mp.matrix(3000)
>>> cond(A)