[lammps-users] dihedrals similar to fourier where n can be fractional

Dear mailing list users: I tried to compute a dihedral potential profile by varying the angle in a dft calculation.
I’ve gotten something that’s fitted to a 0.08 rms error of the form

(angles in radians).
The form is similar to the fourier style but the x coefficient is not integer.
Is there a way to implement this natively? Or do I have to create a custom class?

Mattia Siviero

To add to my problem, I’ve tried searching for how to add a custom dihedral. I can’t even find what I have to modify because the pdf on modifying lammps doesn’t say where I have to go in order to add a custom dihedral

There is a good reason why only integer fourier coefficients are allowed: the dihedral potential has to be continuous and have a continuous derivative so that you can have a proper behavior when there is a full rotation around the central bond of the dihedral. With integer coefficients that is automatic. Did you enforce this required constraint of the dihedral potential when doing the fitting? If not then you may have an unphysical bias on your fitted potential parameters.

That said, it should be straightforward to convert any functional form into a tabulated potential and use dihedral style table. However, that will also complain if the potential is not continuous around the periodic continuation of the table.


Which PDF are you referring to?
There has been extensive documentation describing the steps to modify and extend LAMMPS in the LAMMPS manual for many, many years.
The ability to easily add your own custom style though adding a custom class, either written from scratch or by copying and modifying or as a derived class from an existing class is one of the main selling points and the reason why there are so many potentials and features in LAMMPS. The majority of those are not written by the LAMMPS developers but contributed by LAMMPS users that had a need that the code at the time could not serve (or not efficiently enough) and then wrote their custom version. Please see: https://docs.lammps.org/Modify.html and Modify_bond



But V is not periodic in x0_rad, that is the dihedral angle.
This may be nonsense.

Giovanni La Penna
National research council of Italy
Institute of chemistry of organometallic compounds
via Madonna del Piano 10, 50019 Sesto Fiorentino (FI), Italy