Skip to content

Commit f487457

Browse files
Add pp_version to VASP parameters handling (#3068)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 88d75bd commit f487457

File tree

22 files changed

+53
-8
lines changed

22 files changed

+53
-8
lines changed

docs/install/codes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,11 @@ To use quacc with VASP, you will need to define several environment variables, a
140140
```bash
141141
export QUACC_VASP_PARALLEL_CMD="srun -N 2 --ntasks-per-node 24"
142142
export QUACC_VASP_PP_PATH="/path/to/POTCARs"
143+
export QUACC_VASP_PP_VERSION="64"
143144
```
144145

145146
The `VASP_PARALLEL_CMD` setting tells Custodian and/or ASE how to parallelize VASP. Note that it does not include the executable.
146147

147-
The `VASP_PP_PATH` setting should be defined as described in the [ASE documentation](https://wiki.fysik.dtu.dk/ase/ase/calculators/vasp.html#pseudopotentials) such that it is a directory containing your VASP pseudopotentials. There should be two subdirectories named `potpaw_PBE` and `potpaw` for the PBE and LDA pseudopotentials, respectively. If your pseudopotential directories have a different name, create a symbolic link with the required naming scheme. We recommend setting `QUACC_VASP_PP_PATH` in your `~/.bashrc` file since this rarely changes.
148+
The `VASP_PP_PATH` setting should be defined as described in the [ASE documentation](https://wiki.fysik.dtu.dk/ase/ase/calculators/vasp.html#pseudopotentials) such that it is a directory containing each VASP pseudopotential folder. Similarly, the `VASP_PP_VERSION` setting defines the version of the pseudopotentials to use.
148149

149150
Additional settings can be specified as well, such as the name of the VASP executables if they differ from the default values (i.e. `vasp_std`, `vasp_gam`).

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ classifiers = [
2626
]
2727
requires-python = ">=3.11"
2828
dependencies = [
29-
"ase>=3.26.0", # for Atoms object and calculators
29+
"ase>=3.27.0", # for Atoms object and calculators
3030
"custodian>=2025.12.14", # for automated error corrections
3131
"emmet-core>=0.86.1", # for pre-made schemas
3232
"frozendict>=2.4.6", # for caching of dictionaries in @lru_cache

src/quacc/calculators/vasp/params.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,20 @@ def _convert(self) -> dict:
574574
The ASE VASP parameters.
575575
"""
576576
self.incar_dict = {k.lower(): v for k, v in self.incar_dict.items()}
577-
pp = self.potcar_functional.split("_")[0]
578-
assert pp.lower() in ["lda", "pw91", "pbe"]
577+
parts = self.potcar_functional.split("_")
578+
pp = parts[0]
579+
pp_version = parts[1] if len(parts) > 1 else ""
580+
assert pp.lower() in ["lda", "pbe"]
579581
potcar_setups = {symbol.split("_")[0]: symbol for symbol in self.potcar_symbols}
580582
for k, v in potcar_setups.items():
581583
if k in v:
582584
potcar_setups[k] = v.split(k)[-1]
583585

584-
full_input_params = self.incar_dict | {"setups": potcar_setups, "pp": pp}
586+
full_input_params = self.incar_dict | {
587+
"setups": potcar_setups,
588+
"pp": pp,
589+
"pp_version": pp_version,
590+
}
585591

586592
if self.pmg_kpts:
587593
kpts_dict = self.pmg_kpts.as_dict()

src/quacc/calculators/vasp/presets/setups_default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Same as VASP-recommended except for Eu_3 and Yb_3
33
# Last modified: 07-28-2025
44
inputs:
5+
pp_version: "64"
56
setups:
67
Ac: Ac
78
Ag: Ag

src/quacc/calculators/vasp/presets/setups_qmof.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Li_sv-->Li, Yb_2-->Yb_3, Eu_2-->Eu_3
44
# Last modified: 08-01-2023
55
inputs:
6+
pp_version: "54"
67
setups:
78
Ac: Ac
89
Ag: Ag

src/quacc/calculators/vasp/presets/setups_vasp_recommended.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# VASP-recommended PAW PBE potentials
22
# Last modified: 08-01-2023
33
inputs:
4+
pp_version: "64"
45
setups:
56
Ac: Ac
67
Ag: Ag

src/quacc/recipes/vasp/fairchem.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def omat_static_job(
6868
from fairchem.data.omat.vasp.sets import OMat24StaticSet
6969

7070
calc_defaults = MPtoASEConverter(atoms=atoms).convert_input_set(OMat24StaticSet())
71+
calc_defaults["pp_version"] = "54"
7172

7273
return run_and_summarize(
7374
atoms,
@@ -111,6 +112,7 @@ def omc_static_job(
111112
"""
112113

113114
calc_defaults = _make_omc_inputs(atoms)
115+
calc_defaults["pp_version"] = "54"
114116

115117
return run_and_summarize(
116118
atoms,

src/quacc/settings.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,15 @@ class QuaccSettings(BaseSettings):
239239
)
240240
VASP_PP_PATH: Path | None = Field(
241241
os.environ.get("VASP_PP_PATH"),
242-
description="Path to the VASP pseudopotential library. Must contain the directories `potpaw_PBE` and `potpaw` for PBE and LDA pseudopotentials, respectively. If ASE's VASP_PP_PATH is set, you do not need to set this.",
242+
description="Path to the VASP pseudopotential folders.",
243+
)
244+
VASP_PP_VERSION: str | None = Field(
245+
os.environ.get("VASP_PP_VERSION"),
246+
description="Version of VASP pseudopotentials to use",
243247
)
244248
VASP_VDW: Path | None = Field(
245249
os.environ.get("ASE_VASP_VDW"),
246-
description="Path to the folder containing the vdw_kernel.bindat file for VASP vdW functionals. If ASE's ASE_VASP_VDW is set, you do not need to set this.",
250+
description="Path to the folder containing the vdw_kernel.bindat file for VASP vdW functionals.",
247251
)
248252

249253
# VASP Settings: General

tests/core/calculators/vasp/test_vasp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def test_gga_preset():
134134
"nelmin": 3,
135135
"nsw": 100,
136136
"pp": "PBE",
137+
"pp_version": "64",
137138
"prec": "accurate",
138139
"setups": {
139140
"Ac": "",
@@ -270,6 +271,7 @@ def test_metagga_preset():
270271
"nelmin": 3,
271272
"nsw": 100,
272273
"pp": "PBE",
274+
"pp_version": "64",
273275
"prec": "accurate",
274276
"setups": {
275277
"Ac": "",
@@ -411,6 +413,7 @@ def test_hybrid_preset():
411413
"nelmin": 3,
412414
"nsw": 100,
413415
"pp": "PBE",
416+
"pp_version": "64",
414417
"prec": "accurate",
415418
"setups": {
416419
"Ac": "",
@@ -1431,6 +1434,7 @@ def test_pmg_input_set():
14311434
"nelm": 100,
14321435
"nsw": 99,
14331436
"pp": "pbe",
1437+
"pp_version": "",
14341438
"prec": "accurate",
14351439
"sigma": 0.05,
14361440
"magmom": [0.6],
@@ -1467,6 +1471,7 @@ def test_pmg_input_set2():
14671471
"nelm": 100,
14681472
"nsw": 99,
14691473
"pp": "pbe",
1474+
"pp_version": "",
14701475
"prec": "accurate",
14711476
"sigma": 0.05,
14721477
"magmom": [2.3, 2.3],

tests/core/recipes/vasp_recipes/jenkins/test_jenkins_vasp_recipes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def test_static_job(tmp_path, monkeypatch):
3131
assert output["parameters"]["encut"] == 520
3232
assert output["parameters"]["efermi"] == "midgap"
3333
assert output["parameters"]["kpts"] == [3, 3, 3]
34+
assert output["parameters"]["pp"] == "PBE"
35+
assert output["parameters"]["pp_version"] == "64"
3436
assert output["results"]["energy"] < 0
3537

3638

0 commit comments

Comments
 (0)