from __future__ import annotations
from pathlib import Path
from typing import Iterable, Literal, Sequence
from scm.pisa.block import DriverBlock,EngineBlock,FixedBlock,FreeBlock,InputBlock
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 planewave 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 Initialize: 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 Initialize: 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", "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", "1stOrderMethfesselPaxton", "2ndOrderMethfesselPaxton", "TetrahedronMethodWithoutBlochlCorrections", "TetrahedronMethodWithBlochlCorrections"]
:ivar OnlyPreprocessing: If Yes, VASP will not be executed. Instead, the first set of input files (e.g. INCAR, POSCAR, POTCAR, KPOINTS) that would have been read by VASP will be left on disk for inspection.
:vartype OnlyPreprocessing: BoolType | BoolKey
:ivar POTCARFile: Use a custom POTCAR file. This will override the POTCAR created from the POTCARLibrary.
:vartype POTCARFile: str | Path | StringKey
: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. Click the arrow to see or change exactly which POTCAR files are used.
:vartype POTCARLibrary: str | Path | StringKey
:ivar Precision: VASP keyword: PREC
:vartype Precision: Literal["Single", "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
:vartype VASPExec: str | StringKey
:ivar Verbosity: If set, more detailed information is printed in the output file.
:vartype Verbosity: BoolType | BoolKey
: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.
Note: not all functionals are implemented in all versions of VASP.
Auto: The XC functional is determined by the information in POTCAR. The GGA setting is not set.
LDA: the VASP GGA setting is set to an empty string.
PBE: sets GGA = PE.
PW91: sets GGA = 91.
HF: Hartree-Fock. Sets LHFCALC = .TRUE, AEXX = 1, ALDAC = 0, AGGAC = 0.
PBE0: sets GGA = PE, LHFCALC = .TRUE.
HSE06: sets GGA = PE, LHFCALC = .TRUE., HFSCREEN = 0.2.
B3LYP: sets LHFCALC = .TRUE., GGA = B3, AEXX = 0.2, AGGAX = 0.72, AGGAC = 0.81, ALDAC = 0.19.
All other options set the VASP GGA setting to the corresponding value. For more information, see the VASP manual.
:vartype XC: Literal["Auto", "LDA", "PBE", "PW91", "HF", "PBE0", "HSE06", "B3LYP", "03", "05", "10", "20", "91", "AM", "B3", "B5", "BF", "BO", "CA", "CO", "HL", "MK", "OR", "PE", "PL", "PS", "PZ", "RA", "RE", "RP", "VW", "WI"]
: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)", "TS", "TSWithIterativeHirshfeldPartitioning", "ManyBodyDispersionEnergyMethod", "IDVW=4"]
:ivar Misc: The contents of this block are copied verbatim into the VASP INCAR file.
Note: do not set NSW, IBRION, ISIF or LWAV in this block, as those keys are set by the AMS driver.
:vartype Misc: str | Sequence[str] | FreeBlock
"""
[docs] class _Misc(FreeBlock):
r"""
The contents of this block are copied verbatim into the VASP INCAR file.
Note: do not set NSW, IBRION, ISIF or LWAV in this block, as those keys are set by the AMS driver.
"""
def __post_init__(self):
pass
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 planewave basis set.\n\nVASP keyword: ENCUT', gui_name='Planewave 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.Initialize: str | Path | StringKey = PathStringKey(name='Initialize', 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.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", "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', '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", "1stOrderMethfesselPaxton", "2ndOrderMethfesselPaxton", "TetrahedronMethodWithoutBlochlCorrections", "TetrahedronMethodWithBlochlCorrections"] = 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', '1stOrderMethfesselPaxton', '2ndOrderMethfesselPaxton', 'TetrahedronMethodWithoutBlochlCorrections', 'TetrahedronMethodWithBlochlCorrections'])
self.OnlyPreprocessing: BoolType | BoolKey = BoolKey(name='OnlyPreprocessing', comment='If Yes, VASP will not be executed. Instead, the first set of input files (e.g. INCAR, POSCAR, POTCAR, KPOINTS) that would have been read by VASP will be left on disk for inspection.', gui_name='Only preprocess:', default=False)
self.POTCARFile: str | Path | StringKey = PathStringKey(name='POTCARFile', comment='Use a custom POTCAR file. This will override the POTCAR created from the POTCARLibrary.', hidden=True, gui_name='POTCAR file:', ispath=True)
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. Click the arrow to see or change exactly which POTCAR files are used.', gui_name='Path to POTCAR library:', ispath=True, gui_type='directory {POTCAR Library}')
self.Precision: Literal["Single", "Normal", "Accurate"] = MultipleChoiceKey(name='Precision', comment='VASP keyword: PREC', gui_name='Precision:', default='Normal', choices=['Single', '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', gui_name='Command to execute VASP:', default='')
self.Verbosity: BoolType | BoolKey = BoolKey(name='Verbosity', comment='If set, more detailed information is printed in the output file.', gui_name='Verbosity:', default=False)
self.XC: Literal["Auto", "LDA", "PBE", "PW91", "HF", "PBE0", "HSE06", "B3LYP", "03", "05", "10", "20", "91", "AM", "B3", "B5", "BF", "BO", "CA", "CO", "HL", "MK", "OR", "PE", "PL", "PS", "PZ", "RA", "RE", "RP", "VW", "WI"] = 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.\nNote: not all functionals are implemented in all versions of VASP. \n\nAuto: The XC functional is determined by the information in POTCAR. The GGA setting is not set.\nLDA: the VASP GGA setting is set to an empty string.\nPBE: sets GGA = PE.\nPW91: sets GGA = 91.\nHF: Hartree-Fock. Sets LHFCALC = .TRUE, AEXX = 1, ALDAC = 0, AGGAC = 0.\nPBE0: sets GGA = PE, LHFCALC = .TRUE.\nHSE06: sets GGA = PE, LHFCALC = .TRUE., HFSCREEN = 0.2.\nB3LYP: sets LHFCALC = .TRUE., GGA = B3, AEXX = 0.2, AGGAX = 0.72, AGGAC = 0.81, ALDAC = 0.19.\n\nAll other options set the VASP GGA setting to the corresponding value. For more information, see the VASP manual.', gui_name='XC functional:', default='Auto', choices=['Auto', 'LDA', 'PBE', 'PW91', 'HF', 'PBE0', 'HSE06', 'B3LYP', '03', '05', '10', '20', '91', 'AM', 'B3', 'B5', 'BF', 'BO', 'CA', 'CO', 'HL', 'MK', 'OR', 'PE', 'PL', 'PS', 'PZ', 'RA', 'RE', 'RP', 'VW', 'WI'])
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)", "TS", "TSWithIterativeHirshfeldPartitioning", "ManyBodyDispersionEnergyMethod", "IDVW=4"] = 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)', 'TS', 'TSWithIterativeHirshfeldPartitioning', 'ManyBodyDispersionEnergyMethod', 'IDVW=4'])
self.Misc: str | Sequence[str] | FreeBlock = self._Misc(name='Misc', comment='The contents of this block are copied verbatim into the VASP INCAR file.\n\nNote: do not set NSW, IBRION, ISIF or LWAV in this block, as those keys are set by the AMS driver.', gui_name='Additional INCAR options:')