# numericalNullity -- computes numerical kernel dimension of a matrix

## Synopsis

• Usage:
numericalNullity M
• Inputs:
• M, , with real or complex entries
• Optional inputs:
• Precondition => ..., default value false
• SVDGap => ..., default value 100000
• Verbose => ..., default value false, display detailed output
• Outputs:
• an integer, dimension of the kernel of M

## Description

This method computes the dimension of the kernel of a matrix with real or complex entries numerically, via singular value decomposition (see SVD).

If $\sigma_1 \ge \ldots \ge \sigma_n$ are the singular values of $M$, then to establish the nullity numerically we look for the largest "significant" gap between two consecutive singular values, where the gap between $\sigma_i$ and $\sigma_{i+1}$ is "significant" if the ratio $\sigma_i / \sigma_{i+1}$ exceeds the value of SVDGap. If a gap is found which is greater than this threshold, then all singular values after this gap are considered as numerically zero; if all gaps are less than this threshold, then the matrix is considered numerically full rank. The default value of SVDGap is $1e5$.

The option Precondition specifies whether the rows of M will be normalized to have norm $1$ before computing the SVD. This helps reveal nullity if the matrix is dense (e.g. for a generic interpolation matrix), but not if the matrix is sparse (e.g. diagonal). The default value is false.

 i1 : numericalNullity(matrix{{2, 1}, {0, 1e-5}}, Precondition => false) o1 = 1 i2 : numericalNullity(map(CC^2,CC^2,0)) o2 = 2

## Caveat

The option SVDGap may require tuning by the user.