The remaining issue is determining the number of repeats to use. Due to the 1/r decay of the Coulomb potential, for electrostatic energy between an atom in the main box and one in a PBC image to be accurate within accuracy ε, the number of repeats should be on the order of (εR) -1 (R: box size in 1D). As an example, for ε = 10 -8 and R = 100 (Å), the number of repeats is 10 6 , which is impractical. Instead of accuracy in interactions between individual atom pairs, we consider the interaction between an atom in the main box and all atoms in a periodic repeat collectively. This should be distinguished from the non-periodic and wrap-around interactions which aim accuracy in pairwise interactions via Eq. 12. If the simulation box is electrically neutral, the PBC box-based Coulomb energy and force are expected to be small and decay fast. Furthermore, instead of aiming for the absolute accuracy, we use relative accuracy to determine the number of repeats. In this approach, let the energy and force for atom a from the non-periodic and wrapped-around parts be E m+w a and ⃗ f m+w a , respectively ('m' and 'w' stand for 'main' and 'wrap-around'). For the k-th PBC box repeat, if