Source code for scm.input_classes.engines.vasp

from __future__ import annotations
from pathlib import Path
from typing import Iterable, Literal, Sequence
from scm.pisa.block import DriverBlock,EngineBlock,FixedBlock,FreeBlock,InputBlock,VerbatimBlock
from scm.pisa.key import BoolKey,FloatKey,FloatListKey,IntKey,IntListKey,MultipleChoiceKey,PathStringKey,StringKey,BoolType

[docs]class VASP(EngineBlock): r""" :ivar CHGCARFile: Use a custom CHGCAR file for initializing the charge density. Note: You must also set ICHARG to an appropriate value for this CHGCAR file to be read by VASP. :vartype CHGCARFile: str | Path | StringKey :ivar EnergyChoice: The energy from the VASP output which is used with the AMS driver. :vartype EnergyChoice: Literal["FreeEnergy", "EnergyWithoutEntropy", "EnergySigmaToZero"] :ivar EnergyCutoff: The energy cutoff for the plane wave basis set. VASP keyword: ENCUT :vartype EnergyCutoff: float | FloatKey :ivar INCARFile: Use a custom INCAR file. The keywords NSW, IBRION, ISIF, and LWAV must not be set in this INCAR file, since they are controlled by the AMS driver. :vartype INCARFile: str | Path | StringKey :ivar KPOINTSFile: Use a custom KPOINTS file. This will override any other settings related to the k-point sampling. :vartype KPOINTSFile: str | Path | StringKey :ivar KPOINTSOrigin: Type of regular k-point grid. Gamma-centered k-point grids always include the Gamma point, whereas Monkhorst-Pack grids do not include the Gamma point if any of the k-point grid dimensions is even. To use a custom set of k-points, or to specify paths in the Brillouin zone, prepare such a KPOINTS file manually and set the KPOINTSFile setting. :vartype KPOINTSOrigin: Literal["Gamma-centered", "Monkhorst-Pack"] :ivar LDAU: Enables a DFT+U calculation. The options LMAXMIX, LDAUType, LDAUU, LDAUJ, and LDAUL must also be set. :vartype LDAU: BoolType | BoolKey :ivar LDAUJ: :vartype LDAUJ: Iterable[float] | FloatListKey :ivar LDAUL: :vartype LDAUL: str | StringKey :ivar LDAUType: 1: The rotationally invariant DFT+U introduced by Liechtenstein et al. 2: The simplified (rotationally invariant) approach to DFT+U, introduced by Dudarev et al. 4: Same as type 1, but without exchange splitting. VASP keyword: LDAUTYPE. :vartype LDAUType: Literal["1", "2", "3", "4"] :ivar LDAUU: :vartype LDAUU: Iterable[float] | FloatListKey :ivar LMAXMIX: VASP keyword: LMAXMIX :vartype LMAXMIX: int | IntKey :ivar Occupation: Type of electronic smearing (fractional occupation scheme). VASP keyword: ISMEAR :vartype Occupation: Literal["Gaussian", "Fermi", "ReadFromWAVECAR", "ReadFromINCAR", "1stOrderMethfesselPaxton", "2ndOrderMethfesselPaxton", "TetrahedronMethodWithoutSmearing", "TetrahedronMethodWithBlochlCorrections", "TetrahedronMethodWithSmearing", "TetrahedronMethodWithBlochlCorrectionsAndSmearing"] :ivar POTCARLibrary: Path to the POTCAR (pseudopotential) library, as delivered with VASP. This library must be accessible on the machine currently running AMSinput. For example, setting this to /library/PBE/PAW/ will use /library/PBE/PAW/Cu/POTCAR as the POTCAR file for Cu atoms by default. Can also be left empty if VASP_PP_PATH is set as an environment variable. Special POTCARs (e.g. H.5 instead of H) can be used for individual atoms by using the vasp.label atom label. Alternatively, custom POTCAR files can be specified using the POTCAROverride tag. :vartype POTCARLibrary: str | Path | StringKey :ivar Precision: Adjusts the default cutoff energy and FFT grid spacing, and the accuracy of the projectors in real space. SingleN is only available for VASP 6.x. VASP keyword: PREC :vartype Precision: Literal["Single", "SingleN", "Normal", "Accurate"] :ivar Smearing: VASP keyword: SIGMA :vartype Smearing: float | FloatKey :ivar SpinPolarization: Determines if a spin-polarized calculation is performed. If set, the VASP keyword ISPIN is set to 2. :vartype SpinPolarization: BoolType | BoolKey :ivar VASPExec: Command used to execute VASP. For example: mpirun -np 4 vasp Can also be left empty if VASP_COMMAND is set as an environment variable. :vartype VASPExec: str | StringKey :ivar Verbosity: If set, more detailed information is printed in the EngineVASP.log file. :vartype Verbosity: BoolType | BoolKey :ivar WAVECARFile: Path to a WAVECAR (wavefunction) file from a previous calculation that is used to initialize the present calculation. If specified, the file will be copied into the new calculation directory and the VASP keyword ISTART will be set to 1. :vartype WAVECARFile: str | Path | StringKey :ivar XC: The exchange-correlation functional. This setting *must* be consistent with POTCAR. If your desired functional is not present in the list, choose Auto and set the GGA tag manually under Additional INCAR options. Auto: The XC functional is determined by the information in POTCAR. For more information on what these options do, see the VASP manual. Note that some options are only available depending on your version of VASP or how it was compiled. :vartype XC: Literal["Auto", "LDA", "BLYP", "PW91", "PBE", "PS", "RE", "RP", "AM", "91", "B3", "B5", "BF", "BO", "CA", "MK", "OR", "PE", "PZ", "VW", "WI", "TPSS", "RTPSS", "M06L", "MS0", "MS1", "MS2", "SCAN", "RSCAN", "R2SCAN", "SCAN-REVV10", "MBJ", "VDW-DF", "VDW-DF-CX", "VDW-DF-CX0P", "OPTPBE-VDW", "OPTB88-VDW", "OPTB86B-VDW", "VDW-DF2", "REV-VDW-DF2", "BEEF-VDW", "HF", "B3LYP", "B3PW91", "PBE0", "HSE03", "HSE06", "HSESOL", "SOGGA", "SOGGA11", "SOGGA11-X", "N12", "N12-SX", "MN12L", "GA", "MN15L", "HLE17", "REVM06L", "M06SX", "03", "05", "10", "20", "PL", "CO", "HL", "RA"] :ivar nk1: Number of k-points in the first dimension :vartype nk1: int | IntKey :ivar nk2: Number of k-points in the second dimension :vartype nk2: int | IntKey :ivar nk3: Number of k-points in the third dimension :vartype nk3: int | IntKey :ivar sk1: Fractional shift of the k-mesh in the first dimension :vartype sk1: float | FloatKey :ivar sk2: Fractional shift of the k-mesh in the second dimension :vartype sk2: float | FloatKey :ivar sk3: Fractional shift of the k-mesh in the third dimension :vartype sk3: float | FloatKey :ivar vdW: The van der Waals correction method. VASP keyword: IVDW Default: IVDW = 0 (Disable) :vartype vdW: Literal["Disable", "DFT-D2", "DFT-D3", "DFT-D3(BJ)", "DFT-D4", "DFT-ulg", "dDsC", "TS", "TSWithIterativeHirshfeldPartitioning", "ManyBodyDispersionEnergyMethod", "ManyBodyDispersionEnergyWithFractionallyIonicModelForPolarizability", "libMD"] :ivar Misc: The contents of this block are copied verbatim into the VASP INCAR file. Tags set in this block will override other input options. Note: do not set POTIM, IBRION, INTERACTIVE or EDIFFG in this block, as those keys are set by the AMS driver and cannot be changed. By default, the AMS driver also sets the following default values for the following tags: NSW=999999999 (enforce VASP to run indefinetly until killed) IWAVPR=11 (Wave function extrapolation when the volume of the cell changes) ISYM=0 (symmetry is disabled to avoid spurious error due to wavefunction mismatch between ionic steps) ISIF=3 (capture stress-induced changes (only for VASP version >=6.4)) :vartype Misc: str | Sequence[str] | FreeBlock :ivar POTCAROverride: Selects the pseudopotentials to use for each atomic species. Choosing this overrides the default option for each element found in POTCARLibrary. :vartype POTCAROverride: VASP._POTCAROverride """
[docs] class _Misc(FreeBlock): r""" The contents of this block are copied verbatim into the VASP INCAR file. Tags set in this block will override other input options. Note: do not set POTIM, IBRION, INTERACTIVE or EDIFFG in this block, as those keys are set by the AMS driver and cannot be changed. By default, the AMS driver also sets the following default values for the following tags: NSW=999999999 (enforce VASP to run indefinetly until killed) IWAVPR=11 (Wave function extrapolation when the volume of the cell changes) ISYM=0 (symmetry is disabled to avoid spurious error due to wavefunction mismatch between ionic steps) ISIF=3 (capture stress-induced changes (only for VASP version >=6.4)) """ def __post_init__(self): pass
[docs] class _POTCAROverride(FixedBlock): r""" Selects the pseudopotentials to use for each atomic species. Choosing this overrides the default option for each element found in POTCARLibrary. :ivar POTCARFiles: Selects the pseudopotentials to use for each atomic species. :vartype POTCARFiles: VASP._POTCAROverride._POTCARFiles """
[docs] class _POTCARFiles(FixedBlock): r""" Selects the pseudopotentials to use for each atomic species. :ivar Label: Label for an atom corresponding to the vasp.label, or to the element symbol if vasp.label is not set. :vartype Label: str | StringKey :ivar Path: Path to a POTCAR or POTCAR.Z file to use as a pseudopotential. :vartype Path: str | Path | StringKey """ def __post_init__(self): self.Label: str | StringKey = StringKey(name='Label', comment='Label for an atom corresponding to the vasp.label, or to the element symbol if vasp.label is not set.') self.Path: str | Path | StringKey = PathStringKey(name='Path', comment='Path to a POTCAR or POTCAR.Z file to use as a pseudopotential.', ispath=True)
def __post_init__(self): self.POTCARFiles: VASP._POTCAROverride._POTCARFiles = self._POTCARFiles(name='POTCARFiles', comment='Selects the pseudopotentials to use for each atomic species.', unique=False)
def __post_init__(self): self.CHGCARFile: str | Path | StringKey = PathStringKey(name='CHGCARFile', comment='Use a custom CHGCAR file for initializing the charge density. Note: You must also set ICHARG to an appropriate value for this CHGCAR file to be read by VASP.\n', gui_name='CHGCAR file:', ispath=True) self.EnergyChoice: Literal["FreeEnergy", "EnergyWithoutEntropy", "EnergySigmaToZero"] = MultipleChoiceKey(name='EnergyChoice', comment='The energy from the VASP output which is used with the AMS driver.', gui_name='Energy from OUTCAR:', default='FreeEnergy', choices=['FreeEnergy', 'EnergyWithoutEntropy', 'EnergySigmaToZero']) self.EnergyCutoff: float | FloatKey = FloatKey(name='EnergyCutoff', comment='The energy cutoff for the plane wave basis set.\n\nVASP keyword: ENCUT', gui_name='Plane wave energy cutoff:', default=400.0, unit='eV') self.INCARFile: str | Path | StringKey = PathStringKey(name='INCARFile', comment='Use a custom INCAR file.\nThe keywords NSW, IBRION, ISIF, and LWAV must not be set in this INCAR file, since they are controlled by the AMS driver.', gui_name='INCAR file:', ispath=True) self.KPOINTSFile: str | Path | StringKey = PathStringKey(name='KPOINTSFile', comment='Use a custom KPOINTS file. This will override any other settings related to the k-point sampling.', gui_name='KPOINTS file:', ispath=True) self.KPOINTSOrigin: Literal["Gamma-centered", "Monkhorst-Pack"] = MultipleChoiceKey(name='KPOINTSOrigin', comment='Type of regular k-point grid. Gamma-centered k-point grids always include the Gamma point, whereas Monkhorst-Pack grids do not include the Gamma point if any of the k-point grid dimensions is even.\n\nTo use a custom set of k-points, or to specify paths in the Brillouin zone, prepare such a KPOINTS file manually and set the KPOINTSFile setting.', gui_name='Type of k-point grid:', default='Monkhorst-Pack', choices=['Gamma-centered', 'Monkhorst-Pack']) self.LDAU: BoolType | BoolKey = BoolKey(name='LDAU', comment='Enables a DFT+U calculation. The options LMAXMIX, LDAUType, LDAUU, LDAUJ, and LDAUL must also be set.', gui_name='Use DFT+U:', default=False) self.LDAUJ: Iterable[float] | FloatListKey = FloatListKey(name='LDAUJ') self.LDAUL: str | StringKey = StringKey(name='LDAUL') self.LDAUType: Literal["1", "2", "3", "4"] = MultipleChoiceKey(name='LDAUType', comment='1: The rotationally invariant DFT+U introduced by Liechtenstein et al.\n2: The simplified (rotationally invariant) approach to DFT+U, introduced by Dudarev et al.\n4: Same as type 1, but without exchange splitting.\n\nVASP keyword: LDAUTYPE.', gui_name='Hubbard U-Type:', default='2', choices=['1', '2', '3', '4']) self.LDAUU: Iterable[float] | FloatListKey = FloatListKey(name='LDAUU') self.LMAXMIX: int | IntKey = IntKey(name='LMAXMIX', comment='VASP keyword: LMAXMIX', gui_name='LMAXMIX:', default=2) self.Occupation: Literal["Gaussian", "Fermi", "ReadFromWAVECAR", "ReadFromINCAR", "1stOrderMethfesselPaxton", "2ndOrderMethfesselPaxton", "TetrahedronMethodWithoutSmearing", "TetrahedronMethodWithBlochlCorrections", "TetrahedronMethodWithSmearing", "TetrahedronMethodWithBlochlCorrectionsAndSmearing"] = MultipleChoiceKey(name='Occupation', comment='Type of electronic smearing (fractional occupation scheme).\n\nVASP keyword: ISMEAR', gui_name='Type of smearing:', default='Gaussian', choices=['Gaussian', 'Fermi', 'ReadFromWAVECAR', 'ReadFromINCAR', '1stOrderMethfesselPaxton', '2ndOrderMethfesselPaxton', 'TetrahedronMethodWithoutSmearing', 'TetrahedronMethodWithBlochlCorrections', 'TetrahedronMethodWithSmearing', 'TetrahedronMethodWithBlochlCorrectionsAndSmearing']) self.POTCARLibrary: str | Path | StringKey = PathStringKey(name='POTCARLibrary', comment='Path to the POTCAR (pseudopotential) library, as delivered with VASP. This library must be accessible on the machine currently running AMSinput.\n\nFor example, setting this to /library/PBE/PAW/ will use /library/PBE/PAW/Cu/POTCAR as the POTCAR file for Cu atoms by default.\n\nCan also be left empty if VASP_PP_PATH is set as an environment variable.\n\nSpecial POTCARs (e.g. H.5 instead of H) can be used for individual atoms by using the vasp.label atom label. Alternatively, custom POTCAR files can be specified using the POTCAROverride tag.', gui_name='Path to POTCAR library:', ispath=True, gui_type='directory {POTCAR Library}') self.Precision: Literal["Single", "SingleN", "Normal", "Accurate"] = MultipleChoiceKey(name='Precision', comment='Adjusts the default cutoff energy and FFT grid spacing, and the accuracy of the projectors in real space. SingleN is only available for VASP 6.x.\n\nVASP keyword: PREC', gui_name='Precision:', default='Normal', choices=['Single', 'SingleN', 'Normal', 'Accurate']) self.Smearing: float | FloatKey = FloatKey(name='Smearing', comment='VASP keyword: SIGMA', gui_name='Smearing width:', default=0.2, unit='eV') self.SpinPolarization: BoolType | BoolKey = BoolKey(name='SpinPolarization', comment='Determines if a spin-polarized calculation is performed. If set, the VASP keyword ISPIN is set to 2.', gui_name='Spin-polarization:', default=False) self.VASPExec: str | StringKey = StringKey(name='VASPExec', comment='Command used to execute VASP.\n\nFor example: mpirun -np 4 vasp\n\nCan also be left empty if VASP_COMMAND is set as an environment variable.', gui_name='Command to execute VASP:') self.Verbosity: BoolType | BoolKey = BoolKey(name='Verbosity', comment='If set, more detailed information is printed in the EngineVASP.log file.', gui_name='Verbosity:', default=False) self.WAVECARFile: str | Path | StringKey = PathStringKey(name='WAVECARFile', comment='Path to a WAVECAR (wavefunction) file from a previous calculation that is used to initialize the present calculation.\n\nIf specified, the file will be copied into the new calculation directory and the VASP keyword ISTART will be set to 1.', gui_name='WAVECAR file:', ispath=True) self.XC: Literal["Auto", "LDA", "BLYP", "PW91", "PBE", "PS", "RE", "RP", "AM", "91", "B3", "B5", "BF", "BO", "CA", "MK", "OR", "PE", "PZ", "VW", "WI", "TPSS", "RTPSS", "M06L", "MS0", "MS1", "MS2", "SCAN", "RSCAN", "R2SCAN", "SCAN-REVV10", "MBJ", "VDW-DF", "VDW-DF-CX", "VDW-DF-CX0P", "OPTPBE-VDW", "OPTB88-VDW", "OPTB86B-VDW", "VDW-DF2", "REV-VDW-DF2", "BEEF-VDW", "HF", "B3LYP", "B3PW91", "PBE0", "HSE03", "HSE06", "HSESOL", "SOGGA", "SOGGA11", "SOGGA11-X", "N12", "N12-SX", "MN12L", "GA", "MN15L", "HLE17", "REVM06L", "M06SX", "03", "05", "10", "20", "PL", "CO", "HL", "RA"] = MultipleChoiceKey(name='XC', comment='The exchange-correlation functional.\nThis setting *must* be consistent with POTCAR. If your desired functional is not present in the list, choose Auto and set the GGA tag manually under Additional INCAR options. \n\nAuto: The XC functional is determined by the information in POTCAR. For more information on what these options do, see the VASP manual. \n\nNote that some options are only available depending on your version of VASP or how it was compiled.', gui_name='XC functional:', default='Auto', choices=['Auto', 'LDA', 'BLYP', 'PW91', 'PBE', 'PS', 'RE', 'RP', 'AM', '91', 'B3', 'B5', 'BF', 'BO', 'CA', 'MK', 'OR', 'PE', 'PZ', 'VW', 'WI', 'TPSS', 'RTPSS', 'M06L', 'MS0', 'MS1', 'MS2', 'SCAN', 'RSCAN', 'R2SCAN', 'SCAN-REVV10', 'MBJ', 'VDW-DF', 'VDW-DF-CX', 'VDW-DF-CX0P', 'OPTPBE-VDW', 'OPTB88-VDW', 'OPTB86B-VDW', 'VDW-DF2', 'REV-VDW-DF2', 'BEEF-VDW', 'HF', 'B3LYP', 'B3PW91', 'PBE0', 'HSE03', 'HSE06', 'HSESOL', 'SOGGA', 'SOGGA11', 'SOGGA11-X', 'N12', 'N12-SX', 'MN12L', 'GA', 'MN15L', 'HLE17', 'REVM06L', 'M06SX', '03', '05', '10', '20', 'PL', 'CO', 'HL', 'RA']) self.nk1: int | IntKey = IntKey(name='nk1', comment='Number of k-points in the first dimension', default=1) self.nk2: int | IntKey = IntKey(name='nk2', comment='Number of k-points in the second dimension', default=1) self.nk3: int | IntKey = IntKey(name='nk3', comment='Number of k-points in the third dimension', default=1) self.sk1: float | FloatKey = FloatKey(name='sk1', comment='Fractional shift of the k-mesh in the first dimension', default=0.0) self.sk2: float | FloatKey = FloatKey(name='sk2', comment='Fractional shift of the k-mesh in the second dimension', default=0.0) self.sk3: float | FloatKey = FloatKey(name='sk3', comment='Fractional shift of the k-mesh in the third dimension', default=0.0) self.vdW: Literal["Disable", "DFT-D2", "DFT-D3", "DFT-D3(BJ)", "DFT-D4", "DFT-ulg", "dDsC", "TS", "TSWithIterativeHirshfeldPartitioning", "ManyBodyDispersionEnergyMethod", "ManyBodyDispersionEnergyWithFractionallyIonicModelForPolarizability", "libMD"] = MultipleChoiceKey(name='vdW', comment='The van der Waals correction method.\n\nVASP keyword: IVDW\nDefault: IVDW = 0 (Disable)', gui_name='van der Waals method:', default='Disable', choices=['Disable', 'DFT-D2', 'DFT-D3', 'DFT-D3(BJ)', 'DFT-D4', 'DFT-ulg', 'dDsC', 'TS', 'TSWithIterativeHirshfeldPartitioning', 'ManyBodyDispersionEnergyMethod', 'ManyBodyDispersionEnergyWithFractionallyIonicModelForPolarizability', 'libMD']) self.Misc: str | Sequence[str] | FreeBlock = self._Misc(name='Misc', comment='The contents of this block are copied verbatim into the VASP INCAR file. Tags set in this block will override other input options. \n\nNote: do not set POTIM, IBRION, INTERACTIVE or EDIFFG in this block, as those keys are set by the AMS driver and cannot be changed.\n\nBy default, the AMS driver also sets the following default values for the following tags:\nNSW=999999999 (enforce VASP to run indefinetly until killed)\nIWAVPR=11 (Wave function extrapolation when the volume of the cell changes)\nISYM=0 (symmetry is disabled to avoid spurious error due to wavefunction mismatch between ionic steps)\nISIF=3 (capture stress-induced changes (only for VASP version >=6.4))', gui_name='Additional INCAR options:') self.POTCAROverride: VASP._POTCAROverride = self._POTCAROverride(name='POTCAROverride', comment='Selects the pseudopotentials to use for each atomic species. Choosing this overrides the default option for each element found in POTCARLibrary.', gui_name='POTCAR directory override:')