freealg.slogdet#

freealg.slogdet(A, N=None)#

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.

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.

Returns:
signfloat

Sign of determinant

ldfloat

natural logarithm of the absolute value of the determinant

See also

eigh
cond
trace
norm

Notes

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

Examples

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

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