Vasp calculator does wrong thing to detect convergence
The Vasp calculator does its own check of the progress of the SCF to decide if the calculation has converged, rather than relying on Vasp's output. While I'm not sure what older Vasp versions output, so this might have been required at some point, it definitely does the wrong thing, in particular claiming that certain runs are converged when they are not. For example, a nearly trivial INCAR
INCAR created by Atomic Simulation Environment
ENCUT = 200.000000
KSPACING = 1.000000
NELM = 5
leads to the following lines in the OUTCAR
total energy-change (2. order) : 0.6070686E+00 (-0.1474224E+03)
total energy-change (2. order) :-0.1144953E+01 (-0.1144960E+01)
total energy-change (2. order) :-0.1175126E-02 (-0.1175125E-02)
total energy-change (2. order) :-0.2201129E-06 (-0.2221734E-06)
total energy-change (2. order) :-0.4888392E-09 (-0.3274172E-10)
The current calculator thinks the calculation is converged at this point, because all it does is compare these numbers to EDIFF
.
However, Vasp itself does not think it is converged, as can be seen in the output when NELM
is larger
total energy-change (2. order) : 0.6070686E+00 (-0.1474224E+03)
total energy-change (2. order) :-0.1144953E+01 (-0.1144960E+01)
total energy-change (2. order) :-0.1175126E-02 (-0.1175125E-02)
total energy-change (2. order) :-0.2201129E-06 (-0.2221734E-06)
total energy-change (2. order) :-0.4888392E-09 (-0.3274172E-10)
total energy-change (2. order) : 0.7284229E-01 (-0.1792280E-03)
total energy-change (2. order) : 0.4100093E-01 (-0.3446913E-03)
total energy-change (2. order) : 0.2405281E-04 (-0.4504327E-05)
It so happens that at the 5th iteration the apparent energy change is small, but Vasp continues, and reaches convergence after 8 iterations.
I don't think the ASE wrapper can, or should, reproduce Vasp's internal decisions of when the calculation is converged. At least with Vasp 6, it outputs 'aborting loop because EDIFF is reached'
or 'aborting loop EDIFF was not reached (unconverged) '
, and it should use that information if it's available.