- # If ``A`` is symmetric and non-negative, we only need to check
- # that it is positive semidefinite. For that we can consult its
- # minimum eigenvalue, which should be zero or greater. Since ``A``
- # is symmetric, its eigenvalues are guaranteed to be real.
- return min(A.eigenvalues()) >= 0
+ # It's nonnegative, so all we need to do is check that it's
+ # symmetric positive-semidefinite.
+ return is_symmetric_psd(A)