pymatgen.io.cp2k.utils module

Utility functions for assisting with cp2k IO

get_aux_basis(basis_type, default_basis_type='cpFIT')[source]

Get auxiliary basis info for a list of species.

Parameters
  • basis_type (dict) –

    dict of auxiliary basis sets to use. i.e: basis_type = {‘Si’: ‘cFIT’, ‘O’: ‘cpFIT’}. Basis type needs to exist for that species.

    Basis types:

    FIT cFIT pFIT cpFIT GTH-def2 aug-{FIT,cFIT,pFIT,cpFIT, GTH-def2}

  • default_basis_type (str) –

get_basis_and_potential(species, basis_and_potential_map, functional='PBE')[source]

Retrieve basis/potential dictionary

Parameters
  • species – (list) list of species for which to get the potential/basis strings

  • basis_and_potential_map – (dict or str) a keyword string or a dictionary specifying how bases and/or potentials should be assigned

  • functional – (str) functional type. Default: ‘PBE’

Returns

{‘potential’: potential, ‘basis’: basis}…}

Return type

(dict) of the form {‘specie’

get_cutoff_from_basis(els, bases, rel_cutoff=50)[source]

Gets the appropriate cutoff for the calculation given the elements/basis sets being used and the desired relative cutoff.

Parameters
  • els – list of element symbols

  • bases – corresponding basis set names for the elements

  • rel_cutoff – The desired relative cutoff

Returns

Ideal cutoff for calculation.

get_truncated_coulomb_cutoff(inp_struct)[source]

Get the truncated Coulomb cutoff for a given structure.

get_unique_site_indices(structure)[source]

Get unique site indices for a structure according to site properties. Whatever site-property has the most unique values is used for indexing.

For example, if you have magnetic CoO with half Co atoms having a positive moment, and the other half having a negative moment. Then this function will create a dict of sites for Co_1, Co_2, O. This function also deals with “Species” properties like oxi_state and spin by pushing them to site properties.

This creates unique sites, based on site properties, but does not have anything to do with turning those site properties into CP2K input parameters. This will only be done for properties which can be turned into CP2K input parameters, which are stored in parsable_site_properties.

get_xc_functionals(name)[source]

Get the XC functionals for a given functional name. This utility does not deal with defining hybrid functionals since those may or may not require ADMM, which is not supported by LibXC and so needs to be manually defined.

Parameters

name – Name of the functional.

natural_keys(text)[source]

Sort text by numbers coming after an underscore with natural number convention, Ex: [file_1, file_12, file_2] becomes [file_1, file_2, file_12]