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.

  • 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

  • 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’


{‘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.

  • els – list of element symbols

  • bases – corresponding basis set names for the elements

  • rel_cutoff – The desired relative cutoff


Ideal cutoff for calculation.


Get the truncated Coulomb cutoff for a given structure.


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 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.


name – Name of the functional.


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]