How to go from Tinker improper to LAMMPS improper?

I am trying to build a tool that looks at tinker ff.out forcefield files and creates a LAMMPS trajectory (I know moltemplate and stuff exists, but I really want to understand the mechanics…).

I see the following lines in Tinker:

 Improper Torsion Parameters :

                 Atom Numbers           Amplitude, Phase and Periodicity

     1        2     6     1     7               1.667   180.0   2   
     2        6     7     1     2               1.667   180.0   2   
     3        7     2     1     6               1.667   180.0   2   
     4        1     3     2     8               1.667   180.0   2   
     5        3     8     2     1               1.667   180.0   2   
     6        8     1     2     3               1.667   180.0   2   
     7        2     4     3     9               1.667   180.0   2   
     8        4     9     3     2               1.667   180.0   2   
     9        9     2     3     4               1.667   180.0   2   
    10        3     5     4    10               1.667   180.0   2   
    11        5    10     4     3               1.667   180.0   2   
    12       10     3     4     5               1.667   180.0   2   
    13        4     6     5    11               1.667   180.0   2   
    14        6    11     5     4               1.667   180.0   2   
    15       11     4     5     6               1.667   180.0   2   
    16        1     5     6    12               1.667   180.0   2   
    17        5    12     6     1               1.667   180.0   2   
    18       12     1     6     5               1.667   180.0   2   

My question is, what kind of potential is this? I understand it is an improper potential, but how do I translate Amplitude, Phase and Periodicity into a LAMMPS-acceptable improper_style potential?

Any advice you have would be appreciated.

You need to look up the specific potential function that Tinker implements for that specific improper potential, and also what units and settings it uses. Then you can compare this to the various improper potential functions (i.e. improper styles) that LAMMPS supports and pick the one that implements the same function or a superset. The LAMMPS documentation should list in detail what units are used for individual parameters. Please note that different MD codes sometimes have prefactors like 1/2 either included in their force constant parameters or use them explicitly.

That information will allow you to create a translation. Sometimes, additional math is required, e.g. certain MD codes store 12-6 Lennard-Jones in “A” and “B” prefactors instead of “epsilon” and “sigma” (cf. lennard/mdf versus lj/mdf) or may have different conventions like whether LJ sigma corresponds to the point where E(r)=0 or the minimum of the lj/cut potential. These can all be converted into each other, but it is crucial to understand what conventions and definitions are used where. Any good software should provide that information in its documentation.