exa-analytics / exatomic

A unified platform for theoretical and computational chemists
https://exa-analytics.github.io/exatomic
Apache License 2.0
19 stars 12 forks source link

Align molecule along an axis and new centering methods #167

Closed herbertludowieg closed 4 years ago

herbertludowieg commented 5 years ago

Is your feature request related to a problem? Please describe. We have already implemented methods to be able to center and rotate a molecule. I think it would not be a big step to add a method to center and align a molecule along some pre-defined axis.

Describe the solution you'd like This should be fairly simple and the pseudo code would probably look like this: 1). Define the vector going through the atoms that are to be aligned 2). Get the normal vector from the two vectors with the vector product 3). Get the angle with the scalar product 4). Center the molecule with the Atom.center method 5). Rotate the molecule with the Atom.rotate method

herbertludowieg commented 5 years ago

Something else that would be good to add would be new centering methods. The Atom.center method allows us to center the coordinate origin on a specific atom, but it might be good if we can also center it on the center of mass or center of charge based on the nuclear charges.