def _numeric_nullspace_dim(mat):
"""Numerically computes the nullspace dimension of a matrix."""
mat_numeric = np.array(mat.evalf().tolist(), dtype=complex)
eigenvals = la.eigvals(mat_numeric)
return np.sum(np.isclose(eigenvals, np.zeros_like(eigenvals)))
评论列表
文章目录