energies. In applications to Monte Carlo codes, it is possible to carry out the sampling at an energy approximating the actual energy and to compensate for this when performing the canonical averages (which might be carried out on a subset of the Markov chain). In this case, the sampling energy might entail using shorter cutoffs than would be warranted on the basis of accuracy. Having determined suitable cutoffs, it is a simple matter to evaluate the energy avoiding treating atom pairs beyond the respective cutoffs. In the following, we treat electrostatic ($e$) interactions, with a per-residue cutoff, and Lennard-Jones ($l$) interactions, with a per-atom cutoff; furthermore we assume that $r_{e2}\ge r_{l2}$, i.e., the electrostatic interactions are longer range than the Lennard-Jones.

We first loop over all the atoms in each residue computing $\v b_s$ and $h_s$ for all residues $s$. We then loop over all pairs of residues, $s
\le t$, skipping any pair whose atoms all belong to the same fragment or those for which $\abs{\v b_s - \v b_t} \ge r_{e2} + h_s + h_t$. If the residue pair survives these tests, then all atom pairs $(i,j)$ from different fragments are considered; if $s=t$, we restrict the pairs 