pyvibdmc.simulation_utilities.xyz_npy

Classes

XYZNPY

Handler of xyz <-> npy conversion, like a personal version of openBabel.

Module Contents

class pyvibdmc.simulation_utilities.xyz_npy.XYZNPY[source]

Handler of xyz <-> npy conversion, like a personal version of openBabel.

static extract_xyz(file_name, num_atoms)[source]

Extracts the coordinates from an xyz file and returns it as an np array of dimension nxmx3, where n = number of geometries, m = number of atoms, and 3 = cartesian coordinates

Parameters:
  • file_name (str) – Name of the .xyz file, including extension

  • num_atoms (int) – Number of atoms in molecule.

Returns:

nxmx3 numpy array of coordinates

static write_xyz(coords, fname, atm_strings, cmt=None)[source]

Writes a numpy array of x,y,z coordinates to a .xyz file

Parameters:
  • fname – name of xyz file

  • coords – numpy array, either mx3 or nxmx3, where n = number of geometries and m = number of atoms

  • atm_strings – list of strings that correspond to the atom type e.g. [“H”,”H”,”O”]

Returns:

np.ndarray