I do not fully understand how f_nc is computed. I expect it to produce the same results as the following code but they are different:
f_nc = np.zeros((N,3))
df_pc = -1 * de_p[_c] * r_pc / r_p[_c]
for i, j, f in zip(i_p, j_p, df_pc):
f_nc[i] += f
For a given interaction (i,j), the neighbor list contains both (i,j) and (j,i) entries. However, since I am only using the i_p values, this should already take care of the double counting.
However, they do not produce the same results which I don't fully understand why. It would be great if someone can explain what is happening here.
Hello, I am trying to understand the following code in the context of the real part of the ewald sum: from: pair_potential /calculator.py Line-396
I do not fully understand how f_nc is computed. I expect it to produce the same results as the following code but they are different:
For a given interaction (i,j), the neighbor list contains both (i,j) and (j,i) entries. However, since I am only using the i_p values, this should already take care of the double counting.
However, they do not produce the same results which I don't fully understand why. It would be great if someone can explain what is happening here.