- class ConjugateGradient(controller, nreset=20)#
Implementation of the Conjugate Gradient scheme.
- It is an iterative method for solving a linear system of equations:
Ax = b
nifty7.IterationController) – Object that decides when to terminate the minimization.
nreset (int) – every nreset CG steps the residual will be recomputed accurately by applying the operator instead of updating the old residual
Jorge Nocedal & Stephen Wright, “Numerical Optimization”, Second Edition, 2006, Springer-Verlag New York
- __call__(energy, preconditioner=None)#
Runs the conjugate gradient minimization.
energy (Energy object at the starting point of the iteration.) – Its metric operator must be independent of position, otherwise linear conjugate gradient minimization will fail.
preconditioner (Operator optional) – This operator can be provided which transforms the variables of the system to improve the conditioning. Default: None.
QuadraticEnergy – state at last point of the iteration
int – Can be controller.CONVERGED or controller.ERROR