-
Notifications
You must be signed in to change notification settings - Fork 102
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
Clean up VASP powerups, correct params in MP flows, test for _set_u_params
, test for _set_kspacing
, fix _get_incar
method of VaspInputSet
#561
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #561 +/- ##
==========================================
- Coverage 75.65% 75.45% -0.20%
==========================================
Files 80 80
Lines 6729 6711 -18
Branches 996 992 -4
==========================================
- Hits 5091 5064 -27
- Misses 1331 1342 +11
+ Partials 307 305 -2
|
_set_u_params
@esoteric-ephemera @Andrew-S-Rosen Found different for bandgap, kspacing in ((10, 0.44), (3, 0.4136617), (1.1, 0.3064757), (0.5, 0.2832948), (0, 0.22)):
incar = MPScanRelaxSet(struct, bandgap=bandgap).incar
assert incar["KSPACING"] == approx(kspacing, abs=1e-5)
assert incar["ISMEAR"] == -5 if bandgap > 1e-4 else 2
assert incar["SIGMA"] == 0.05 if bandgap > 1e-4 else 0.2 |
Just added a test for |
_set_u_params
_set_u_params
, test for _set_kspacing
, fix _get_incar
method of VaspInputSet
Thanks for this. Just one comment.
I think you have this backwards. ISMEAR = -5 is very important for narrow-gapped systems. If we know the system has a gap, then we should always use ISMEAR = -5. |
src/atomate2/vasp/sets/base.py
Outdated
@@ -1125,7 +1125,7 @@ def _set_kspacing( | |||
incar["ISMEAR"] = user_incar_settings.get("ISMEAR", 2) | |||
else: | |||
incar["SIGMA"] = user_incar_settings.get("SIGMA", 0.05) | |||
incar["ISMEAR"] = user_incar_settings.get("ISMEAR", -5) | |||
incar["ISMEAR"] = user_incar_settings.get("ISMEAR", 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will let @esoteric-ephemera comment on the ISMEAR setting, but independent of that comment, if we do stick with ISMEAR = -5
, the SIGMA
should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think SIGMA should stay. If ISMEAR = -5 it will be ignored, but if the number of k-points generated is less than 4, then custodian will turn ISMEAR to 0, and at this point having a small sigma will be important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's subtle!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you have this backwards. ISMEAR = -5 is very important for narrow-gapped systems. If we know the system has a gap, then we should always use ISMEAR = -5.
That's true for energies but not for forces. Looking at about 370 structures from ICSD that aren't in MP, the deviations between the forces using ISMEAR = -5 and 0 persists for even narrow-gapped materials, see below.
I guess my question is if the _set_kspacing
function is supposed to be MP-specific or agnostic. If it's agnostic, then I'll just update ISMEAR / SIGMA for the MP flows and revert this back to -5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SCF convergence was the wrong phrase - I meant the reduction in needed k-point density. Both methods should help with that for semi-/metals.
I'll change this back. There's a larger ongoing discussion in MP about whether to abandon ISMEAR = -5 for relaxations in insulators (the current default) in favor of ISMEAR = 0. That will require running "fully-converged" calculations for this same set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a larger ongoing discussion in MP about whether to abandon ISMEAR = -5 for relaxations in insulators (the current default) in favor of ISMEAR = 0.
Ok, I would strongly advise against doing that! There are basically no downsides to using ISMEAR = -5 for insulators and several potential downsides to using ISMEAR = 0.
That will require running "fully-converged" calculations for this same set.
What do you mean by "fully-converged"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully converged as in using a very high density of k-points, very high cutoffs, and no smearing (Gaussian + very small smearing). See here
Wrt downsides: I can see issues where for very small gaps, you get erroneous partial occupancies near the fermi level. Practically, the gap has to be <~ 0.15 eV for the Gaussian smearing we use (SIGMA = 0.05 by default) for virtual states to be significantly partially occupied. Are there other downsides you're thinking of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing that paper. Looks interesting.
Are there other downsides you're thinking of?
To be honest, partial occupancies is the main one. The nice thing is that if you use ISMEAR = -5 for all gapped materials then at least your calculations are then consistent between relaxation, static, and DOS. But this is obviously a very minor point.
Can I ask why you're thinking of moving away from ISMEAR = -5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two major reasons: since we already have a big transition in going from atomate --> atomate2, we're auditing the parameters MP uses in its WFs (esp. GGA); and there are a few collaborations on dataset generation where this ISMEAR benchmark was requested
@esoteric-ephemera Could you submit e0186dc in a separate PR? |
…leanup of vasp.powerups
… in vasp.sets._get_incar
…_kspacing_and_auto_ismear since it uses kspacing by default
Closes #465.
Summary
A few key changes:
update_vasp_input_generators
tovasp.powerups
to remove repeated code. All subsequent functions, such asupdate_user_incar_settings
now rely on this base functionVaspInputGenerator._get_incar
: in_get_incar
,_set_kspacing
was called withprevious_incar is None
which is never true, becauseprevious_incar = previous_incar or {}
at the top of_get_incar
. More, this would imply that no previous incar was found, which meansfrom_prev
in_set_kspacing
was its inverse. Should beprevious_incar != {}
to indicate the presence of a previous calcvasp.sets.base._get_kspacing
should returnmin(kspacing, 0.44)
, to ensure that if kspacing <= 0.22, it would not be increased to 0.44vasp.sets.base._set_kspacing
should default to Gaussian smearing (ISMEAR = 0) rather than tetrahedron (ISMEAR = -5) for a gapped material. While the forces should be consistent between these smearing methods for an insulator, my benchmarking has shown they can differ for semi-metals / narrow gapped systems. Gaussian is probably a safer choice overalltest_set_u_params
totests.vasp.test_sets
to close issue #465test_set_kspacing
totests.vasp.test_sets