Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



57 Commits

Repository files navigation

Orient molecule

Provides a python script to perform routine manipulations of .xyz coordinate files used in quantum chemistry. This script started out as Python practice but ended up being useful enough to share.


Give the script a filename and a list of operations and it will operate on the file and print the results to the screen. For example -tx 2.0 -rz 90.0 -ty -0.2

will transform the molecule found in by

  • translating by 2.0 Angstroms in the x direction
  • rotating 90 degrees about the z axis
  • translating by -0.2 Angstrom in the y direction


  • accepts
    • xyz files including multiframe xyz files
    • Gaussian cube files
  • translations
    • by any specified vector
    • individual atom to origin
    • center of mass to origin
  • rotations
    • about a cartesian axis
    • about a user defined vector
    • about the vector defined by a pair of atoms
    • about normal of best fit plane for set of atoms
  • reflections
    • across a cartesian plane
    • across a plane defined by arbitrary normal vector
    • across a bond (bond vector defines normal)
    • across a plane defined by a set of atoms
  • compound transformations:
    • orient:
      • translate center of mass to origin
      • principle axes along cartesian axes
    • align: given three atoms
      • translate midpoint of atoms 1 and 2 to origin
      • rotate so atoms 1 and 2 lie along x axis, and all three atoms define xy plane
    • best fit plane: given more than three atoms
      • translate so centroid of selected atoms is at origin
      • rotate so atoms are in the xy plane and atoms 1 and 2 define x direction


  • numpy


Python script for command-line manipulation of molecules







No releases published


No packages published