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

Updated vasp input sets with MPSurfaceSet from atomate1 #4287

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

abhardwaj73
Copy link

Summary

Major changes:

  • feature 1: Addition of MPSurfaceSet mentioned here

Todos

  • feature 2: Addition of tests for this new vasp input set

Mentioned in this issue #4247 @rkingsbury

@shyuep
Copy link
Member

shyuep commented Feb 18, 2025

I would rather not have two surface sets with only slgihtly different parameters and confusing names. The changes to the inputs are small enough that you can go ahead and modify MVLSlabSet directly and atomate should use MVLSlabSet.

@rkingsbury
Copy link
Contributor

@abhardwaj73 it looks like the adsorption workflows in atomate2 use a modified MPRelaxSet (link). After this PR is done, let's compare the revised MVLSlabSet parameters with the modified set used there, and update the atomate2 import if appropriate.

Copy link
Contributor

@rkingsbury rkingsbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me @abhardwaj73 , thanks. See a few small comments.

Also, please update the tests here if needed so they pass with the new parameters.

Comment on lines 2530 to 2574
class MPSurfaceSet(MVLSlabSet):
"""
Input class for MP slab calcs, mostly to change parameters
and defaults slightly
"""

def __init__(self, structure, bulk=False, auto_dipole=None, **kwargs):
# If not a bulk calc, turn get_locpot/auto_dipole on by default
auto_dipole = auto_dipole or not bulk
super().__init__(structure, bulk=bulk, auto_dipole=False, **kwargs)
# This is a hack, but should be fixed when this is ported over to
# pymatgen to account for vasp native dipole fix
if auto_dipole:
self._config_dict["INCAR"].update({"LDIPOL": True, "IDIPOL": 3})
self.auto_dipole = True

@property
def incar(self):
incar = super().incar

# Determine LDAU based on slab chemistry without adsorbates
ldau_elts = {"O", "F"}
if self.structure.site_properties.get("surface_properties"):
non_adsorbate_elts = {
s.specie.symbol for s in self.structure if s.properties["surface_properties"] != "adsorbate"
}
else:
non_adsorbate_elts = {s.specie.symbol for s in self.structure}
ldau = bool(non_adsorbate_elts & ldau_elts)

# Should give better forces for optimization
incar_config = {
"EDIFFG": -0.05,
"ENAUG": 4000,
"IBRION": 1,
"POTIM": 1.0,
"LDAU": ldau,
"EDIFF": 1e-5,
"ISYM": 0,
}
incar.update(incar_config)
incar.update(self.user_incar_settings)
return incar


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @abhardwaj73 . Since we were asked only to update MVLSlabSet to match the MPSurfaceSet parameters, this class can now be removed.

Comment on lines +2438 to +2440

"""Determine LDAU based on slab chemistry without adsorbates"""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For historical provenance purposes, please add some comment lines either here or at the top of the MVLSlabSet class explaining that the parameters were updated in March 2025 to match the MPSurfaceSet in atomate1.

Copy link
Contributor

@rkingsbury rkingsbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @abhardwaj73 ! @shyuep I think this should be ready to merge, pending tests all passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants