Skip to content

Commit

Permalink
EwardRef better to start with particles in the cell.
Browse files Browse the repository at this point in the history
  • Loading branch information
ye-luo committed Jan 25, 2022
1 parent dfdee22 commit 13f5e80
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/QMCHamiltonians/EwaldRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,12 @@ real_t ewaldEnergy(const RealMat& a, const PosArray& R, const ChargeArray& Q, re
std::vector<RealVec> rr(Npairs);
for (size_t i = 0, n = 0; i < N; ++i)
for (size_t j = 0; j < i; ++j, ++n)
rr[n] = R[i] - R[j];
{
RealVec reduced = dot(inverse(a), R[i] - R[j]);
for (size_t dim = 0; dim < DIM; dim++)
reduced[dim] -= std::floor(reduced[dim]);
rr[n] = dot(a, reduced);
}

#pragma omp parallel for reduction(+ : ve)
for (size_t n = 0; n < Npairs; ++n)
Expand Down

0 comments on commit 13f5e80

Please sign in to comment.