Replies: 2 comments 7 replies
-
Hi @mphoward , As a little blast from the past, have a look at the discussion on #396 from ~5 years ago about the normalization on the RDF and why freud has to do it the way it does. If that doesn't clear it up, then we can keep discussing it here. |
Beta Was this translation helpful? Give feedback.
-
@mphoward see section 2.1 of this paper https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3085256/ for a general definition of RDF normalization. Note that the N*(N-1) normalization is only valid when What you are implicitly asking for is more general support for the If we were to swap query points and points in this normalization, then freud would still be correct for finite size normalization when For example, if I had N points and chose 1 of those points as a query point, the normalization should be 1/(N-1) - which would be correct if we swapped the two as you propose (as there are N-1 pairs of unique distance calculations). However, there are many other examples where this is not correct: e.g. chose 2 points as query points - or 1 query point from the set of points and 1 query point from outside that set. In these cases, neither ordering is correct as the computation of To reiterate - in these cases, freud users should not use finite size normalization and should instead apply the appropriate correction factor Some users may be relying on the current behavior of finite size normalization and renormalizing by I think the documentation already makes this behavior clear by stating:
If you think the documentation can be improved in this regard, feel free to make a pull request. |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I am opening this as a discussion rather than an issue because I'm not sure how to create a reproducer for this, but I was reading the RDF code to explain something to someone, and I noticed that the query points and points might be used backward here:
freud/cpp/density/RDF.cc
Lines 60 to 69 in 8353049
In an RDF calculation, I would typically expect the number density to be computed as that of an ideal gas of potential neighbor points (which I think should be the
np
points), then the average would be taken over all origins (which I think are thenqp
query points). Apologies in advance if I am confusing the meaning of points and query points here!If points and query points are reversed in the normalization, I don't think they would actually cause an error in typical use cases because
np
andnumber_density
are multiplied together, so it doesn't really matter which one is divided by volume. The reversal could be a problem for the finite-size renormalization, which I think should be using(np-1)/np
, instead of(nqp-1)/nqp
, but this option is usually only when points and query points are the same anyway.Just wanted to bring it to y'all's intention to have a look at. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions