sparse.coherence.mutual_coherence

sparse.coherence.mutual_coherence(mat)[source]

For an arbitrary input matrix \(\boldsymbol{A}\) of size N x M, the mutual coherence is the maximal absolute inner-product between its normalized columns \(\{ a_i \mid i=1,2,...,M \}\):

(1)\[\mu (\boldsymbol{A}) = \max_{1 \le i < j \le M} \frac{\mid a_i^\top a_j \mid}{\|a_i\|_2 \|a_j\|_2}\]

The mutual coherence \(\mu\) lies in range [0, 1].

At the same time, the Spark lower bound of a matrix is estimated as

(2)\[\text{Spark}(\boldsymbol{A}) \ge 1 + \frac{1}{\mu(\boldsymbol{A})}\]
Parameters
mat(N, M) np.ndarray

The input matrix \(\boldsymbol{A}\).

Returns
CoherenceSpark
A namedtuple with two attributes:

.coherence - mutual coherence of mat;

.spark - Spark lower bound (2) of mat.