sith package

Subpackages

Submodules

class sith.SithWriter.WriteSITH(geometry)[source]

Bases: object

Object that saves the variables used in sith as g09 fchk format. That helps the user to reduce the amount of data store for sith analysis, while still having the posibility to read it and reuse it again.

Parameters:

geometry – Geometry containing the info requiered for energy analysis.

write_file(outputfile: str = './geometry_data.fchk')[source]

Fills lines attribute and writes the output file.

Parameters:

outputfile (str. Default=./geometry_data.fchk) – name of the output file. It should have fchk extension.

Return type:

(str) lines to be printed in the output file.

sith.SithWriter.write_sith_data(sith_obj, outdir: str = './')[source]

Creates all the fchk files for each structure in a sith object

Parameters:
  • sith_obj (sith) – sith object with all the information stored in the attributes.

  • outdir (str. Default=./) – directory where to create the subdirectory “sith_data”. Default=./

Return type:

(str) name of the subdir

class sith.Utilities.Geometry(name: str = '')[source]

Bases: object

Geometry object that stores the geometric information of each structure and sith takes to compute the energy distribution analysis. Every sith.readers.<reader> must assing the values of Geometry attributes.

Parameters:

name (str (optional)) – name of the Geometry object, it is arbitrary. Default defined by reader.

name

Name of geometry, based off of stem of .fchk file path unless otherwise modified.

Type:

str

n_atoms

Number of atoms

Type:

int

scf_energy

Potential energy associated with geometry.

Type:

float

dims

Array of number of DOFs types in 4 components [0]: total dimensions/DOFs [1]: bond lengths [2]: bond angles [3]: dihedral angles

Type:

np.array

dim_indices

Indices that define each DOF with shape (#DOFs, 4). These indices start in one. Index zero means None for DOFs with less than 4 indices, e.g. distances.

Type:

np.array

dof

values of the DOFs for the given configuration with shape (#DOFs).

Type:

np.array

hessian

Hessian matrix associated with the geometry in units of

Type:

np.array

internal_forces

Forces in DOFs.

Type:

np.array

atoms

Atoms object associated with geometry.

Type:

ase.Atoms

Note
Type:

All quantities are in units of Hartrees, Angstrom, radians

kill_dofs(dof_indices: list[int]) array[source]

Takes in list of indices of degrees of freedom and removes DOFs from dof, dim_indices, internal_forces, and hessian; updates dims

Parameters:

dof_indices (list) – list of indices to remove.

Return type:

(numpy.array) dim_indices of removed dofs.

sith.Utilities.color_distribution(sith: SITH, dofs: ndarray, idef: int, cmap: Colormap, absolute: bool = False, div: int = 5, decimals: int = 3, respect_to_total_energy: bool = False) tuple[ndarray, BoundaryNorm][source]

Extract the energies of the specified DOFs and deformation structure, and the normalization according to a cmap.

Parameters:
  • sith (SITH) – sith object with the distribution of energies and structures information.

  • dofs (array) – specific set of dofs to extract the energies.

  • idef (int) – index of the structure to extract the energies.

  • cmap (Colormap) – colormap to normalize according the number of divisions.

  • absolute (bool. Default=False) – True to define the color bar based on the maximum energy of the all the DOFS in all the stretching confs. False to define the color bar based on the maximum energy of the all the DOFS in the present stretching conf.

  • div (int) – number of sets of colors in which the colorbar is divided.

  • decimals (Default=3) – number of decimals of the ticks of the colorbar.

  • respect_to_total_energy (bool. Default=False) – if true, the maximum of energies will be calculated with respect to the total energy of all the DOFs, not only the selected ones. Note that the difference with absolute is that absolute uses the total energy of the selected DOFs but among all the stretched configurations.

Returns:

  • (np.array, BoundaryNorm) set of energies of DOFs and deformation structure

  • and the BoundaryNorm object to get the distribution of colors.

sith.Utilities.create_colorbar(normalize: BoundaryNorm, label: str, cmap: Colormap = None, deci: int = 3, labelsize: float = 10, height: float = 1.7, width: float = None, dpi: int = 300, ax=None) None[source]

Discrete colorbar according defined by a matplotlib.BoundaryNorm.

Parameters:
  • normalize (BoundaryNorm) – normalization function.

  • label (str) – label of the color bar.

  • cmap (Colormap. Default=None) – colormap to of the colorbar. If None, it will be YlGn.

  • deci (int. Default=3) – number of decimals of the ticks in the colorbar.

  • labelsize (int. Default=10) – size of the labels of the colorbar.

  • height (int. Default=1.7) – height (in inches) of the space that will contain the scene and the color bar.

  • width (float. Default=None) – width (in inches) of the space that will contain the color bar. If None, it will be (3 + deci) * fontsize.

  • dpi (int Default=300) – dot per inch. it’s a meassurement of resolution.

Return type:

(plt.fig, ax) Figure and the axis of the colorbar.