I have read that the Cholesky decomposition of a matrix in Numpy/Scipy only works if it's positive definite. Indeed, the following doesn't work, as the matrix is positive semi-definite
np.linalg.cholesky([[1, 0], [0, 0]])
numpy.linalg.linalg.LinAlgError: Matrix is not positive definite
However, I am using a symmetric positive semi-definite matrix, for which Numpy does the decomposition without error:
np.linalg.cholesky([[2, 6], [6, 18]])
array([[1.41421356e+00, 0.00000000e+00],
[4.24264069e+00, 5.64928468e-08]])
What is happening? Both matrices in my tests are positive semi-definite, but from what I read, I expected the Cholesky decomposition in Numpy/Scipy to only work with positive definite matrices and give a LinAlgError, otherwise.