aiida_cusp.data.inputs.vasp_potcar module

Datatypes and methods to initialize and interact with VASP specific pseudo-potential files

class aiida_cusp.data.inputs.vasp_potcar.VaspPotcarData(*args, **kwargs)

Bases: Dict

Pseudopotential input datatype for VASP calculations.

Contrary to the related VaspPotcarFile class this object does not contain any proprietary potential information and only stores the potential’s uuid value and the unique potential identifiers (name, functional, version and the content hash)

property element

Make associated potential element a property

property filenode_uuid

Make associated potential UUID a property

classmethod from_structure(structure, functional, potcar_params={})

Create potcar input data for a given structure and functional.

Reads elements present in the passed structure and builds the input list of VaspPotcarData instances defining the potentials to be used for each element. By default the potential names are assumed to equal the corresponding element names and potentials of the latest version are used. This default behavior can be changed on a per element basis by using the potcar_params dictionary to explicitly define the potential name and / or version to be used for a given element

Assume a structure containig elements ‘A’ and ‘B’. For both elements the potentials with name ‘A_pv’ and ‘B_pv’ should be used and additionally element ‘B’ requires the use of a specific potential version, i.e. version 10000101 (Note that the version number is simply an integer representation of the creation date found in the potcar files title in the format YYYYMMDD) The above can be achived by passing the following potcar_params to the method:

potcar_params = {
    'A': {'name': 'A_pv'},
    'B': {'name': 'B_pv', 'version': 10000101},
}

Note

Alternatively it is also possible to use the potcar_params to pass a simple list defining the potential names (i.e. A_pv, B_pv, …) to be used for the calculation (for all elements in the structure not defined by the passed list the default potentials will be used!) In that case potentials of the latest version are used and the method tries to figure out the elements corresponding to the potential name automatically. Because of that: make sure that each potential name starts with the corresponding element name (case sensitive!) followed by any non-letter character, for instance: Ge_d_GW, Li_sv, Cu, H1.75, etc…

Parameters:
  • structure (Structure, Poscar, StructureData or VaspPoscarData) – input structure for which the potential list is generated

  • functional (str) – functional type of the used potentials, accepted functionals inputs are: ‘lda_us’, ‘lda’, ‘lda_52’, ‘pbe’, ‘pbe_52’, ‘pbe_54’, ‘pw91_us’ and ‘pw91’.

  • potcar_params (dict or list) – optional dictionary overriding the default potential name and version used for the element given as key or a list of potential names to be used for the calculation

property functional

Make associated potential functional a property

property hash

Make associated potential hash a property

init_from_tags(name, version, functional)

Initialized VaspPotcarData node from given potential tags

Parameters:
  • name (str) – name of the potential

  • version (int) – version of the potential

  • functional (str) – functional of the potential

Raises:

VaspPotcarDataError – if one of the non-optional parameters name, version or functional is missing

load_potential_file_node()

Load the actual potential node associated with the potential data node

First tries to load the potential file node from the given UUID. If this fails (for instance because the VaspPotcarData node was imported from some other database) a second attempt will try to load a potential file node based on the stored content hash.

Returns:

the associated VaspPotcarFile node

Return type:

VaspPotcarFile

Raises:

VaspPotcarDataError – if no corresponding potential file node is found in the database

property name

Make associated potential name a property

Assemble pymatgen Potcar object from a list of VaspPotcarData instances

Reads pseudo-potential from the passed list connecting each element with it’s potential and creates the complete Potcar file according to the element ordering fodun in the passed poscar data object.

Parameters:
  • poscar_data – input structure for VASP calculations

  • linklist (dict) – dictionary mapping element names to VaspPotcarData instances

Returns:

pymatgen Potcar data instance with containing the concatenated pseudo-potential information for all elements defined in the linklist

Return type:

Potcar

classmethod potcar_props_from_name_list(potcar_name_list)

Create a valid potcar properties dictionary from a list of given potential names

property version

Make associated potential version a property

class aiida_cusp.data.inputs.vasp_potcar.VaspPotcarFile(path_to_potcar, name, element, version, functional, checksum)

Bases: SinglefileData

Datatype representing an actual POTCAR file object stored to the AiiDA database.

Note that this class should never be called directly to add any pseudo-potentials to the database but always using the provided add_potential()-classmethod.

Parameters:
  • path_to_potcar (str) – Absolute path pointing to the potcar file

  • name (str) – qualified name of the potential at location path_to_potcar (i.e. Li, Li_sv, Ge_pv_GW, …)

  • element (str) – element associated with the pseudo-potential

  • version (int) – version of the pseudo-potential, i.e. the creation date as 8-digit integer in numerical YYYYMMDD representation

  • functional (str) – functional group of the potential located at path_to_potcar. Valid choices are: lda_us, lda, lda_52, lda_54, pbe, pbe_52, pbe_54, pw91 and pw91_us

  • checksum (str) – SHA-256 hash of the potential contents

classmethod add_potential(path_to_potcar, name=None, functional=None)

Create and return unstored potential node from POTCAR file.

Loads the POTCAR file at the given location and parses the basic identifiers from the file’s contents.

Parameters:
  • path_to_potcar (pathlib.Path) – absolute path pointing to a potcar file

  • name (str) – qualified name of the potential at location path_to_potcar (i.e. Li, Li_sv, Ge_pv_GW, …)

  • functional (str) – functional group of the potential located at path_to_potcar. Valid choices are: lda_us, lda, lda_52, lda_54, pbe, pbe_52, pbe_54, pw91 and pw91_us

property element
classmethod from_tags(name=None, element=None, version=None, functional=None, checksum=None)

Query database for potentials containing a set of given tags.

To query the database at least one of the available tags has to be given. If multiple tags are defined only potentials matching all of the defined tags will be returned.

Parameters:
  • name (str) – fully qualified name of the potential (i.e. Li_sv, Li, Ge_sv_GW, P, …)

  • element (str) – name of the element associated with a given potential (i.e. Cl, Li, S, …)

  • version (int) – version (i.e. the creation date) of the potential in numerical 8-digit integer YYYYMMDD representation

  • functional (str) – functional filter to query only for potentials associated with a specific functional. Allowed values are: lda_us, lda, lda_52, lda_54, pbe, pbe_52, pbe_54, pw91 and pw91_us

  • checksum – the SHA-256 hash value associated with the contents of a potcar file

Returns:

a list of VaspPotcarFile nodes in the database matching the given tags

Return type:

list(VaspPotcarFile)

property functional
property hash
classmethod is_unique(potcar_attrs)

Check if a potential is unqiue (i.e. not already stored).

Uniqueness is checked based on the unique potential identifiers, i.e. the potential name, it’s version and the associated functional.

Parameters:

potcar_attrs (aiida_cusp.utils.PotcarParser) – a PotcarParser instance of the potential to be checked for uniqueness

Returns:

True if no other potential with identical identifiers exists in the database

Return type:

bool

Raises:

MultiplePotcarError – if the a potential with identical identifiers is already stored in the database

property name
validate_element(element)

Assert the given element is in the list of elements.

validate_functional(functional)

Assert the functional is in the list of valid functionals.

validate_name(name)

Assert potential name starts with valid element name.

validate_version(version)

Assert the parsed potential version is valid.

property version