WARNING: This old code has a bug in the way electrostatic cutoff distances ("inner2", "outer2") were implemented. If you use electrostatics cutoffs, (for example, if your system does not use short-range electrostaics), then download the latest version of this code. This version is no longer supported.

pair_style command


pair_style style args 
    lj/charmm/coul/charmm/inter args = 
     inner outer (inner2) (outer2) (coeff_style) (rmix_style) (rsoftcore cutoff_ratio)

    inner, outer = global switching cutoffs for Lennard Jones (and Coulombic if only 2 args)
    coeff_style  = ab, eskl, es4-4, es1-2, es4k4l, or es1k2l (see below)
    rmix_style   = arith, maxmax, maxmin, minmax, minmin, or mix_es_from_ab (see below)

New Features Summary

The new lj/charmm/coul/charmm/inter pair style is nearly identical to the lj/charmm/coul/charmm pair_style. However it supports the ability to customize the interactions between atoms in different molecules. For example, to use an epsilon (ϵ) value of 0.4 for atoms in the same molecule, but 0.8 for atoms in a different molecule, you could use something like this:
pair_style lj/charmm/coul/charmm/inter 7.5 8.0
pair_coeff 1 1  0.40 3.6  0 0  0.8 3.6
(The new pair_style also supports repulsive mixing rules and "soft-core" repulsion.)
More complicated examples are shown below.


pair_style lj/charmm/coul/charmm/inter 7.5 8.0
pair_style lj/charmm/coul/charmm/inter 7.5 8.0 eskl maxmax
pair_style lj/charmm/coul/charmm/inter 7.5 8.0 es4k4l maxmax rsoftcore 1.0
pair_style lj/charmm/coul/charmm/inter 7.5 8.0 es1k2l maxmax rsoftcore 0.8909

pair_coeff 1 1  0.40 3.6
pair_coeff 1 1  0.40 3.6 1.0 -0.5
pair_coeff 1 1  0.40 3.6 1 -1  0 0 0 0  0.8 3.6 1 0

All of the lj/charmm styles compute LJ and Coulombic interactions with an additional switching function S(r) that ramps the energy and force smoothly to zero between an inner and outer cutoff. It is a widely used potential in the CHARMM MD code. See (MacKerell) for a description of the CHARMM force field.


Both the LJ and Coulombic terms require an inner and outer cutoff. They can be the same for both formulas or different depending on whether 2 or 4 arguments are used in the pair_style command. In each case, the inner cutoff distance must be less than the outer cutoff. It it typical to make the difference between the 2 cutoffs about 1.0 Angstrom.


Compared to lj/charmm/coul/charmm , pair_style lj/charmm/coul/charmm/inter uses a slightly more general formula for the Lennard Jones interaction ("LJ(r)"). In addition to epsilon and sigma parameters (ϵ and σ), which scale the energy and distance, two optional dimensionless constants K and L can be used to independently tune the short-range and long-range terms. (These parameters typically lie in the range from -1.0 to 1.0.) The two remaining dimensionless constants, Ca and Cb are determined by the optional coeff_style argument. (See below.) By default, Ca and Cb are both 4, and K and L are 1 and -1.)

With this pair style you have the option to specify a coeff_style argument, which effects the formula for the Lennard Jones forces as follows:
coeff_style      meaning:                        required user coeffs:
ab      LJ(r)=      A / r^12   -   B / r^6,      A,B     specified by user

eskl    LJ(r)=   e*[K*(s/r)^12 +   L*(s/r)^6]    e,s,K,L specified by user

es4k4l  LJ(r)= 4*e*[K*(s/r)^12 +   L*(s/r)^6]    e,s,K,L specified by user

es1k2l  LJ(r)=   e*[K*(s/r)^12 + 2*L*(s/r)^6]    e,s,K,L specified by user

es4-4   LJ(r)= 4*e*[K*(s/r)^12 -   L*(s/r)^6]    e,s (K,L inferred from sign)

es1-2   LJ(r)=   e*[K*(s/r)^12 - 2*L*(s/r)^6]    e,s (K,L inferred from sign)
Here "e" and "s" are shorthand for epsilon (ϵ) and sigma (σ). The last two options allow the user to omit K and L. However users have some limited control over K and L by altering the sign of ϵ and σ:
    e>0, s>0   -->   K=1, L=-1    (default/typical usage)
    e>0, s<0   -->   K=1, L=0
    e<0, s<0   -->   K=1, L=1
    e<0, s>0   -->   K=0, L=1
The default coeff style is "es4-4". (This way, the syntax of the pair_coeff commands remains unchanged from the syntax used in "lj/charmm/coul/charmm", and the behavior is the same for positive "e" and "s".) Interactions between unlike atom types are determined by mixing . (See below.)

The following coefficients must be defined for each pair of atoms types via the pair_coeff command as in the examples above, or in the data file or restart files read by the read_data or read_restart commands, or by mixing as described below:

The optional epsilon_14 and sigma_14 parameters customize the interactions between the first and fourth atoms participating in a dihedral interaction (IE. "1-4 interactions"). The optional epsilonDIF and sigmaDIF parameters allow the user to customize the interactions between atoms in different molecules. If these parameters are unspecified, they are set to "epsilon" and "sigma" by default. (However you must specify epsilon_14 and sigma_14 if you wish to specify the epsilonDIF and sigmaDIF parameters. They can not be omitted.)

