Rotating Geometries in in an Trajectory-type (xyz/DL_POLY HISTORY)

It is useful to rotate the geometries in an xyz file on a particular ALF because this centers all geometries in a dataset on a particular set of atoms. Then you can visually compare datasets to see how the atoms are moving. The ALF contains a central atom, x-axis atom, and xy-plane atom. After calculating the ALF features and converting back into Cartesian coordinates, the central atom is always as the origin (0,0,0), the x-axis atom is moving only along the x-axis (only the x component is changing for all geometries), and the xy-plane atom is only moving in the xy plane (only the x and y components are changing for all geometries).

You can center on a particular alf by doing something like:

[1]:
from ichor.core.files import Trajectory
from ichor.core.atoms import ALF
alf = {"N1": ALF(0, 2, 1)}
traj = Trajectory("../../../example_files/xyz/AMMONIA-1000.xyz")
# rotates all geometries on the given alf and writes to a new xyz file
# note this is commented out because it otherwise will write out a file in the docs.

# traj.center_geometries_on_atom_and_write_xyz("C1", alf, "methanol_sp_centered_c1.xyz")

Alternatively, you can also gen an ALF automatically by using one of the alf calculators:

[2]:
from ichor.core.files import Trajectory
from ichor.core.calculators import default_alf_calculator

traj = Trajectory("../../../example_files/xyz/AMMONIA-1000.xyz")

# uses the default calculator to calculate and ALF for ever atom
alf = traj.alf_dict(default_alf_calculator)

# rotates all geometries on the given alf and writes to a new xyz file
# note this is commented out because it otherwise will write out a file in the docs.

# traj.center_geometries_on_atom_and_write_xyz("C1", alf, "methanol_sp_centered_c1.xyz")