-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added the Materials Virtual Lab GW Set to the repo and implemented the MVLGWSetGenerator * add a Materials Virtual Lab GW band structure maker * fix bug * rename MVLGWMaker * created a Flow that does all three stages (static, diag, gw) for a GW band structure calculation * fixed bug * update the mvl gw yaml file and explicity copy the magmon in it * update the gw workflow * Revert line 37 to original state and fixed a typo * update the class doc of MVLGWSetGenerator * rewrite job name * rewrite job name * make job and flow names short * update job name * change the method names to adjust for recent updates on the main branch * explicitly specify files to copy * copied all data files for gw test case * add testcase for running MVL GW workflow * modified the files needed to copy between jobs * fixed wrong assertation * added missing data files to run the tests * add a warning in the GW workflow * removed MVL GW set yaml file, instead, import from pymatgen * reorganize the mvl jobs * reorganize the mvl gw workflow * update test case for mvl gw workflow and update the test data * update the mvl gw workflow * update test case for mvl gw workflow and corresponding test data * Bump emmet-core from 0.84.2 to 0.84.3rc3 * updated test data for mvl g0w0 * removed MVLGWSetGenerator class; use MVLGWSet directly instead * removed deprecate comments * remove CONTCAR.gz, use CONTCAR instead
- Loading branch information
1 parent
237dcdc
commit c57f9c1
Showing
53 changed files
with
400 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
"""Materials Virtual Lab (MVL) VASP flows.""" | ||
|
||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass, field | ||
from typing import TYPE_CHECKING | ||
|
||
from jobflow import Flow, Maker | ||
|
||
from atomate2.vasp.jobs.mvl import MVLGWMaker, MVLNonSCFMaker, MVLStaticMaker | ||
|
||
if TYPE_CHECKING: | ||
from pathlib import Path | ||
|
||
from pymatgen.core.structure import Structure | ||
|
||
from atomate2.vasp.jobs.base import BaseVaspMaker | ||
|
||
|
||
@dataclass | ||
class MVLGWBandStructureMaker(Maker): | ||
""" | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
"""Core jobs for running VASP calculations.""" | ||
|
||
from __future__ import annotations | ||
|
||
import logging | ||
from dataclasses import dataclass, field | ||
from typing import TYPE_CHECKING | ||
|
||
from pymatgen.io.vasp.sets import MVLGWSet | ||
|
||
from atomate2.vasp.jobs.base import BaseVaspMaker, vasp_job | ||
|
||
if TYPE_CHECKING: | ||
from pathlib import Path | ||
|
||
from jobflow import Response | ||
from pymatgen.core.structure import Structure | ||
|
||
from atomate2.vasp.sets.base import VaspInputGenerator | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
@dataclass | ||
class MVLStaticMaker(BaseVaspMaker): | ||
""" | ||
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=lambda: MVLGWSet(mode="STATIC") | ||
) | ||
|
||
@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. | ||
""" | ||
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=lambda: MVLGWSet(mode="DIAG") | ||
) | ||
|
||
@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.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=lambda: MVLGWSet(mode="GW") | ||
) | ||
|
||
@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.copy_vasp_kwargs.setdefault( | ||
"additional_vasp_files", ("CHGCAR", "WAVECAR", "WAVEDER") | ||
) | ||
|
||
return super().make.original(self, structure, prev_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ALGO = Gw0 | ||
ENCUTGW = 250 | ||
ICHARG = 1 | ||
ISMEAR = 0 | ||
ISPIN = 1 | ||
LORBIT = 11 | ||
LREAL = Auto | ||
LWAVE = True | ||
NBANDS = 48 | ||
NELM = 1 | ||
NOMEGA = 80 | ||
PREC = Accurate | ||
SIGMA = 0.01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pymatgen with grid density = 61 / number of atoms | ||
0 | ||
Gamma | ||
3 3 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Si2 | ||
1.0 | ||
0.0000000000000000 2.7300000000000000 2.7300000000000000 | ||
2.7300000000000000 0.0000000000000000 2.7300000000000000 | ||
2.7300000000000000 2.7300000000000000 0.0000000000000000 | ||
Si | ||
2 | ||
direct | ||
0.0000000000000000 0.0000000000000000 0.0000000000000000 Si | ||
0.2500000000000000 0.2500000000000000 0.2500000000000000 Si |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Si_GW |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Si_GW |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ALGO = Exact | ||
EDIFF = 1e-08 | ||
ICHARG = 1 | ||
ISMEAR = 0 | ||
ISPIN = 1 | ||
LOPTICS = True | ||
LORBIT = 11 | ||
LPEAD = True | ||
LREAL = Auto | ||
LWAVE = True | ||
NBANDS = 48 | ||
NELM = 1 | ||
PREC = Accurate | ||
SIGMA = 0.01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pymatgen with grid density = 61 / number of atoms | ||
0 | ||
Gamma | ||
3 3 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Si2 | ||
1.0 | ||
0.0000000000000000 2.7300000000000000 2.7300000000000000 | ||
2.7300000000000000 0.0000000000000000 2.7300000000000000 | ||
2.7300000000000000 2.7300000000000000 0.0000000000000000 | ||
Si | ||
2 | ||
direct | ||
0.0000000000000000 0.0000000000000000 0.0000000000000000 Si | ||
0.2500000000000000 0.2500000000000000 0.2500000000000000 Si |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Si_GW |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Si_GW |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ALGO = Normal | ||
EDIFF = 1e-08 | ||
ICHARG = 1 | ||
ISMEAR = 0 | ||
ISPIN = 1 | ||
LORBIT = 11 | ||
LREAL = Auto | ||
LWAVE = True | ||
NELM = 100 | ||
PREC = Accurate | ||
SIGMA = 0.01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pymatgen with grid density = 61 / number of atoms | ||
0 | ||
Gamma | ||
3 3 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Si2 | ||
1.0 | ||
0.0000000000000000 2.7300000000000000 2.7300000000000000 | ||
2.7300000000000000 0.0000000000000000 2.7300000000000000 | ||
2.7300000000000000 2.7300000000000000 0.0000000000000000 | ||
Si | ||
2 | ||
direct | ||
0.0000000000000000 0.0000000000000000 0.0000000000000000 Si | ||
0.2500000000000000 0.2500000000000000 0.2500000000000000 Si |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Si_GW |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Si_GW |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.