No pair-specific cutoffs are specified because this CHARMM force field does not allow varying cutoffs for individual atom pairs; all pairs use the global cutoff(s) specified in the pair_style command.

If you use the "eskl" "es4k4l" or "es1k2l" styles, then you must also specify

parameters for for each of the interactions you defined. In that case the order of the parameters should be: epsilon, sigma, K, L, epsilon_14, sigma_14, K_14, L14, epsilonDIF, sigmaDIF, K_DIF, and L_DIF (as shown in the examples above).

Again, specifying the "14" and "DIF" parameters is optional.

In this example:
pair_coeff 1 1  0.40 3.6 1 -1  0 0 0 0  0.8 3.6 1 0
...the user has turned OFF the attractive part of the interaction between atoms in different molecules (by switching the "L" parameter to zero), while leaving the repulsive steric interaction in place.

Optional "soft-core" interactions

To reduce numerical instability, (and as an alternative to rRESPA), users have the option to switch to a softer 1/r^2 repulsive interaction at small separation distances.
If specified, then the argument following the optional "rsoftcore" keyword is the cutoff distance for switching to a 1/r^2 approximation to the Lennard-Jones repulsive interaction at short distances. The 1/r^2 potential is automatically scaled and shifted so that the potential and force are continuous at the switching boundary.
This cutoff distance is not specified directly in real distance units. Instead it is a ratio expressed in units of sigma (which varies according to the atom types and mixing rules shown below). The optimal value of this cutoff depends on the coeff_style, but is usually near 1.0. When coeff_style is set to "es4-4", or "es4k4l" then this ratio is typically set to 1.0. (For this coeff_style, 1.0 sigma corresponds to the zero crossing radius, LJ(sigma)=0. Repulsion at distances less than 1.0 sigma is typically very strong.) When coeff_style is set to "es1-2", or "es1k2l", then this ratio is typically set to 2^(-1/6), which is approximately 0.8909. (This corresponds to the zero-energy crossing radius for that coeff_style.) This cutoff ratio is a global setting, and it applies to all atom type pairs which use this pair style.
Unfortunately, if you use the soft-core repulsion feature, you must explicitly set all 1-4 coeffs to zero. (Otherwise 1-4 interactions are not treated correctly at these short distances.)

Soft-core repulsion is not recommended when charges are present. 1/r^2 repulsion is typically not strong enough to prevent opposite charges from getting unrealistically close together.

Mixing, shift, table, tail correction, restart, rRESPA info:

For atom type pairs I,J and I != J, the epsilon, sigma, epsilon_14, and sigma_14, epsilonDIF, and sigmaDIF coefficients for all of the lj/charmm pair styles can be mixed. The default rule for mixing epsilon and sigma parameters is arithmetic to coincide with the usual settings for the CHARMM force field. See the "pair_modify" command for details.

The rule for mixing interactions between one or two repulsive particles is determined by the optional rmix_style argument. By default rmix_style is set to "maxmax". With this choice, repulsive interactions override attractive ones. The other choices are shown below:

rmix_style      meaning:
maxmax --> Kij=MAX(Ki,Kj),  Lij=MAX(Li,Lj)  repulsive interactions "win"
maxmin --> Kij=MAX(Ki,Kj),  Lij=MIN(Li,Lj)
minmax --> Kij=MIN(Ki,Kj),  Lij=MAX(Li,Lj)
minmin --> Kij=MIN(Ki,Kj),  Lij=MIN(Li,Lj)
arith  --> Kij=0.5*(Ki+Kj), Lij=0.5*(Li+Lj)  (if coeff_style not "ab")
       --> Aij=0.5*(Ai+Aj),  Bij=0.5*(Bi+Bj)  (if coeff_style is "ab")
mix_es_from_ab  -->  only available when coeff_style is "ab"
Generally none of these rmix_style settings effect the mixing rules for epsilon and sigma ("e" and "s"). (They are still determined by the preferences set by the "pair_modify" command.)
(Comment: Feel free to suggest other mixing/combination rules I should add to this list. I know there are some others.)

None of the lj/charmm pair styles support the pair_modify shift option, since the Lennard-Jones portion of the pair interaction is smoothed to 0.0 at the cutoff.

None of the lj/charmm pair styles support the pair_modify tail option for adding long-range tail corrections to energy and pressure, since the Lennard-Jones portion of the pair interaction is smoothed to 0.0 at the cutoff.

All of the lj/charmm pair styles write their information to binary restart files, so pair_style and pair_coeff commands do not need to be specified in an input script that reads a restart file.

This style only supports the pair keyword of run_style respa. See the run_style command for details.


The lj/charmm/coul/charmm/inter style is part of the MOLECULE package. It is only enabled if LAMMPS was built with this package. See the Making LAMMPS section for more info. Note that the MOLECULE and KSPACE packages are installed by default.

Related commands:


pair_style lj/charmm/coul/charmm

Default: none

(MacKerell) MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field, Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998).