scipy.linalg.interpolative.

estimate_spectral_norm_diff#

scipy.linalg.interpolative.estimate_spectral_norm_diff(A, B, its=20, rng=None)[source]#

Estimate spectral norm of the difference of two matrices by the randomized power method.

Parameters:
Ascipy.sparse.linalg.LinearOperator

First matrix given as a scipy.sparse.linalg.LinearOperator with the matvec and rmatvec methods (to apply the matrix and its adjoint).

Bscipy.sparse.linalg.LinearOperator

Second matrix given as a scipy.sparse.linalg.LinearOperator with the matvec and rmatvec methods (to apply the matrix and its adjoint).

itsint, optional

Number of power method iterations.

rngnumpy.random.Generator, optional

Pseudorandom number generator state. When rng is None, a new numpy.random.Generator is created using entropy from the operating system. Types other than numpy.random.Generator are passed to numpy.random.default_rng to instantiate a Generator. If rand is False, the argument is ignored.

Returns:
float

Spectral norm estimate of matrix difference.