aiidateam / aiida-quantumespresso

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

Switch to tetrahedron method for insulators? #800

Open ltalirz opened 2 years ago

ltalirz commented 2 years ago

Given that the tetrahedron method will yield a more accurate total energy in calculations if there is a gap (i.e. except in the case of metals), it seems like a good idea to use occupations='tetrahedra_opt' in such cases.

This is also the approach taken in the MPRelaxSet - they actually default to the tetrahedron method and switch back to smearing when detecting a metal, unless it's a static calculation i.e. the accuracy of forces is not a concern).

mbercx commented 1 year ago

Thanks @ltalirz, and sorry for missing this suggestion. fixed actually also causes problems when trying to run spin-polarised calculations (see this comment), so I will adapt the protocol method to use tetrahedra_opt in this case for sure.

In general, I'm not sure whether to prefer fixed vs tetrahedra_opt for non spin-polarised calculations. @sphuber do you remember why we chose fixed?

sphuber commented 1 year ago

Not sure to be honest. The PW docs do mention that Bloechl's implementation is not suited for optimization calculations, which I take applies to our relax workflow. It is not clear if the optimized version tetrahedra_opt suffers from the same limitation.

unkcpz commented 1 year ago

Hi @mbercx, any update on how we should change this? I propose we can ask on the QE mailing list or send it to an expert directly.

mbercx commented 1 year ago

I can definitely update the protocol to at least give a calculation that doesn't fail when the user wants to run a spin-polarised calculation for an insulator, which is the problem for the QEapp.

ltalirz commented 1 year ago

The abstract of the optimized tetrahedron method mentions

Our method is applicable to various types of calculations such as the total energy, the charge (spin) density, response functions, and the phonon frequency, in contrast with the Blöchl correction, which is applicable to only the first two

I thought you have all the workflows set up. Why don't you just run them on 100 materials and compare the results?

ltalirz commented 1 year ago

Or if you want a single material, you could look at the phonons of MgB2 (discussed in the paper) that come out with the current phonon workflow vs when using tetrahedra_opt

unkcpz commented 1 year ago

If the insulators set, the occupations set to fixed in base workchain which will propagate to band structure calculation, I think it makes no sense to use fixed for the band structure calculation, correct? And using tetrahedra (also tetrahedra_opt) will break the band structure calculation with error:

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     Error in routine setup (1):
     tetrahedra need automatic k-point grid
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

     stopping ...

I think we need override the occupation of band protocol to use smearing no matter whether we use fixed or tetrahedra.