transition_sampling.util package

Subpackages

Submodules

transition_sampling.util.periodic_table module

Submodule that handles the generation of periodic table information.

transition_sampling.util.periodic_table.atomic_symbols_to_mass(atoms)

Converts atomic symbols to their atomic masses in amu.

Parameters

atoms (Sequence[str]) – List of atomic symbols

Return type

list[float]

Returns

List of atomic masses

transition_sampling.util.xyz module

Utilities for parsing xyz files

transition_sampling.util.xyz.read_xyz_file(filename)

Reads xyz files into an atom list and xyz array

Parameters

filename (str) – path to xyz file

Return type

ndarray

Returns

xyz – 3d array of (n_frames, n_atoms, xyz)

transition_sampling.util.xyz.read_xyz_frame(ifile)

Reads a single frame from XYZ file.

Parameters

ifile (IO) – opened file ready for reading, positioned at the num atoms line

Return type

Union[tuple[None, bool], tuple[ndarray, bool]]

Returns

  • xyz – Coordinates of the frame

  • eof – true if end of file has been reached.

transition_sampling.util.xyz.write_xyz_frame(file, atoms, frame, comment='')

Write a single xyz frame to the given file.

Parameters
  • file (IO) – Open file for writing to

  • atoms (Sequence[str]) – list of atom names

  • frame (ndarray) – array with shape (n_atoms, 3)

  • comment (str) – string to be placed in the comment line. Defaults to empty.

Raises

ValueError – If the # of atoms does not match the size of the 1st dimension of the frame

Return type

None

Module contents