{ } Raw JSON

bundles / scipy 1.18.0 / scipy / sparse / linalg / _expm_multiply / traceest

function

scipy.sparse.linalg._expm_multiply:traceest

source: /scipy/sparse/linalg/_expm_multiply.py:45

Signature

def traceest(A, m3, seed = None)

Summary

Estimate np.trace(A) using 3*m3 matrix-vector products.

Extended Summary

The result is not deterministic.

Parameters

A : LinearOperator

Linear operator whose trace will be estimated. Has to be square.

m3 : int

Number of matrix-vector products divided by 3 used to estimate the trace.

seed : optional

Seed for numpy.random.default_rng. Can be provided to obtain deterministic results.

Returns

trace : LinearOperator.dtype

Estimate of the trace

Notes

This is the Hutch++ algorithm given in [1].

Aliases

  • scipy.sparse.linalg._expm_multiply.traceest