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

Add lobster mp workflow #634

Merged
merged 14 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/user/codes/vasp.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ VASP_CMD: <<VASP_CMD>>
LOBSTER_CMD: <<LOBSTER_CMD>>
```

```{note}
Materials project compatible settings LOBSTER workflow is also available now,
JaGeo marked this conversation as resolved.
Show resolved Hide resolved
which could be used by simply importing from atomate2.vasp.flows.mp > MPVaspLobsterMaker
instead of VaspLobsterMaker. Rest of the things to execute the workflow stays same as
shown below.
```

The corresponding flow could, for example, be started with the following code:

```Python
Expand Down
73 changes: 73 additions & 0 deletions src/atomate2/vasp/flows/mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,25 @@

from jobflow import Flow, Maker

from atomate2.lobster.jobs import LobsterMaker
from atomate2.vasp.flows.core import DoubleRelaxMaker
from atomate2.vasp.flows.lobster import VaspLobsterMaker
from atomate2.vasp.jobs.mp import (
MPGGARelaxMaker,
MPGGAStaticMaker,
MPMetaGGARelaxMaker,
MPMetaGGAStaticMaker,
MPPreRelaxMaker,
)
from atomate2.vasp.sets.mp import MPGGAStaticSetGenerator

if TYPE_CHECKING:
from pathlib import Path

from pymatgen.core.structure import Structure

from atomate2.vasp.jobs.base import BaseVaspMaker

Check warning on line 33 in src/atomate2/vasp/flows/mp.py

View check run for this annotation

Codecov / codecov/patch

src/atomate2/vasp/flows/mp.py#L33

Added line #L33 was not covered by tests


@dataclass
class MPGGADoubleRelaxMaker(DoubleRelaxMaker):
Expand Down Expand Up @@ -185,3 +190,71 @@
jobs += [static_job]

return Flow(jobs=jobs, output=output, name=self.name)


# update potcars to 54, use correct W potcar
# use staticmaker for compatibility


class MPVaspLobsterMaker(VaspLobsterMaker):
"""
Maker to perform a Lobster computation.

The calculations performed are:

1. Optional optimization.
2. Static calculation with ISYM=0.
3. Several Lobster computations testing several basis sets are performed.

.. Note::

The basis sets can only be changed with yaml files.

Parameters
----------
name : str
Name of the flows produced by this maker.
relax_maker : .BaseVaspMaker or None
A maker to perform a relaxation on the bulk. Set to ``None`` to skip the
bulk relaxation.
lobster_static_maker : .BaseVaspMaker
A maker to perform the computation of the wavefunction before the static run.
Cannot be skipped. It can be LOBSTERUNIFORM or LobsterStaticMaker()
lobster_maker : .LobsterMaker
A maker to perform the Lobster run.
delete_wavecars : bool
If true, all WAVECARs will be deleted after the run.
address_min_basis : str
A path to a yaml file including basis set information.
address_max_basis : str
A path to a yaml file including basis set information.
"""

name: str = "lobster"
relax_maker: BaseVaspMaker | None = field(
default_factory=lambda: MPGGADoubleRelaxMaker()
)
lobster_static_maker: BaseVaspMaker = field(
default_factory=lambda: MPGGAStaticMaker(
input_set_generator=MPGGAStaticSetGenerator(
user_potcar_functional="PBE_54",
user_potcar_settings={"W": "W_sv"},
user_kpoints_settings={"reciprocal_density": 310},
user_incar_settings={
"EDIFF": 1e-6,
"NSW": 0,
"LWAVE": True,
"ISYM": 0,
"IBRION": -1,
"ISMEAR": -5,
"LORBIT": 11,
# "ICHARG": 0, # is this okay?
Copy link
Member Author

Choose a reason for hiding this comment

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

It would be good to test both runs with and without structure optimization. There could be differences.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure will test these 😃

"ALGO": "Normal",
},
)
)
)
lobster_maker: LobsterMaker | None = field(default_factory=lambda: LobsterMaker())
delete_wavecars: bool = True
address_min_basis: str | None = None
address_max_basis: str | None = None
Loading