How to calculate forces only for one atom type, during a NVE simulation?

I have system that has 3 atom_types (1, 2 and 3).
The interactions between these atoms are given by a neural network potential.
I need to freeze atoms of type 1 and 2, and to run a NVE simulation only for atoms of type 3 .
I tried to do this :

group Ag type 3
fix 001 Ag nve
run ${duration}

Atoms 1 and 2 are well freezed, and only the positions and forces of atom 3 are updated.
But the computation time is the same as when I run NVE for all the atoms.
In fact, atoms of type 1 and 2 are freezed, but their forces are calculated at each timestep.
How can I do so that I only compute forces for atoms of type 3 ?
I tried to use “neigh_modify exclude 1 2”, but I think the result is wrong… maybe because the neural network needs the full list of neighbors to calculate the angular symmetry functions ?

Could you help me with this ?
Thank you very much in advance !


That is really a question for the people that designed and developed that potential. Most likely it is.

Bottom line: immobilizing atoms and thus ignoring their velocities and forces is not the same as not computing forces, since the immobile atoms may still have interactions with the mobile atoms.

Thank you for your reply !
I thought I could reduce the calculation time by only calculating the forces exerted on type 3 atoms (see here : neigh_modify command — LAMMPS documentation : “When a large collection of atoms is treated as frozen, interactions between those atoms can be turned off to save needless computation. E.g. Using the fix setforce command to freeze a wall or portion of a bio-molecule.”)

But if I understand correctly, this is not compatible with the use of a NNP…
Thanks anyway !

Expecting immobilized atoms to “speed up” a calculation is not just not compatible with the use of an NNP – but with pairwise potentials in general.

Imagine three LJ atoms (within cutoff distance of each other). If you want particle 3 to exert force on particles 1 and 2 you must compute the 1-2 distance, and then the force, and then the 1-3 distance, and then the force. That calculation costs the same amount of time whether particle 3 subsequently moves under those forces, or is kept immobile. The amount of time needed to integrate particle 3’s equations of motion is very small compared to the earlier force calculations (as any LAMMPS log file’s Performance section will show).

If there are pairs of atoms that are immobile, you can then skip calculating that particular pair force altogether. That will speed up the calculation, but as you say, NNP forces are not so easily decomposed and thus this kind of speedup is not available to them (which is the cost of their extra realism).

The main way in which constraints ever speed up a calculation is indirectly: if you get rid of fast, irrelevant dynamics (such as the OH bond vibration in water), you can have faster timesteps and thus longer trajectories from the same effort.

Ok, thank you very much for these explanations !