5.15.4. minimizer.cg_test

eminus.minimizer.cg_test(atoms, ik, g, g_old, precondition=True)[source]

Test the gradient-orthogonality theorem, i.e., g and g_old should be orthogonal.

Calculate the cosine of the angle between g and g_old. For an angle of 90 degree the cosine goes to zero.

Reference: https://math.uci.edu/~chenlong/CAMtips/CG.html

Parameters:
  • atoms – Atoms object.

  • ik – k-point index.

  • g – Current gradient.

  • g_old – Previous gradient.

Keyword Arguments:

precondition – Whether to use a preconditioner.

Returns:

CG angle.