bug report for dihedral_style helix (& table)

But report:
  Dihedral_style "helix" and "fix restrain" calculate the dihedral
angle in inconsistent ways (using the opposite sign convention). The
"fix restrain" code appears to be using the standard "IUPAC/IUB
convention" and the conventions used by DLPOLY, OPLS, (and even
wikipedia, I think):

http://www.structuralbioinformatics.com/chapter7.shtml
http://kinemage.biochem.duke.edu/teaching/anatax/html/anatax.1b.html
(see figure 6)
http://www.pumma.nl/index.php/Theory/Potentials#Dihedral
http://galilei.chem.psu.edu/~bjg/Chem560_2003/Potentials/OPLS_1996.pdf
(See "Propenol" on figure 1)
http://cscweb.kist.re.kr/code/DL_POLY/manual/REFERENCE_2.0.pdf
(See pp. 37-38)
http://en.wikipedia.org/wiki/Dihedral_angle#Alternative_definitions
(I think these conventions are all the same.)

However the dihedral styles "helix" and "table" use the opposite
convention. (I haven't tested "charmm" or "opls" yet, but
dihedral_style charmm shares the same code with "fix restraint" which
seems to be working.)

I am currently patching "table" and will fix this.
Does anybody want me to fix "helix" as well?

--- Documentation ---
Is there a figure (or at least a link to a web page) in the official
LAMMPS documentation which says what the dihedral sign convention
should be? If not, can we add something. (I'm happy to draw up a
quick figure if somebody wants me to.)

Cheers

Andrew

yes - this would all be good - I often get confused
by the dihedral ordering myself - so a couple diagrams
for the doc pages would be helpful. Ditto for the improper
styes.

Steve

yes - this would all be good - I often get confused
by the dihedral ordering myself - so a couple diagrams
for the doc pages would be helpful.

Great.
Here's a figure showing the dihedral angle sign and zero-point
"IUPAC/IUB convention" used also by "dihedral_style table" and "fix
restrain" (and soon dihedral_style helix). If I have time, I'll take
a look at the other dihedral styles too and see which convention they
use. If so I'll post another message.

Ditto for the improper
styes.

Some lammps users have requested an improper_style table.
If I have time to do this, I'll definitely include a figure for the
improper angle sign convention as well.

(Note: Tabular improper forces can be accomplished using dihedral
tables instead, but it's not very intuitive.
See the earlier discussion at
http://lammps.sandia.gov/threads/msg21689.html)

Cheers

Andrew

dihedral_sign_convention.svg

dihedral_sign_convention.pdf (10.6 KB)

dihedral_sign_convention.png

I tested dihedral_styles "charmm" and "cosine/shift/exp", and they
both use the same dihedral angle sign convention that "helix" and
"table" now do (since the patches). So all is good at this point and
all of the main dihedral styles which support negative dihedral angles
use the same sign convention (see earlier figure). Please add a
sentence or two about this somewhere in the documentation.
Thanks!
Andrew
P.S.
The one remaining problem is is the "class2" dihedral style, but
that's another post.