VaspInputGenerator

class atomate2.vasp.sets.base.VaspInputGenerator(structure=None, config_dict=<factory>, files_to_transfer=<factory>, user_incar_settings=<factory>, user_kpoints_settings=<factory>, user_potcar_settings=<factory>, constrain_total_magmom=False, sort_structure=True, user_potcar_functional=None, force_gamma=True, reduce_structure=None, vdw=None, use_structure_charge=False, standardize=False, sym_prec=0.1, international_monoclinic=True, validate_magmom=True, inherit_incar=False, auto_kspacing=False, auto_ismear=True, auto_ispin=False, auto_lreal=False, auto_metal_kpoints=True, bandgap_tol=0.0001, bandgap=None, prev_incar=None, prev_kpoints=None, _valid_potcars=None)[source]

Bases: VaspInputSet

Base atomate2 implementation of a VASP input set.

Base class representing a set of VASP input parameters with a structure supplied as init parameters and initialized from a dict of settings. This allows arbitrary settings to be input. In general, this is rarely used directly unless there is a source of settings in yaml format (e.g., from a REST interface). It is typically used by other VaspInputSets for initialization.

Special consideration should be paid to the way the MAGMOM initialization for the INCAR is done. The initialization differs depending on the type of structure and the configuration settings. The order in which the magmom is determined is as follows:

  1. If the site is specified in user_incar_settings, use that setting.

  2. If the site itself has a magmom setting (i.e. site.properties[“magmom”] = float),

    that is used. This can be set with structure.add_site_property().

  3. If the species of the site has a spin setting, that is used. This can be set

    with structure.add_spin_by_element().

  4. If the species itself has a particular setting in the config file, that is used, e.g. Mn3+ may have a different magmom than Mn4+.

  5. Lastly, the element symbol itself is checked in the config file. If there are no settings, a default value of 0.6 is used.

Parameters:
  • structure (Structure) – The Structure to create inputs for. If None, the input set is initialized without a Structure but one must be set separately before the inputs are generated.

  • config_dict (dict) – The config dictionary to use.

  • files_to_transfer (dict) – A dictionary of {filename: filepath}. This allows the transfer of files from a previous calculation.

  • user_incar_settings (dict) – User INCAR settings. This allows a user to override INCAR settings, e.g. setting a different MAGMOM for various elements or species. Note that in the new scheme, ediff_per_atom and hubbard_u are no longer args. Instead, the CONFIG supports EDIFF_PER_ATOM and EDIFF keys. The former scales with # of atoms, the latter does not. If both are present, EDIFF is preferred. To force such settings, just supply user_incar_settings={“EDIFF”: 1e-5, “LDAU”: False} for example. The keys ‘LDAUU’, ‘LDAUJ’, ‘LDAUL’ are special cases since pymatgen defines different values depending on what anions are present in the structure, so these keys can be defined in one of two ways, e.g. either {“LDAUU”:{“O”:{“Fe”:5}}} to set LDAUU for Fe to 5 in an oxide, or {“LDAUU”:{“Fe”:5}} to set LDAUU to 5 regardless of the input structure. If a None value is given, that key is unset. For example, {“ENCUT”: None} will remove ENCUT from the incar settings. Finally, KSPACING is a special setting and can be set to “auto” in which the KSPACING is set automatically based on the band gap.

  • user_kpoints_settings (dict or .Kpoints) – Allow user to override kpoints setting by supplying a dict. e.g. {“reciprocal_density”: 1000}. User can also supply Kpoints object.

  • user_potcar_settings (dict) – Allow user to override POTCARs. e.g. {“Gd”: “Gd_3”}. This is generally not recommended.

  • constrain_total_magmom (bool) – Whether to constrain the total magmom (NUPDOWN in INCAR) to be the sum of the expected MAGMOM for all species.

  • sort_structure (bool) – Whether to sort the structure (using the default sort order of electronegativity) before generating input files. Defaults to True, the behavior you would want most of the time. This ensures that similar atomic species are grouped together.

  • user_potcar_functional (str) – Functional to use. Default (None) is to use the functional in the config dictionary. Valid values: “PBE”, “PBE_52”, “PBE_54”, “LDA”, “LDA_52”, “LDA_54”, “PW91”, “LDA_US”, “PW91_US”.

  • force_gamma (bool) – Force gamma centered kpoint generation. Default (False) is to use the Automatic Density kpoint scheme, which will use the Gamma centered generation scheme for hexagonal cells, and Monkhorst-Pack otherwise.

  • reduce_structure (None/str) – Before generating the input files, generate the reduced structure. Default (None), does not alter the structure. Valid values: None, “niggli”, “LLL”.

  • vdw (str | None) – Adds default parameters for van-der-Waals functionals supported by VASP to INCAR. Supported functionals are: DFT-D2, undamped DFT-D3, DFT-D3 with Becke-Jonson damping, Tkatchenko-Scheffler, Tkatchenko-Scheffler with iterative Hirshfeld partitioning, MBD@rSC, dDsC, Dion’s vdW-DF, DF2, optPBE, optB88, optB86b and rVV10.

  • use_structure_charge (bool) – If set to True, then the overall charge of the structure (structure.charge) is used to set the NELECT variable in the INCAR. Default is False.

  • standardize (float) – Whether to standardize to a primitive standard cell. Defaults to False.

  • sym_prec (float) – Tolerance for symmetry finding.

  • international_monoclinic (bool) – Whether to use international convention (vs Curtarolo) for monoclinic. Defaults True.

  • validate_magmom (bool) – Ensure that the missing magmom values are filled in with the VASP default value of 1.0.

  • inherit_incar (bool or list[str]) – Whether to inherit INCAR settings from a previous calculation. This might be useful to port Custodian fixes to child jobs but can also be dangerous, e.g., when switching from GGA to meta-GGA or relax to static jobs. Defaults to True. Can also be a list of strings to specify which parameters are inherited.

  • auto_kspacing (bool) – If true, determines the value of KSPACING from the bandgap of a previous calculation.

  • auto_ismear (bool) – If true, the values for ISMEAR and SIGMA will be set automatically depending on the bandgap of the system. If the bandgap is not known (e.g., there is no previous VASP directory) then ISMEAR=0 and SIGMA=0.2; if the bandgap is zero (a metallic system) then ISMEAR=2 and SIGMA=0.2; if the system is an insulator, then ISMEAR=-5 (tetrahedron smearing). Note, this only works when generating the input set from a previous VASP directory.

  • auto_ispin (bool) – If generating input set from a previous calculation, this controls whether to disable magnetisation (ISPIN = 1) if the absolute value of all magnetic moments are less than 0.02.

  • auto_lreal (bool) – If True, automatically use the VASP recommended LREAL based on cell size.

  • auto_metal_kpoints (bool) – If true and the system is metallic, try and use reciprocal_density_metal instead of reciprocal_density for metallic systems. Note, this only works if the bandgap is not None.

  • bandgap_tol (float) – Tolerance for determining if a system is metallic when KSPACING is set to “auto”. If the bandgap is less than this value, the system is considered metallic. Defaults to 1e-4 (eV).

  • bandgap (float) – Used for determining KSPACING if KSPACING == “auto” or ISMEAR if auto_ismear == True. Set automatically when using from_prev_calc.

  • prev_incar (str or dict) – Previous INCAR used for setting parent INCAR when inherit_incar == True. Set automatically when using from_prev_calc.

  • prev_kpoints (str or .Kpoints) – Previous Kpoints. Set automatically when using from_prev_calc.

  • _valid_potcars (Sequence[str] | None)

structure: Structure | None = None