Scaling point charges in atom group with adapt/fep

Hi all,

I’m trying to perform some FEP calculations of some different polymer chains in solvent and have followed the examples for CH4 solvation in the LAMMPS examples to begin with.

For the FEP calculation I’d like to rescale all of the point charges in my polymer (~200 atoms) accordingly with lambda, similar to the CH4 example:

> variable lambda equal ramp(0.0,1.0)
> variable q1 equal -0.24*v_lambda
> variable q2 equal  0.06*v_lambda
> 
> fix ADAPT all adapt/fep 100000 &
>   pair lj/cut/tip4p/long/soft lambda 1*2 3*4 v_lambda &
>   atom charge 1 v_q1 &
>   atom charge 2 v_q2 &
>   after yes

In the example, the charge variable is defined for C and H types manually which is fine for two atoms types, but I’m dealing with quite a few different atom types with various charges assigned. I’m wondering if there is any quick and obvious way to just scale each of the point charges for the polymer with respect to lambda to save defining a new variable for each one.

I’ve tried to do something like the following using the scale argument but am getting “Illegal fix adapt/fep command” error:

> variable lambda equal ramp(0.0,1.0)
> 
> fix ADAPT all adapt/fep 100000 &
>   pair lj/cut/tip4p/long/soft lambda 1*16 17*20 v_lambda & 
>   atom charge 1*16 v_lambda 
>   scale yes after yes reset yes
> 
> variable dlambda equal 0.05
> 
> compute FEP all fep ${TK} &
>   pair lj/cut/tip4p/long/soft lambda 1*16 17*20 v_dlambda &
>   atom charge 1*16 v_dlambda scale yes

Thanks in advance for any advice,
Charlotte

Looking at the source code, I can see that fix adapt/fep does not support the “scale yes” keyword for “atom charge” processing, only fix adapt. Please also note that you are using a long-range Coulomb solver, so you will also need to scale kspace.

With fix adapt the command to scale all charges would be:

fix ADAPT all adapt 100000 atom charge v_lambda kspace v_lambda scale yes reset yes