Skip to content

Commit

Permalink
corrected gaff_imp.py so that the number of improper interactions gen…
Browse files Browse the repository at this point in the history
…erated by moltemplate now agrees with Antechamber. (credit: bhargavchava97)
  • Loading branch information
jewettaij committed Apr 4, 2020
1 parent 24e75a6 commit ed16629
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions moltemplate/nbody_alt_symmetry/gaff_imp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__author__ = "bhargavchava97(github), Andrew Jewett"


try:
from ..nbody_graph_search import Ugraph
except:
Expand Down Expand Up @@ -73,6 +76,18 @@ def canonical_order(match):
if atom0 <= atom3:
#return ((atom0,atom1,atom2,atom3), (bond0, bond1, bond2))
# But this is the same thing as:
return match
if atom0 <= atom1:
if atom1 <= atom3:
return match
else:
return ((atom0,atom3,atom2,atom1), (bond0,bond2,bond1))
else:
return ((atom1,atom0,atom2,atom3), (bond1,bond0,bond2))

elif atom3 <= atom1:
if atom0 <= atom1:
return ((atom3,atom0,atom2,atom1), (bond2,bond0,bond1))
else:
return ((atom3,atom1,atom2,atom0), (bond2,bond1,bond0))
else:
return ((atom3,atom1,atom2,atom0), (bond2,bond1,bond0))
return ((atom1,atom3,atom2,atom0), (bond1,bond2,bond0))

0 comments on commit ed16629

Please sign in to comment.