Skip to content

Commit 106bef0

Browse files
improve docs
1 parent 14656a0 commit 106bef0

File tree

3 files changed

+49
-6
lines changed

3 files changed

+49
-6
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ jobs:
199199
micromamba activate a2
200200
python -m pip install --upgrade pip
201201
uv pip install .[strict,tests]
202+
uv pip install tblite>=0.4.0
202203
203204
- name: Install pymatgen from master if triggered by pymatgen repo dispatch
204205
if: github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger'

docs/user/codes/vasp.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,25 @@ functional. Full structural relaxation is performed.
9797
### Double Relax
9898

9999
Perform two back-to-back relaxations. This can often help avoid errors arising from
100-
Pulay stress.
100+
[Pulay stress](https://www.vasp.at/wiki/index.php/Pulay_stress).
101+
102+
In short: While the cell size, shape, symmetry, etc. can change during a relaxation, the *k* point grid does not change with it.
103+
Additionally, the number of plane waves is held constant during a relaxation.
104+
Both features lead to artificial (numerical) stress due to under-convergence of a relaxation with respect to the basis set.
105+
To avoid this, we perform a single relaxation, and input its final structure to another relaxation calculation.
106+
At the start of the second relaxation, the *k*-point mesh and plane waves are adjusted to reflect the new symmetry of the cell.
107+
108+
### Materials Project structure optimization
109+
110+
The Materials Project hosts a large database of, among other physical properties, optimized structures and their associated total energy, formation enthalpy, and basic electronic structure properties.
111+
To generate this data, the Materials Project uses a simple double-relaxation followed by a final static calculation.
112+
While in principle, if the second relaxation calculation is converged, a final static calculation would not be needed.
113+
However, the second relaxation may have residual Pulay stress, and VASP averages some electronic structure data ([like the density of states](https://www.vasp.at/wiki/index.php/DOSCAR)) during a relaxation.
114+
Thus we need to perform a final single-point (static) calculation, usually using the corrected tetrahedron method (`ISMEAR=-5`) to ensure accurate electronic structure properties.
115+
116+
The workflows used to produce PBE GGA or GGA+*U* and r<sup>2</sup>SCAN thermodynamic data are, respectively, `MPGGADoubleRelaxStaticMaker` and `MPMetaGGADoubleRelaxStaticMaker` in `atomate2.vasp.flows.mp`.
117+
Moving forward, the Materials Project prefers r<sup>2</sup>SCAN calculations, but maintains its older set of GGA-level data which currently has wider coverage.
118+
For documentation about the calculation parameters used, see the [Materials Project documentation.](https://docs.materialsproject.org/methodology/materials-methodology/calculation-details)
101119

102120
### Band Structure
103121

@@ -616,6 +634,33 @@ written:
616634
static_job.maker.input_set_generator.user_incar_settings["LOPTICS"] = True
617635
```
618636

637+
To update *k*-points, use the `user_kpoints_settings` keyword argument of an input set generator.
638+
You can supply either a `pymatgen.io.vasp.inputs.Kpoints` object, or a `dict` containing certain [keys](https://github.com/materialsproject/pymatgen/blob/b54ac3e65e46b876de40402e8da59f551fb7d005/src/pymatgen/io/vasp/sets.py#L812).
639+
We generally recommend the former approach unless the user is familiar with the specific style of *k*-point updates used by `pymatgen`.
640+
For example, to use just the $\Gamma$ point:
641+
642+
```py
643+
from pymatgen.io.vasp.inputs import Kpoints
644+
from atomate2.vasp.sets.core import StaticSetGenerator
645+
from atomate2.vasp.jobs.core import StaticMaker
646+
647+
custom_gamma_only_set = StaticSetGenerator(user_kpoints_settings=Kpoints())
648+
gamma_only_static_maker = StaticMaker(input_set_generator=custom_gamma_only_set)
649+
```
650+
651+
For those who are more familiar with manual *k*-point generation, you can use a VASP-style KPOINTS file or string to set the *k*-points as well:
652+
653+
```py
654+
kpoints = Kpoints.from_str(
655+
"""Uniform density Monkhorst-Pack mesh
656+
0
657+
Monkhorst-pack
658+
5 5 5
659+
"""
660+
)
661+
custom_static_set = StaticSetGenerator(user_kpoints_settings=kpoints)
662+
```
663+
619664
Finally, sometimes you have a workflow containing many VASP jobs. In this case it can be
620665
tedious to update the input sets for each job individually. Atomate2 provides helper
621666
functions called "powerups" that can apply settings updates to all VASP jobs in a flow.
@@ -663,8 +708,7 @@ modification of several additional VASP settings, such as the k-points
663708

664709
If a greater degree of flexibility is needed, the user can define a default set of input
665710
arguments (`config_dict`) that can be provided to the {obj}`.VaspInputGenerator`.
666-
By default, the {obj}`.VaspInputGenerator` uses a base set of VASP input parameters
667-
from {obj}`.BaseVaspSet.yaml`, which each `Maker` is built upon. If desired, the user can
711+
By default, the {obj}`.VaspInputGenerator` uses a base set of VASP input parameters (`atomate2.vasp.sets.base._BASE_VASP_SET`), which each `Maker` is built upon. If desired, the user can
668712
define a custom `.yaml` file that contains a different base set of VASP settings to use.
669713
An example of how this can be done is shown below for a representative static
670714
calculation.

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ forcefields = [
6363
"torchdata<=0.7.1", # TODO: remove when issue fixed
6464
]
6565
ase = ["ase>=3.23.0"]
66-
# tblite py3.12 support tracked in https://github.com/tblite/tblite/issues/198
67-
ase-ext = ["tblite>=0.3.0; python_version < '3.12'"]
66+
ase-ext = ["tblite>=0.3.0; platform_system=='Linux'"]
6867
openmm = [
6968
"mdanalysis>=2.7.0",
7069
"openmm-mdanalysis-reporter>=0.1.0",
@@ -115,7 +114,6 @@ strict = [
115114
"pymongo==4.10.1",
116115
"python-ulid==3.0.0",
117116
"seekpath==2.1.0",
118-
"tblite==0.3.0; python_version < '3.12'",
119117
"typing-extensions==4.13.2",
120118
]
121119
strict-openff = [

0 commit comments

Comments
 (0)