three-body-algorithm

You have to understand how full and half neighbor lists work first. With a full neighbor list, each atom stores all its neighbors - so the I-J pair will be in the list twice. If it’s a half list, each I-J pair appears exactly once in the list, either with atom I or atom J being the main atom.

Tersoff is a many-body potential, so that I-J interaction also depends on the neighbors of this pair. Effectively making I-J not equal to J-I. Therefore, Tersoff requires a full neighbor list. However, the repulsive term in Tersoff is pure 2-body, meaing I-J repulsion is the same as J-I repulsion. Which means I-J repulsion needs to be calculated just once, hence the code is skipping half of the I-J pairs for the calculation of the repulsion term.