freealg.FreeForm.trace#

FreeForm.trace(size=None, p=1.0, seed=None, **kwargs)#

Estimate the trace of a power.

This function estimates the trace of the matrix power \(\mathbf{A}^p\) of the freeform or that of a larger matrix containing it.

Parameters:
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.

pfloat, default=1.0

The exponent \(p\) in \(\mathbf{A}^p\).

seedint, default=None

The seed for the Quasi-Monte Carlo sampler.

**kwargsdict, optional

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

Returns:
tracefloat

matrix trace

Notes

The trace is highly amenable to subsampling: under free decompression the average eigenvalue is assumed constant, so the trace increases linearly. Traces of powers fall back to eigvalsh(). All arguments to the .decompress() procedure can be provided.

Examples

>>> from freealg import FreeForm