- psi4.driver.p4util.cg_solver(rhs_vec, hx_function, preconditioner, guess=None, printer=None, printlvl=1, maxiter=20, rcond=1e-06)¶
Solves the \(Ax = b\) linear equations via Conjugate Gradient. The A matrix must be a hermitian, positive definite matrix.
int) – The level of printing provided by this function.
int) – The maximum number of iterations this function will take.
float) – The residual norm for convergence.
ret – Solved x vectors and r vectors.
- Return type:
This is a generalized cg solver that can also take advantage of solving multiple RHS’s simultaneously when it is advantageous to do so.