Utility functions for assisting with cp2k IO

get_aux_basis(basis_type, default_basis_type='cFIT')[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, d, cardinality='DZVP', functional='PBE')[source]

Given a specie and a potential/basis type, this function accesses the available basis sets and potentials. Generally, the GTH potentials are used with the GTH basis sets.

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

  • d – (dict) a dictionary specifying how bases and/or potentials should be assigned to species E.g. {‘Si’: {‘cardinality’: ‘DZVP’, ‘sr’: True}, ‘O’: {‘cardinality’: ‘TZVP’}}

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

  • basis_type – (str) the basis set type. Default: ‘MOLOPT’

  • cardinality – (str) basis set cardinality. Default: ‘DZVP’


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

Return type

(dict) of the form {‘specie’


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 creates unique sites, based on site properties, but does not have anything to do with turning those site properties into CP2K input parameters.


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]