aiidateam / aiida-common-workflows

A repository for the implementation of common workflow interfaces across materials-science codes and plugins
https://aiida-common-workflows.readthedocs.io
MIT License
52 stars 30 forks source link

Agreement on smearing for SCF? #211

Open bosonie opened 3 years ago

bosonie commented 3 years ago

To determine the occupation of electronic states during the SCF cycle, DFT codes often use a smearing. Currently in our implementation each code select the preferred smearing in the spirit of using "the best available". Please note that METAL and INSULATOR electronic type might implement a different smearing (or no smearing, i.e. fixed occupation). Does it make sense to talk about a common approach in this respect? Also, recent developments might suggest problems in treating insulators with certain smearing. Ping @flavianojs for more insights on this. We have METAL as default to treat materials with unknown nature.

blokhin commented 3 years ago

We use a very simple technique to guess if we should expect metal or non-metal, hopefully it makes sense in this case as well:

def guess_metal(ase_obj):
    """
    Make an educated guess of the metallic compound character,
    returns bool
    """
    non_metallic_atoms = {
    'H',                                  'He',
    'Be',   'B',  'C',  'N',  'O',  'F',  'Ne',
                  'Si', 'P',  'S',  'Cl', 'Ar',
                  'Ge', 'As', 'Se', 'Br', 'Kr',
                        'Sb', 'Te', 'I',  'Xe',
                              'Po', 'At', 'Rn',
                                          'Og'
    }
    return not any([el for el in set(ase_obj.get_chemical_symbols()) if el in non_metallic_atoms])
bosonie commented 3 years ago

Thanks @blokhin for the feedback. This will definitely be useful when we will implement and "AUTOMATIC" ElectronicType. Here however it is more to discuss what kind of smearing to use in various cases.

@giovannipizzi @azadoks let's try to confine here the discussion.

bosonie commented 3 years ago

Let's try to summarize. So far a user can define a METAL or INSULATOR calculation. In case nothing is specified, METAL is assumed to be the safest choice. Soon we will merge a PR #215 that will extend to have an UNKNOWN choice (that will become the default) for a "safest" smearing. However here we would like to discuss to have a uniform choice of smearings among codes. So far each code implement its peculiar choice

bosonie commented 3 years ago

Here #176 a suggestion from the Abinit developers. Should we agree on that?

flavianojs commented 3 years ago

Hi guys,

Please see my comment in #176 . If you guys are in contact with the Abinit developers, we could implement and test the protocol I developed to tackle the non-unique Fermi energy problem when using cold smearing for semiconductors. I think that in one week's time, we could implement and test this protocol.

azadoks commented 3 years ago

Thanks for all the interest in this!

One thing we may want to tabulate first is which codes have which smearing methods implemented. If we're looking for a protocol that all (or nearly all) codes can use, it would be good to first know what the possibilities are. I'd worry about having cold smearing in the protocol if many codes need to implement cold smearing, Flaviano's method, or both.

bosonie commented 2 years ago

Stimulated by the project on oxides equation of states, we started to wonder what is the most feasible way to compare results among different codes. Two possibilities:

1) We let every code decide on the smearing type, smearing value, k-point density, but require very tight convergence. This means to try to converge to the limit 0T with different smearing. Up side: results are well converged and physical. Down side: some results might be unstable numerically: small smearing values, below 0.13eV /0.01 Ry, lead to an imprecise integration even with super dense k meshes. Moreover calculations will be relatively costly. Extra info: thanks to @sponce24 study, we have a demonstration that converging with different smearing types is feasible with quantum espresso and abinit. We also have an idea of the computational cost.

2) All the code use the same values for smearing and broadening. Which one? Extra info: a list of supported smearing types for each code has been collected and it reveals that only Fermi-Dirac is supported by every code.

This issue is relevant mostly for obtaining oxides results, but also to define guidelines for protocols. Let's also keep in mind that the definition of electronic type is very important for this issue. To know in advance if we are treating a metal or an insulator will make the treatment a lot clearer.