L n 3 ) are the reciprocal lattice vectors, Q t = i q i is the total charge inside the simulation cell, and κ e is the damping parameter. The prime on the first sum of Eq. ( ) signifies the exclusion of the terms i = j for n = 0. In the calculation of U we use the tin foil boundary condition that eliminates the M M M 2 term in Eq. (7). Note that if one places a virtual proton into the system, it will no longer be charge neutral. A periodically replicated charge non-neutral system will have infinite energy. To avoid this in the calculation of Eq. ( ), we have introduced a uniform neutralizing background. In practice, to calculate Ewald sums we used 600 k-vectors. The damping parameter is set to κ e = 5/L, so that we can use simple periodic boundary conditions for calculating the short range -erfc term in Eq. ( ) -contribution to the total electrostatic energy.