Skip to content

Conversation

@junchichen21
Copy link

This pull request updates the MPScanRelaxSet class in src/pymatgen/io/vasp/sets.py to improve support for the r2SCAN+rVV10 functional. It adds a new reference for r2SCAN+rVV10 and ensures that the appropriate BPARAM value is set in the INCAR when using this functional.

Functional and documentation enhancements:

  • Added a new literature reference for r2SCAN+rVV10 to the class docstring to improve citation accuracy.
  • Updated the __post_init__ method to automatically set BPARAM = 11.95 in the INCAR when vdw is set to "rvv10" and METAGGA is "R2SCAN". If the user specifies user_incar_settings={"METAGGA": "SCAN"}, then BPARAM keeps the same value as defined in the vdW_parameters.yaml file.

-Add the code to update rVV10 parameters ("BPARAM"=11.95) for r2SCAN+rVV10 if vdw is set to "rvv10" and METAGGA is "R2SCAN"
@esoteric-ephemera
Copy link
Contributor

Hey @junchichen21 can you take a look at how this is already done in MP24RelaxSet and perhaps merge the incar updates into a common function for both the older MPScanRelaxSet and newer MP24RelaxSet?

@shyuep
Copy link
Member

shyuep commented Oct 7, 2025

Also, unittests are needed. Thanks.

@junchichen21
Copy link
Author

Hey @junchichen21 can you take a look at how this is already done in MP24RelaxSet and perhaps merge the incar updates into a common function for both the older MPScanRelaxSet and newer MP24RelaxSet?

Hi @esoteric-ephemera, I somehow missed your message last week. Sorry about that. No problem, I will update it soon.

@junchichen21
Copy link
Author

Hi @esoteric-ephemera and @shyuep, I have made some updates as shown below:

Refactoring and code unification:

  • Introduced a new _config_updates helper function to centralize the logic for updating INCAR settings for different XC functionals and dispersion corrections, and refactored both MPScanRelaxSet and MP24RelaxSet to use this function. This eliminates duplicated code and ensures consistent behavior. [1] [2] [3]

API and interface changes:

  • Changed the MPScanRelaxSet interface to use xc_functional and dispersion arguments instead of the previous vdw and user_incar_settings for specifying functionals and dispersion corrections, and updated the class documentation and references accordingly. [1] [2] [3]

Validation and error handling improvements:

  • Added stricter validation and error messages for unsupported XC/dispersion combinations, including raising errors when an invalid dispersion correction is specified for MPScanRelaxSet, and when unsupported XC functionals are given to MP24RelaxSet. [1] [2]

Test updates and additions:

  • Updated and expanded tests in test_sets.py to reflect the new interface and stricter validation, including new tests for allowed and disallowed XC/dispersion combinations and updated test names and assertions for clarity. [1] [2] [3]

Please let me know whether the above refactoring and interface changes align with the intended update policy.

@shyuep
Copy link
Member

shyuep commented Oct 16, 2025

Looks ok to me. @esoteric-ephemera To review.

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