import numpy as np from typing import cast, List def null( A: np.ndarray ) -> np.ndarray: A = np.atleast_2d(A) u, s, vh = np.linalg.svd(A) tol = max(1e-13, 0) nnz = (s >= tol).sum() return cast( np.ndarray, vh[nnz:].conj() )