freealg.slogdet#

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

Estimate the sign and logarithm of the determinant of a Hermitian matrix.

This function estimates the slogdet 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:
signfloat

Sign of determinant

ldfloat

natural logarithm of the absolute value of the determinant

See also

eigvalsh
cond
trace
norm

Notes

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

Examples

>>> from freealg import norm
>>> from freealg.distributions import MarchenkoPastur

>>> mp = MarchenkoPastur(1/50)
>>> A = mp.matrix(3000)
>>> sign, ld = slogdet(A, 100_000)