def estimate_spectral_norm(A, its=<NUM_LIT:20>):
from scipy.sparse.linalg import aslinearoperator<EOL>A = aslinearoperator(A)<EOL>m, n = A.shape<EOL>matvec = lambda x: A. matvec(x)<EOL>matveca = lambda x: A.rmatvec(x)<EOL>if _is_real(A):<EOL><INDENT>return backend.idd_snorm(m, n, matveca, matvec, its=its)<EOL><DEDENT>else:<EOL><INDENT>return backend.idz_snorm(m, n, matveca, matvec, its=its)<EOL><DEDENT>
Estimate spectral norm of a matrix by the randomized power method.

..  This function automatically detects the matrix data type and calls the
    appropriate backend. For details, see :func:`backend.idd_snorm` and
    :func:`backend.idz_snorm`.

Parameters
----------
A : :class:`scipy.sparse.linalg.LinearOperator`
    Matrix given as a :class:`scipy.sparse.linalg.LinearOperator` with the
    `matvec` and `rmatvec` methods (to apply the matrix and its adjoint).
its : int
    Number of power method iterations.

Returns
-------
float
    Spectral norm estimate.