How to calculate opnorm for a sparse matrix in julia?

In particular, the operator 2-norm \Vert A \Vert_2 is exactly equal to the largest singular value of A. For a large sparse matrix (or a matrix implicitly defined as a linear operator), you need to compute this by iterative methods, which are not included in SparseArrays but are provided by many packages.

For example, you can use KrylovKit.svdsolve(A)[1][1] from KrylovKit.jl to get the largest singular value of a sparse matrix A, equivalent to the operator norm.

PS. I edited @usaer’s original post to quote the code properly. Please see PSA: how to quote code with backticks

2 Likes