# The atom order (i,j,k,l) in defining an improper dihedral in Gromacs using the OPLS-AA force field

**URL:** <https://gromacs.bioexcel.eu/t/the-atom-order-i-j-k-l-in-defining-an-improper-dihedral-in-gromacs-using-the-opls-aa-force-field/3658>\
**Category:** User discussions\
**Tags:** forcefield\
**Created:** [February 11, 2022, 8:08pm UTC](https://gromacs.bioexcel.eu/t/the-atom-order-i-j-k-l-in-defining-an-improper-dihedral-in-gromacs-using-the-opls-aa-force-field/3658 "2022-02-11T20:08:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nano](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@nano](https://gromacs.bioexcel.eu/u/nano)\
**Post date:** [February 11, 2022, 8:08pm UTC](https://gromacs.bioexcel.eu/t/the-atom-order-i-j-k-l-in-defining-an-improper-dihedral-in-gromacs-using-the-opls-aa-force-field/3658/1 "2022-02-11T20:08:14Z")

</div>

Dear Gromacs and simulation community,

I have a question about the atom order (i,j,k,l) in defining an improper dihedral in Gromacs using the OPLS-AA force field.

From the manual, Figure 24 (top one) in the manual ([Bonded interactions — GROMACS 2019 documentation](https://manual.gromacs.org/documentation/2019/reference-manual/functions/bonded-interactions.html)). The following topology of improper dihedral is defined:

```auto
atom-i in the center for planar atom and surrounded by other three atoms (j,k, and l)

```

From this schematic figure, I assume that the center atom should be the first. And if defined in a rtp file using opls force field, the improper dihedral should be (e.g., for a carbonyl group):

```auto
[impropers]
; ai aj ak al
i	j	k	l	improper_O_C_X_Y

```

This is also consistent with the previous discussions in the forum.

Based on the above information, I checked the aminoacids.rtp file in oplsaa.ff, charmm27.ff and amber03.ff in the Gromacs software (2020.4, under /usr/local/gromacs/share/gromacs/top/). Here are they, when I compare the [GLY] residue:

OPLS:

```auto
 [impropers]
    -C CA N H improper_Z_N_X_Y 
    CA +N C O improper_O_C_X_Y 

```

Charmm

```auto
 [impropers]
	N	-C	CA	HN
	C	CA	+N	O

```

and Amber

```auto
 [impropers]
    -C CA N H
    CA +N C O

```

Clearly, for charmm and amber, the order is consistent with [here](https://github.com/michellab/Sire/issues/193). i.e., charmm puts the center atom (label-i) first, while amber puts the center atom third. What confused me, however, is the one defined in opls, which also puts the center atom third, and seems to follow the following label:  
 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/e/e46876080b6cb215286ded5ebdc452e130c4dd71.png)

What am I missing here? To make it simple, if a carboxylic acid R-COOH is to be defined using opls.aa force field, should it be:

```auto
[impropers]
; ai aj ak al
C	R	OH	OC	improper_O_C_X_Y

```

or

```auto
[impropers]
; ai aj ak al
R	OH	C	OC	improper_O_C_X_Y

```

Thanks in advance for any comments.

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [February 21, 2022, 1:51pm UTC](https://gromacs.bioexcel.eu/t/the-atom-order-i-j-k-l-in-defining-an-improper-dihedral-in-gromacs-using-the-opls-aa-force-field/3658/2 "2022-02-21T13:51:51Z")

</div>

There are no rules for a center atom. You simply define two planes, each defined by three atoms. The angle is given by the angle between these two planes.

---

<div class="post-metadata">

**Author:** ![nano](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@nano](https://gromacs.bioexcel.eu/u/nano)\
**Post date:** [February 26, 2022, 4:32pm UTC](https://gromacs.bioexcel.eu/t/the-atom-order-i-j-k-l-in-defining-an-improper-dihedral-in-gromacs-using-the-opls-aa-force-field/3658/3 "2022-02-26T16:32:17Z")

</div>

Thanks. That makes sense. One more note is that different force fields have different styles in defining improper angles, e.g. some use 0 while some others use 180 (like mentioned, the only rule is to check the angle between the two planes). Thus, it may cause confusion to beginners, like me.

Thanks again!
