Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure MP VASP sets don't use auto_ismear, few other fixes #673

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

esoteric-ephemera
Copy link
Contributor

In response to issue #672, all MP VASP input sets now set auto_ismear = False by default. This change leads to the following behavior:

  • GGA workflow always uses tetrahedron smearing (ISMEAR = -5, SIGMA = 0.05). This is consistent with the atomate GGA workflow and left for consistency
  • meta-GGA workflow uses Gaussian smearing (ISMEAR = 0, SIGMA = 0.05) for relaxations and tetrahedron smearing (ISMEAR = -5, SIGMA = 0.05) for the final static. This is not quite the behavior from the atomate workflow, but is a minor change given that the atomate wf didn't include a static or CHG/WAVECAR initialization like the atomate2 one does
  • The meta-GGA workflow behavior is consistent with the wf structure moving forwards with MP
  • Updated test files to reflect these changes

Few other fixes/improvements:

  • Removed dependence on pkg_resources.resource_filename as this has been deprecated in favor of importlib.resources.files
  • Froze the MACE model used in the elastic forcefield workflow test - I saw that the test could fail (link) when the model couldn't be downloaded on the fly

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4cd1e19) 76.26% compared to head (3d00f3e) 76.13%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #673      +/-   ##
==========================================
- Coverage   76.26%   76.13%   -0.13%     
==========================================
  Files          87       87              
  Lines        7132     7140       +8     
  Branches     1055     1055              
==========================================
- Hits         5439     5436       -3     
- Misses       1369     1381      +12     
+ Partials      324      323       -1     
Files Coverage Δ
src/atomate2/cp2k/sets/base.py 64.15% <100.00%> (ø)
src/atomate2/vasp/sets/base.py 73.98% <100.00%> (ø)
src/atomate2/vasp/sets/matpes.py 87.50% <100.00%> (ø)
src/atomate2/vasp/sets/mp.py 93.02% <100.00%> (+1.59%) ⬆️

... and 1 file with indirect coverage changes

@mkhorton
Copy link
Member

Asking to clarify: is this issue in relation to the MP GGA (PBE) workflow, or the MP GGA (PBEsol) workflow used to bootstrap the R2SCAN calculation?

If the former, I thought the historical behaviour was to use Gaussian smearing (ISMEAR=0) as a sensible default for relaxations, and tetrahedron only for statics?

@esoteric-ephemera
Copy link
Contributor Author

esoteric-ephemera commented Jan 11, 2024

It ends up being both workflows (not just the PBEsol pre-relax) because the value of ISMEAR changes according to bandgap. We don't necessarily want Methfessel-Paxton smearing in case a system is incorrectly predicted to be a metal in the GGA pre-relax.

If the former, I thought the historical behaviour was to use Gaussian smearing (ISMEAR=0) as a sensible default for relaxations, and tetrahedron only for statics?

I recall looking into the atomate workflows and finding that the OptimizeFW defaults to MPRelaxSet with no further changes to ISMEAR. That ends up giving ISMEAR = -5 in relaxations.

I've also done some sanity checks against the MP task docs, and it looks like ISMEAR = -5 was always used in GGA relaxations.

@utf
Copy link
Member

utf commented Jan 11, 2024

Thanks @esoteric-ephemera. Can I just ask about the motivation for disabling auto_ismear - is that for consistency with atomate1/pymatgen input sets or is there another reason? (Sorry if I missed it in another issue somewhere)

@esoteric-ephemera
Copy link
Contributor Author

Hey @utf, for the GGA workflow, it's consistency with atomate. To be consistent with atomate, the meta-GGA workflow would have to start with Methfessel-Paxton smearing (ISMEAR = 2, SIGMA = 0.2) and then switch to tetrahedron (ISMEAR = -5, SIGMA = 0.05) if the gap in the PBEsol step is nonzero

I will say I'm in the process of running the "new" (updated pseudopotentials, parameters and hopefully +U's) workflows for both meta-/GGA workflows. So if we'd rather have these exist just as their atomate 1 equivalents, I'm happy to make that change

@utf
Copy link
Member

utf commented Jan 11, 2024

Understood! I think this is ok for now. Thanks very much.

@utf utf merged commit b9b97fe into materialsproject:main Jan 11, 2024
7 checks passed
@mkhorton
Copy link
Member

Thanks @esoteric-ephemera, not the first time my memory has been incorrect :)

@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Jan 12, 2024

FYI, the MACE model downloading issue is fixed in main of the MACE repo. It's a security flag raised by Google Drive.

@Andrew-S-Rosen
Copy link
Member

@esoteric-ephemera --- with this change, is ISMEAR always equal to 0 and SIGMA always equal to 0.05 in the MP meta-GGA relax and pre-relax steps (unless changed by Custodian)? I'm not opposed -- I just want to make sure I'm understanding this correctly.

@esoteric-ephemera
Copy link
Contributor Author

esoteric-ephemera commented Feb 20, 2024

That's right @Andrew-S-Rosen. To clarify and document these changes:

For the pre-relaxation , ISMEAR = 0, SIGMA = 0.05, KSPACING = 0.22. The r2SCAN relax continues with 0.22 (metal) <= KSPACING <= 0.44 (wide-gap insulator) and ISMEAR = 0. The final r2SCAN static uses ISMEAR = -5. SIGMA = 0.05 is unchanged through this.

This is mostly to avoid situations where Methfessel-Paxton (ISMEAR > 0) smearing is used to relax insulators, or tetrahedron (ISMEAR = -5) method is used to relax metals. The atomate 1 r2SCAN flow had the former problem, the PBE flow has the latter problem

@Andrew-S-Rosen
Copy link
Member

Thanks!! For clarification: presumably you meant KSPACING instead of SIGMA for the 0.22 to 0.44 comment.

@esoteric-ephemera
Copy link
Contributor Author

Whoops yes thanks! Corrected above

@utf utf added the enhancement Improvements to existing features label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants