Convergence Problems

From Deskins Group Resources
Revision as of 11:44, 18 February 2020 by Nadeskins (talk | contribs)

My calculation didn't work!

This is a common complaint when performing molecular modeling simulations. You start the calculation, and come back many hours later to find it didn't finish correctly or didn't converge. This usually means either (1) the calculation crashed (hopefully with error messages that you can google) or (2) the calculation is taking a very long time, perhaps despite restarting the calculation multiple times.

Below we discuss several issues related to converging simulations. Recall that there are two convergence loops that DFT calculations will run through: wavefunction optimization (i.e. scf convergence) and geometry optimization. The program first determines the wavefunction for a given geometry, which gives the forces and energies of that geometry. Then the program will update the geometry to a new structure based on the calculated forces. It will re-calculate the wavefunction, then geometry, and repeat until the system is finally converged and the geometry is optimized.

Geometry Optimization Problems

Geometry optimization aims to find the geometry where the forces are zero (or close enough). The structure with zero forces is the most stable, or ground structure. The problem is that there are usually many variables to change and optimize. Every atom has three coordinates that can be changed (x, y, z coordinates). So finding the ground structure is not always straight-forward. See below for a relatively simple example (water). The ground structure for water occurs at a specific bond angle and bond distance. Larger molecules have many more variables to optimize. Numerical algorithms are used to keep trying geometries until the ground structure is found, and sometimes they don't always work.

Potential Energy Surface for Water.png

What should I do about geometry problems?

  1. Monitor the energies and forces of your calculation. Are they going up over time? Going down? Oscillating? This can tell you if optimization is proceeding correctly or not. This program grad2 by Peter Larsson may be useful in monitoring the forces during a VASP simulation.
  2. Check the geometry. Does something look strange or wrong? Are some bonds broken that shouldn't be broken? Has the structure fallen apart, or appear to be converging to some undesired geometry? If things look bad, you probably need to restart the calculation with a better initial geometry.
  3. Garbage In = Garbage Out. If you start with an initial bad geometry, you'll end up with a final bad geometry. So always try to start with a good initial geometry. Set bond distances to reasonable values. Otherwise the optimization could explode or go very wrong. Get good guesses of initial geometries (or bond distances) from the literature or past calculations.
  4. Sometimes an optimization gets stuck in a very shallow energy well, or a local minimum. A perturbation of the geometry may help get out of this well. Move a key atom (or atoms) some distance, like 0.2 to 0.4 Å in some random direction.
  5. Increase the number of geometry optimization steps (NSW in VASP). Sometimes the default number of allowed geometry optimization steps isn't enough and you need more time to optimize the geometry.
  6. Change the optimization algorithm/settings. Default settings may not be most efficient or always work. So try different settings in your code. For instance, in VASP you might change IBRION to 1 from 2 (or vice versa).
  7. Google for help. The internet may have ideas to help.
  8. Be patient. Sometimes you just need to wait a long time for geometry optimization to converge, especially if you are far from the ground structure.


Electronic SCF Problems