nomad-coe / electronic-parsers

Apache License 2.0
18 stars 7 forks source link

Minor issues when parsing Quantum ESPRESSO geometry optimizations #201

Open ondracka opened 4 months ago

ondracka commented 4 months ago

Nothing here is really critical or something I would need fixed right away, just few stuff I noticed when uploading some QE files.

The last one might be related to somehow special way how QE is doing the geometry optimization (at least with variable cell shape), but is related to how things work also in other DFT codes. In general when doing variable cell relaxation, and thus changing the cell volume, while having a fixed planewave cutoff energy parameter, the basis set would in theory need to change at every step. This would however lead to numerical instabilities. Thus for practical purposes the basis set (and fft grids, etc.) are kept constant during the relaxation. This however means that at the last step of the relaxation, user is no longer guaranteed to have the initial precision (as defined for example by the planewave cutoff energy or fft grid densities) specified at the beginning. This is also know for example for VASP https://www.vasp.at/wiki/index.php/Energy_vs_volume_Volume_relaxations_and_Pulay_stress .

What QE does is that after the relaxation run finishes, it will do one more scf calculation, with new basis set and fft grids corresponding to the originally defined user settings. This can result in significant changes in energy and forces (especially if the volume change was large). My theory is that the QE parser treats this last step as a normal step in the relaxation and thus the Final Displacement Maximum (Å) and Final Energy Difference (eV) are too large.

See for example this entry: https://nomad-lab.eu/prod/v1/staging/gui/search/entries/entry/id/zOkT8WMowB3iajPfJbh4uI-PbLoV the final displacement maximum is larger that the cell parameter (dunno what is really going on here, might be also a bug somewhere) and Final Energy Difference (eV) is also too big. image

The question is what to do in the parser, disregarding the last step is probably a bad idea as it is the most precise one (if one is interested in the final stress, forces, or energy), one option could be to create two entries, one for the relaxation and than another single point for the last calculation and somehow link them so this might be related also to https://github.com/nomad-coe/electronic-parsers/issues/161 @ladinesa @ndaelman-hu what would be correct way to treat this behavior?

ladinesa commented 4 months ago

This is just a suspicion. For the final energy difference, The value is the last non-zero diff of between consecutive steps. In this case, because the value is zero for the converged values hence not returned. For the displacement maximum, the atoms are not properly wrapped to the original cell. I will look at both problems and will provide a fix. Because this is a normalizer issue, I will put up the issue in simulation workflow schema project.

ondracka commented 4 months ago

Thanks, I'll take a look at the forces issue, it looks like there is some code for that already in the parser, so probably just needs some tweaks to make it work.