"""Core jobs for running VASP calculations."""from__future__importannotationsimportloggingfromdataclassesimportdataclass,fieldfromtypingimportTYPE_CHECKINGfrompymatgen.io.vasp.setsimportMVLGWSetfromatomate2.vasp.jobs.baseimportBaseVaspMaker,vasp_jobifTYPE_CHECKING:frompathlibimportPathfromjobflowimportResponsefrompymatgen.core.structureimportStructurefromatomate2.vasp.sets.baseimportVaspInputGeneratorlogger=logging.getLogger(__name__)
[docs]@dataclassclassMVLStaticMaker(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"))
[docs]@vasp_jobdefmake(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. """returnsuper().make.original(self,structure,prev_dir)
[docs]@dataclassclassMVLNonSCFMaker(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"))
[docs]@vasp_jobdefmake(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",))returnsuper().make.original(self,structure,prev_dir)
[docs]@dataclassclassMVLGWMaker(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"))
[docs]@vasp_jobdefmake(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"))returnsuper().make.original(self,structure,prev_dir)