aiidateam / aiida-quantumespresso

The official AiiDA plugin for Quantum ESPRESSO
https://aiida-quantumespresso.readthedocs.io
Other
54 stars 78 forks source link

`PwRelaxWorkChain`: Use multiple relaxations with increasing precision #733

Open mbercx opened 3 years ago

mbercx commented 3 years ago

Problem description

In the current approach for the PwRelaxWorkChain, the initial relaxation run immediately uses the desired electronic precision settings provided by the user (or protocol). Typically these settings are very strict, and potentially difficult to obtain with a structure that is still far from the geometric minimum. Moreover, having a very precise calculation of the forces is not so critical when still far from the minimum.

Desired feature

I've already discussed with both @mkotiuga and @simonpintarelli that it might be more interesting to start with a first run with reduced precision settings, to then move to the ones specified (either immediately or in multiple runs). This might be something worthwhile to explore, both to:

  1. Improve convergence: especially when starting from less-sensible initial geometries, very precise electronic convergence can be difficult to obtain.
  2. Improve efficiency: obtaining such strict electronic convergence will not influence the initial relaxation steps much, and running with lower k-point densities and less strict energy thresholds can have a large effect on the runtime.

Potential issues

Of course, it will require some testing to figure out if there is truly a benefit from implementing such a logic in the work chain. There is also the issue that this might lead to different results, so we'll have to carefully check this.

mkotiuga commented 3 years ago

Just to follow up, I have successfully used a two-step relax workchain that I wrote for this purpose for a set of perovskite structures where some of the starting structures are not really physical. In these cases the bigger problem arises from the electronic conv_thr, and the error handling of the normal relax workchain reduces the beta mixing parameter when electronic convergence is not reached in the requisite number of steps, and often fails.

The two steps I did had, for step one, a moderate electronic and force tolerance and then, for step two, quite tight tolerances. Looking at these runs, i think it would have worked to use the same, tight force tolerance for both steps, and just change the electronic tolerance between step one and two. I don't know which of these two would ultimately run faster.

giovannipizzi commented 1 year ago

One comment on this. Should we try to restart form the charge density of the previous run? I'm quite sure that this will speed up convergence of the later runs considerably

mbercx commented 1 year ago

One comment on this. Should we try to restart form the charge density of the previous run? I'm quite sure that this will speed up convergence of the later runs considerably

Fair point, I see no reason why not? Also related to https://github.com/aiidateam/aiida-quantumespresso/issues/938.