Enforcing atomonly neighbor list with atom_style other than atomic

Hello,

I am using ML-HDNNP package for ML-driven MD simulations with the latest 24.Aug.2024 version, which only need “atomic” atom_style and “atomonly” neighbor list.

I would like to use “hybrid” pair_style to perform thermodynamic integration for CO2 liquid between the ML potential and a classical potential that needs bond and angle descriptions. So, when I include bond and angle information in the data file for read_data with atom_style “angle”, then neighbor list is set up so that I see “pair build: full/bin”, not “pair build: full/bin/atomonly”, definitely because the bond information is considered to construct the neighbor list including atoms outside the cutoff radius. I found that the HDNNP behaves incorrectly with “pair build: full/bin” so that the predicted CO2 structure becomes weird. I tested that the total energies are different for the same atomic structure between “atomic” and “angle” atom_style due to the different neighbor list construction.

So, I would like to force HDNNP always consider atomonly neighbor list no matter which atom_style is selected. I checked pair_hdnnp.cpp code and it seems that I may need to change the part in the code as shown below, but I am not sure how to do this.

void PairHDNNP::init_style()
{
neighbor->add_request(this, NeighConst::REQ_FULL);

If you don’t mind, could you please suggest the way that I can do this? Also I am wondering if what I would like to do is actually impossible.

Thank you so much.

Best regards,
Kwangnam Kim

Sorry, but I don’t think that that will work.

That is because you have two conflicting configurations in the same system. The classical force field needs bonds and those require that non-bonded interactions between bonded atoms are ignored. This is done in LAMMPS on the level of neighbor lists and thus it will break your machine learned potential. You can recover this by using special_bonds lj/coul 1.0 1.0 1.0, but that will then break your CO2 non-bonded interactions. Also, you must not compute the bonded interactions with the ML potentials. So basically this approach is a no-go solution.

Instead, you may want to have a look at running a dual replica simulation with two different topologies (and atom styles and neighbor list settings) and then use fix alchemy to do your transition from one system to the other.

Quite impossible.

I really appreciate your reply. Thank you so much.