is_positive_definite_matrix

forest.benchmarking.operator_tools.validate_operator.is_positive_definite_matrix(matrix: numpy.ndarray, rtol: float = 1e-05, atol: float = 1e-08) → bool

Checks if a square Hermitian matrix A is positive definite, \(eig(A) > 0\).

In this numerical implementation we check if each eigenvalue obeys \(eig(A) > -|atol|\), the strict condition can be recovered by setting atol = 0.

Parameters:
  • matrix – a M by M Hermitian matrix.
  • rtol – The relative tolerance parameter in np.allclose
  • atol – The absolute tolerance parameter in np.allclose
Returns:

True if the matrix is normal; False otherwise.