Calculating free energy of ion charging using compute fep


If you want to use one of the soft-cored pair styles, then you have to define it for the atom types of which you are perturbing parameters. Typically you use lj/cut/coul/long for the atom types which are kept unchanged, and lj/cut/coul/long/soft for those whose parameters will be changing.

pair_style hybrid lj/cut/coul/long 10.0 10.5 lj/cut/coul/long/soft 1 0.5 10.0 10.0 10.5

You also need to set the pair_coeffs accordingly, in your case between atom types 1*2 and 7:

pair_coeff 1 7 lj/cut/coul/long/soft epsilon sigma 1.0

Then, on the compute fep you have to reference these pair styles:

compute cFEP all fep 300 &
    pair lj/cut/coul/long/soft lambda 7 1*2 v_dlambda &
    atom charge 7 v_dqNa

Please make sure you fully understand the FEP method. It is not trivial to do free energy calculations on systems with a net charge. Corrections are necessary, which this code does not include. You’ll have to study the literature, for example Hunenberger and McCammon, J Chem Phys 110 (1999) 1856.

Also, doing a one-step perturbation of a full LJ parameter or full unit of charge will not produce good sampling. A better technique is to change the parameters stepwise using fix adapt/fep, and compute small perturbations at each step. These are then added-up to calculate the total free energy difference.


Agilio Padua