That depends primarily on the “special bonds” settings which can be adjusted with the special_bonds command — LAMMPS documentation
The default setting is lj/coul 0.0 0.0 0.0, i.e. all 1-2, 1-3, and 1-4 pairs in the bond-topology are ignored in the pair-wise neighbor list. And unless you are running in combination of with a kspace style, those pairs are indeed removed. If the values are set to 1.0 instead, the pairs are included. If the values are neither (exactly) 0.0 nor (exactly) 1.0, the pairs are included, but for every “j” atom of an i,j pair in the neighbor list of atom “i” the uppermost 3 bits are used to encode whether it is an 1-2, 1-3, or 1-4 pair. You can see how this this is applied, e.g. in pair style lj/cut when you look at the use of the
sbmask() inline function and the
The reason for this is that this massively simplifies the computation of the bond (and angle, dihedral) force constants, as they can attributed in an additive fashion to just the interaction of the corresponding bonded pair or triple, or quad of atoms. If the pairwise interactions are not removed, then the computation of the, e.g. force constant of the bond (usually derived from a harmonic analysis of vibrational spectra) would have to have the contribution of the non-bonded interaction between the pair of atoms removed to avoid double counting. If your potential does not account for that, you will have a serious design flaw (or a massive parameterization problem).
That is not correct. The indexing is by local index (and not atom ID) in both the neigbor list and the bond list. However, the bond list is not the correct place to look for all bonded neighbors of atom “i” in a neighbor list i,j-pair, since it will by default list each bond only once (corresponding to the newton command — LAMMPS documentation) and also the neighbor list will usually not store neighbors of ghost atoms, unless explicitly flagged in the neighbor list request (and the presence of those is subject to the communication cutoff).
Besides, this is not the proper way to access the bonded neighbors or atom “i”. Instead you should loop over the contents of the
atom->special[i] list. This contains the atom IDs of the neighboring atoms, first all 1-2 pair, then all 1-3 pairs and finally all 1-4 pairs. Those offsets can be looked up in
atom->nspecial[i]. To convert those back to local indexing, you will have to use an atom map and then you can use atom->map() to get the local index. But this is not where the complications end, you may also have to consider that the same atom ID may be present multiple times in the same subdomain (e.g. when running in serial with periodic boundaries), then you have to process the
atom->sametag[i] value which will point you to the next local index with the same atom ID.