aiidateam / aiida-quantumespresso-hp

MIT License
3 stars 0 forks source link

`HpCalculation`: Stopping due to Fermi energy shift is not parsed #57

Closed t-reents closed 9 months ago

t-reents commented 10 months ago

I encountered the following error in a HpCalculation.

      =--------------------------------------------=
                 SOLVE THE LINEAR SYSTEM
      =--------------------------------------------=

      atom #  2   q point #   1   iter #   1

     Pert. #  1: Fermi energy shift (Ry) =    -4.4413E+01    -2.8580E-03

      WARNING: The Fermi energy shift is zero or too big!
      This may happen in two cases:
      1. The DOS at the Fermi level is too small:
         DOS(E_Fermi) =   -0.3691E-05
         This means that most likely the system has a gap,
         and hence it should NOT be treated as a metal
         (otherwise numerical instabilities will appear).
      2. Numerical instabilities due to too low cutoff
         for hard pseudopotentials.

      Stopping...

      Solution (for magnetic insulators):
      Try to use the 2-step scf procedure as in HP/example02

This was just a test run with less strict convergence criteria, very few k-points etc. (so it's reasonable that this appears). This error/premature stopping isn't parsed, wherefore the HpCalculation terminates with exit status 0. For example, the subsequent processes in a SelfConsistentHubbardWorkChain will fail as the expected output files are missing.

Suggestion: Add an exit code like ERROR_PREMATURE_STOPPING_FERMI.

bastonero commented 10 months ago

This is probably due to reason number 2. in this case. Thanks @t-reents for pointing this out (I have never had this issue before through the plugin).

For the exit code, what about ERROR_FERMI_SHIFT ? Honestly I never know what fits best.

t-reents commented 10 months ago

Yeah, I'm also always struggling with that but I think your suggestion seems appropriate.

It's not important at this stage but since I use the SSSP pseudos with recommended cutoffs, I would assume that the second reason should be fine. I would rather think that due to the small number of k-points, it's not correctly determined whether the system is metallic or not.