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

Feat: GW workflow with VASP #808

Merged
merged 43 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
830e2d6
Added the Materials Virtual Lab GW Set to the repo and implemented th…
yanghan234 Apr 17, 2024
66083fb
add a Materials Virtual Lab GW band structure maker
yanghan234 Apr 17, 2024
e5b0ae1
fix bug
yanghan234 Apr 17, 2024
ebf6354
rename MVLGWMaker
yanghan234 Apr 17, 2024
9324567
created a Flow that does all three stages (static, diag, gw) for a GW…
yanghan234 Apr 17, 2024
3c3e06a
fixed bug
yanghan234 Apr 19, 2024
f00bcc5
update the mvl gw yaml file and explicity copy the magmon in it
yanghan234 Apr 21, 2024
4bfd28a
update the gw workflow
yanghan234 Apr 21, 2024
d853aee
Revert line 37 to original state and fixed a typo
yanghan234 Apr 22, 2024
eb286c3
update the class doc of MVLGWSetGenerator
yanghan234 Jun 12, 2024
139b181
rewrite job name
yanghan234 Jun 12, 2024
2bb6037
rewrite job name
yanghan234 Jun 13, 2024
b91184f
Merge branch 'main' into hanyang/gw_with_vasp
yanghan234 Sep 7, 2024
0880262
make job and flow names short
yanghan234 Sep 8, 2024
bcca85f
update job name
yanghan234 Sep 8, 2024
db0b7a6
change the method names to adjust for recent updates on the main branch
yanghan234 Sep 15, 2024
f94f691
explicitly specify files to copy
yanghan234 Sep 15, 2024
7d33f83
copied all data files for gw test case
yanghan234 Sep 15, 2024
975fe78
add testcase for running MVL GW workflow
yanghan234 Sep 15, 2024
982ccd4
Merge branch 'materialsproject:main' into hanyang/gw_with_vasp
yanghan234 Sep 16, 2024
b5c50c8
modified the files needed to copy between jobs
yanghan234 Sep 16, 2024
fb9dba7
fixed wrong assertation
yanghan234 Sep 16, 2024
0a456f8
added missing data files to run the tests
yanghan234 Sep 16, 2024
7cce683
add a warning in the GW workflow
yanghan234 Sep 16, 2024
8f3bc83
removed MVL GW set yaml file, instead, import from pymatgen
yanghan234 Sep 17, 2024
181463e
reorganize the mvl jobs
yanghan234 Sep 17, 2024
31e9f1d
reorganize the mvl gw workflow
yanghan234 Sep 17, 2024
41e0f7f
update test case for mvl gw workflow and update the test data
yanghan234 Sep 17, 2024
dccbf1a
Merge branch 'main' into hanyang/gw_with_vasp
yanghan234 Sep 17, 2024
e9b1408
update the mvl gw workflow
yanghan234 Sep 17, 2024
b88eb4d
update test case for mvl gw workflow and corresponding test data
yanghan234 Sep 17, 2024
c7b1521
Merge branch 'main' into hanyang/gw_with_vasp
yanghan234 Oct 12, 2024
ce241b0
Merge branch 'main' into hanyang/gw_with_vasp
yanghan234 Oct 22, 2024
6910930
Bump emmet-core from 0.84.2 to 0.84.3rc3
yanghan234 Oct 23, 2024
c5c3d2c
updated test data for mvl g0w0
yanghan234 Oct 24, 2024
8d907b6
removed MVLGWSetGenerator class; use MVLGWSet directly instead
yanghan234 Oct 24, 2024
f3ff8c9
removed deprecate comments
yanghan234 Oct 24, 2024
110be50
remove CONTCAR.gz, use CONTCAR instead
yanghan234 Oct 24, 2024
e15f451
Merge branch 'main' into hanyang/gw_with_vasp
yanghan234 Oct 28, 2024
8ca8fc2
Merge branch 'main' into hanyang/gw_with_vasp
yanghan234 Oct 31, 2024
f0a26df
Merge branch 'main' into hanyang/gw_with_vasp
yanghan234 Nov 1, 2024
71fcd3f
Merge branch 'main' into hanyang/gw_with_vasp
yanghan234 Nov 1, 2024
361f4ab
Merge branch 'main' into hanyang/gw_with_vasp
yanghan234 Nov 12, 2024
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
59 changes: 59 additions & 0 deletions src/atomate2/vasp/flows/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from atomate2.vasp.jobs.core import (
HSEBSMaker,
HSEStaticMaker,
MVLGWMaker,
MVLNonSCFMaker,
MVLStaticMaker,
NonSCFMaker,
RelaxMaker,
StaticMaker,
Expand Down Expand Up @@ -171,6 +174,62 @@ def make(self, structure: Structure, prev_dir: str | Path | None = None) -> Flow
return Flow(jobs, outputs, name=self.name)


@dataclass
class MVLGWBandStructureMaker(Maker):
yanghan234 marked this conversation as resolved.
Show resolved Hide resolved
"""
Maker to generate VASP band structures with Materials Virtual Lab GW setup.

.. warning::
This workflow is only compatible with the Materials Virtual Lab GW setup,
and it may require additional benchmarks. Please use with caution.

Parameters
----------
name : str
Name of the flows produced by this maker.
gw_maker : .BaseVaspMaker
The maker to use for the GW calculation.
"""

name: str = "MVL G0W0 band structure"
static_maker: BaseVaspMaker = field(default_factory=MVLStaticMaker)
nscf_maker: BaseVaspMaker = field(default_factory=MVLNonSCFMaker)
gw_maker: BaseVaspMaker = field(default_factory=MVLGWMaker)

def make(self, structure: Structure, prev_dir: str | Path | None = None) -> Flow:
"""
Create a band structure flow.

Parameters
----------
structure : Structure
A pymatgen structure object.
prev_dir : str or Path or None
A previous VASP calculation directory to copy output files from.

Returns
-------
Flow
A band structure flow.
"""
static_job = self.static_maker.make(structure, prev_dir=prev_dir)
nscf_job = self.nscf_maker.make(
static_job.output.structure, prev_dir=static_job.output.dir_name
)
gw_job = self.gw_maker.make(
nscf_job.output.structure, prev_dir=nscf_job.output.dir_name
)
jobs = [static_job, nscf_job, gw_job]

outputs = {
"static": static_job.output,
"nscf": nscf_job.output,
"gw": gw_job.output,
}

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


@dataclass
class UniformBandStructureMaker(Maker):
"""
Expand Down
166 changes: 166 additions & 0 deletions src/atomate2/vasp/jobs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
HSERelaxSetGenerator,
HSEStaticSetGenerator,
HSETightRelaxSetGenerator,
MVLGWSetGenerator,
NonSCFSetGenerator,
RelaxConstVolSetGenerator,
RelaxSetGenerator,
Expand Down Expand Up @@ -490,6 +491,171 @@ def make(
return super().make.original(self, structure, prev_dir)


@dataclass
class MVLStaticMaker(BaseVaspMaker):
yanghan234 marked this conversation as resolved.
Show resolved Hide resolved
"""
Maker to create a static calculation compatible with Materials Virtual Lab GW jobs.

Parameters
----------
name : str
The job name.
input_set_generator : .VaspInputGenerator
A generator used to make the input set.
write_input_set_kwargs : dict
Keyword arguments that will get passed to :obj:`.write_vasp_input_set`.
copy_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.copy_vasp_outputs`.
run_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.run_vasp`.
task_document_kwargs : dict
Keyword arguments that will get passed to :obj:`.TaskDoc.from_directory`.
stop_children_kwargs : dict
Keyword arguments that will get passed to :obj:`.should_stop_children`.
write_additional_data : dict
Additional data to write to the current directory. Given as a dict of
{filename: data}. Note that if using FireWorks, dictionary keys cannot contain
the "." character which is typically used to denote file extensions. To avoid
this, use the ":" character, which will automatically be converted to ".". E.g.
``{"my_file:txt": "contents of the file"}``.
"""

name: str = "MVL static"
input_set_generator: VaspInputGenerator = field(default_factory=MVLGWSetGenerator)

@vasp_job
def make(
self,
structure: Structure,
prev_dir: str | Path | None = None,
) -> Response:
"""
Run a static calculation compatible with later Materials Virtual Lab GW jobs.

Parameters
----------
structure : .Structure
A pymatgen structure object.
prev_dir : str or Path or None
A previous VASP calculation directory to copy output files from.
"""
self.input_set_generator.mode = "STATIC"

return super().make.original(self, structure, prev_dir)


@dataclass
class MVLNonSCFMaker(BaseVaspMaker):
"""
Maker to create a non-scf calculation compatible with Materials Virtual Lab GW jobs.

Parameters
----------
name : str
The job name.
input_set_generator : .VaspInputGenerator
A generator used to make the input set.
write_input_set_kwargs : dict
Keyword arguments that will get passed to :obj:`.write_vasp_input_set`.
copy_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.copy_vasp_outputs`.
run_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.run_vasp`.
task_document_kwargs : dict
Keyword arguments that will get passed to :obj:`.TaskDoc.from_directory`.
stop_children_kwargs : dict
Keyword arguments that will get passed to :obj:`.should_stop_children`.
write_additional_data : dict
Additional data to write to the current directory. Given as a dict of
{filename: data}. Note that if using FireWorks, dictionary keys cannot contain
the "." character which is typically used to denote file extensions. To avoid
this, use the ":" character, which will automatically be converted to ".". E.g.
``{"my_file:txt": "contents of the file"}``.
"""

name: str = "MVL nscf"
input_set_generator: VaspInputGenerator = field(default_factory=MVLGWSetGenerator)

@vasp_job
def make(
self,
structure: Structure,
prev_dir: str | Path | None = None,
) -> Response:
"""
Run a static calculation compatible with later Materials Virtual Lab GW jobs.

Parameters
----------
structure : .Structure
A pymatgen structure object.
prev_dir : str or Path or None
A previous VASP calculation directory to copy output files from.
"""
self.input_set_generator.mode = "DIAG"
self.copy_vasp_kwargs.setdefault("additional_vasp_files", ("CHGCAR",))

return super().make.original(self, structure, prev_dir)


@dataclass
class MVLGWMaker(BaseVaspMaker):
"""
Maker to create Materials Virtual Lab GW jobs.

This class can make the jobs for the typical three stapes of the GW calculation.

Parameters
----------
name : str
The job name.
input_set_generator : .VaspInputGenerator
A generator used to make the input set.
write_input_set_kwargs : dict
Keyword arguments that will get passed to :obj:`.write_vasp_input_set`.
copy_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.copy_vasp_outputs`.
run_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.run_vasp`.
task_document_kwargs : dict
Keyword arguments that will get passed to :obj:`.TaskDoc.from_directory`.
stop_children_kwargs : dict
Keyword arguments that will get passed to :obj:`.should_stop_children`.
write_additional_data : dict
Additional data to write to the current directory. Given as a dict of
{filename: data}. Note that if using FireWorks, dictionary keys cannot contain
the "." character which is typically used to denote file extensions. To avoid
this, use the ":" character, which will automatically be converted to ".". E.g.
``{"my_file:txt": "contents of the file"}``.
"""

name: str = "MVL G0W0"
input_set_generator: VaspInputGenerator = field(default_factory=MVLGWSetGenerator)

@vasp_job
def make(
self,
structure: Structure,
prev_dir: str | Path | None = None,
) -> Response:
"""
Run a Materials Virtual Lab GW band structure VASP job.

Parameters
----------
structure : .Structure
A pymatgen structure object.
prev_dir : str or Path or None
A previous VASP calculation directory to copy output files from.
"""
self.input_set_generator.mode = "GW"
self.copy_vasp_kwargs.setdefault(
"additional_vasp_files", ("WAVECAR", "WAVEDER")
)

return super().make.original(self, structure, prev_dir)


@dataclass
class DielectricMaker(BaseVaspMaker):
"""
Expand Down
143 changes: 143 additions & 0 deletions src/atomate2/vasp/sets/BaseMVLGWSet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Default VASP settings for GW calculations used by the Materials Virtual Lab.
INCAR:
ALGO: Normal
EDIFF: 1.0e-8
IBRION: -1
ICHARG: 1
ISMEAR: 0
ISPIN: 2
LORBIT: 11
LREAL: AUTO
LWAVE: true
NELM: 100
PREC: Accurate
SIGMA: 0.01
MAGMOM:
Ce: 5
Ce3+: 1
Co: 0.6
Co3+: 0.6
Co4+: 1
Cr: 5
Dy3+: 5
Er3+: 3
Eu: 10
Eu2+: 7
Eu3+: 6
Fe: 5
Gd3+: 7
Ho3+: 4
La3+: 0.6
Lu3+: 0.6
Mn: 5
Mn3+: 4
Mn4+: 3
Mo: 5
Nd3+: 3
Ni: 5
Pm3+: 4
Pr3+: 2
Sm3+: 5
Tb3+: 6
Tm3+: 2
V: 5
W: 5
Yb3+: 1
KPOINTS:
reciprocal_density: 100
POTCAR_FUNCTIONAL: PBE_54
POTCAR:
Ac: Ac
Ag: Ag_sv_GW
Al: Al_GW
Ar: Ar_GW
As: As_GW
At: At_d_GW
Au: Au_sv_GW
B: B_GW
Ba: Ba_sv_GW
Be: Be_sv_GW
Bi: Bi_d_GW
Br: Br_GW
C: C_GW
Ca: Ca_sv_GW
Cd: Cd_sv_GW
Ce: Ce_GW
Cl: Cl_GW
Co: Co_sv_GW
Cr: Cr_sv_GW
Cs: Cs_sv_GW
Cu: Cu_sv_GW
Dy: Dy_3
Er: Er_3
Eu: Eu
F: F_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