\(\newcommand{\AA}{\text{Å}}\)

CRYSTALpytools.base.basisset module

A base module for CRYSTAL basis set, including BasisSetBASE, which is the class for basis sets of the whole system and AtomBS, which is the class of a single atom. Definitions of shells and Gaussian type functions (GTF) are saved as dictionary under AtomBS().shells attribute. The Basis Set Exchange (BSE) Python API is used to get and convert basis sets.

To call and modify parameters of a certain GTF, which is usually needed when optimizing basis set:

>>> bs = BasisSetBASE.from_bse('6-311G*', [6, 1]) # Download 6-311G* BS from BSE
>>> print(bs.atoms[0].shells[1]['angular momentum']) # Get the angular momentum
>>> bs.atoms[0].shells[1]['orbitals'][2][0] = 1.46000 # Change the exponent of the 3rd GTF, 2nd shell, 1st atom
>>> bs.atoms[0].shells[1]['orbitals'][2][1] = 0.001 # Contraction
>>> bs.atoms[0].shells[1]['orbitals'][2][2] = 0.815854 # sp coefficient

Basis set definitions.

class AtomBS(z, nshell, ECP=None)

Bases: object

Basis set class for CRYSTALpytools

Parameters:
  • z (int) – Conventional atomic number

  • nshell (int) – Number of shells

  • ECP (str) – Effective core potential, printed before basis sets

define_a_shell(ITYB, LAT, NG, CHE, SCAL, orbitals=[])

Define shells of atomic basis sets. Arguments are consistent with CRYSTAL manual.

Parameters:
  • ITYB (int) – Type of Gaussain orbitals

  • LAT (int) – Angular momentum

  • NG (int) – Number of Gaussian orbitals

  • CHE (float) – Charge

  • SCAL (float) – Scaling factor

  • orbitals (list) – nGTO*2 or nGTO*3 (sp type) list of exponent and contraction factors

Returns:

obj (AtomBS)

classmethod read_bse(bs, z)

Read basis sets saved in Basis Set Exchange(BSE) dictionary format and assign charge.

Note

All electron basis sets only. Atoms are charge neutral.

Parameters:
  • bs (str) – Name of basis set

  • z (int) – Conventional atomic number

Returns:

obj (AtomBS)

static _assign_charge(element, bs)

Assign charge to basis sets from BSE, where the charge info is missing.

BSE sorts shells by angular momentum acending order, i.e., 1s, 2s, 3s, 2p, 3p, 3d…

Note

All electron basis sets only. Atoms are charge neutral.

Parameters:
  • element (element) – Mendeleev Element object.

  • bs (dict) – BSE basis set dictionary

Returns:

chg (list) – nshell*1 list of charge assigned to every shell.

classmethod read_crystal(text)

Analyze text in CRYSTAL format.

print_crystal()

Print basis set into CRYSTAL format

class BasisSetBASE(atoms=[])

Bases: object

The basisset object base object, as the class of basis sets defined for the whole system. Basis sets from string, file or Basis Set Exchange(BSE), can be read and saved as a list of AtomBS objects.

classmethod from_bse(bs, z)

Get or append basis sets from Basis Set Exchange(BSE).

Parameters:
  • bs (str) – Name of basis set. Only one name is accepted.

  • z (int | list[int]) – Conventional atomic number.

Returns:

cls

classmethod from_string(bs, fmt='crystal')

Parse basis set strings.

Parameters:
  • bs (str) – Basis set string.

  • fmt (str) – Format string. Consistent with BSE python API. For non- CRYSTAL formats, only all-electron basis sets are supported. Charge of each shell will be automatically assigned to get charge neutral atoms if fmt is not ‘crystal’.

Returns:

cls

classmethod from_file(bs, fmt='crystal')

Parse basis set files.

Parameters:
  • bs (str) – Basis set file.

  • fmt (str) – Format string. Consistent with BSE python API. For non- CRYSTAL formats, only all-electron basis sets are supported. Charge of each shell will be automatically assigned to get charge neutral atoms.

Returns:

cls

print_crystal()

Print the information into CRYSTAL basis set format