This method computes the dimension of the kernel of a matrix with real or complex entries numerically, via singular value decomposition (see SVD).
If σ1 ≥...≥σ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 σi and σi+1 is "significant" if the ratio σi / σ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 |
The option SVDGap may require tuning by the user.