SimTk/msmbuilder — pull request #63 by rmcgibbo (2012-09-26 09:36:02+00:00)
Title: Internal Coordinates

Additions to `msmbuilder/geometry`.

1) I want to do some metric stuff in internal coordinates, but I'd like to be as general as possible. This means not just using all of the backbone dihedrals as the input space, but instead using 3N-6 internal coordinates.

I found [Baker, Kessi, Delley J. Chem. Phys. 105, 192 (1996)](http://dx.doi.org/10.1063/1.471864), and they need these internal coordinates for a different purpose, which is choosing a coordinate system in which to do quantum chemistry geometry optimizations, but it's a similar problem.

The idea is to compute all of the bond lengths, bond angles, and dihedral angles (not like all N^2, N^3, or N^4 of them, just the ones between atoms that are actually bonded together). In general, this gets you more than 3N-6 as some are redundant. So then you do some linear algebra to find some combinations that are non-redundant.

2) Adding the ability to extract bond angles for every frame in a trajectory, just like we have with bond lengths and dihedral angles. I used `scipy.weave` to do it in C++ with OpenMP, but I also have a reference python implementation that it can be tested against.

Mostly it works right now, although on alanine I think I'm getting 3 more coordinates than I should. There is a little work left to be done dealing with collinear atoms, since dihedral angles which are exactly 180 degrees break stuff and need to be treated separately.

@schwancr: you might find this code useful too?