netket.optimizer.solver.cholesky_with_fallback#
- netket.optimizer.solver.cholesky_with_fallback(A, b, *, rtol=1e-14, rtol_smooth=1e-14, x0=None)[source]#
Solve the linear system using a Cholesky factorisation, automatically falling back to
pinv_smooth()when the result contains NaN or Inf.This combines the speed of
cholesky()with the robustness ofpinv_smooth(). Refer to their docstring for complete information.The returned info dict always contains a
"solver_fallback"key indicating whether the fallback was activated.Note
This is exactly equivalent to using
nan_fallback()asnan_fallback(cholesky, pinv_smooth(rtol=rtol, rtol_smooth=rtol_smooth)).- Parameters:
A – the matrix A in Ax=b
b – the vector or pytree b in Ax=b
rtol (
float) – Relative tolerance for small eigenvalues ofA, passed topinv_smooth(). Eigenvalues smaller thanrtoltimes the largest are truncated.rtol_smooth (
float) – Soft regularisation parameter passed topinv_smooth(). Seepinv_smooth()for details.x0 – unused