genvalues (1 of the maximum real part). Either the matrix is not PSD, or there was an issue while computing the eigendecomposition of the matrix. >>> _check_psd_eigenvalues([5, 5e-5j]) # insignificant imag part array([5., 0.]) >>> _check_psd_eigenvalues([-5, -1]) # all negative Traceback (most recent call last): ... ValueError: All eigenvalues are negative (maximum is -1). Either the matrix is not PSD, or there was an issue while computing the eigendecomposition of the matrix. >>> _check_psd_eigenvalues([5, -1]) # significant negative Traceback (most recent call last): ... ValueError: There are significant negative eigenvalues (0.2 of the maximum positive). Either the matrix is not PSD, or there was an issue while computing the eigendecomposition of the matrix. >>> _check_psd_eigenvalues([5, -5e-5]) # insignificant negative array([5., 0.]) >>> _check_psd_eigenvalues([5, 4e-12]) # bad conditioning (too small) array([5., 0.]) gñh㈵øä>g{