New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hexatic normalization in docs doesn't match implementation #655
Comments
We should also clarify two things:
See this user forum post for details: https://groups.google.com/g/freud-users/c/tw_UAIeKD-Y/m/qlUTbZW9AgAJ |
Agree, we should probably add documentation indicating that the recommended usage is |
@glotzerlab/freud-developers In email correspondence, @Plastikschuessel noted that the literature seems to favor the |
"Clear precedent" seems like a bit of a jump from "seems to favor"... could we document some of the relevant literature on this thread before making such a decision? I would also be curious if @joaander has any opinions since he's made extensive use of (and I believe he wrote) the feature. |
Some literature / evidence for 1/n:
|
Yes, I agree on the Steinhardt front. 1/n is the normalization that I'm most familiar with as well, I just want to make sure we can keep track of why we make these decisions in the event that we find issues with them later. But that seems fine to me then! |
I have implemented this change in #657. I have a related question below: The Hexatic order parameter is implemented in |
Per https://aip.scitation.org/doi/10.1063/1.4774084, the closest approximation to the weighted morphometric neighborhood is to use Is |
@joaander Yes, that is the implementation. Our C++ code lacks docstrings, and the Python docstring for the Translational order parameter is missing its formula definition. Good catch. I will add that in #657. If you happen to know of a paper that has used the Translational order parameter, it would be helpful to cite a specific reference for it. It's a "vestigial" feature whose origin is unknown, but we've kept it because it seemed moderately useful. |
@bdice What is the formula that |
@joaander Here's what I put in #657. Lines 397 to 407 in 72d1b9e
|
In the past when I've looked I've found various (pretty specific) definitions of a translational order parameter in the literature, but I don't recall finding anything that matched this definition. IIRC this is something either Michael or Wenbo wrote, and I have no idea if there is a canonical source for this. |
I'm not aware of any works using that order parameter. How should it be used? |
I have absolutely no idea. Based on when the method was first created and who created it, my best guess is that it's something Wenbo and Michael developed at some stage of analyzing the data that led to Wenbo's 2D symmetry paper, but I don't recall it actually being used in that paper so I can't say for sure. |
I see two use cases for |
So option (1) is average bond length per particle, which can be trivially calculated from a neighborlist with distances, while option (2) gives you something like an average bond direction. I guess the former could be useful, not really sure about the latter, but I'm not really sure either of them merit a separate method. I think they can both be computed in <5 lines of Python and it wouldn't even be slow. During earlier rounds of freud cleanup (around version 0.8 or so) I considered whether to remove this feature along with things like the kspace module, but I left it in place since I wasn't sure what it did and didn't want to remove features credited to particular developers without being sure how useful they might be. Maybe it's time to revisit that decision? |
I support deprecation in 2.4 and removal in 3.0. Then we could simplify the joint HexaticTranslational implementation to be “only Hexatic.” Let’s use #659 to continue this conversation since it is unrelated to the original issue. |
@Plastikschuessel noted that the documentation for the Hexatic order parameter doesn't match the implementation. The docs say that the formula normalizes by
1/n
, but the implemented code normalizes by1/k
. In many systems (particularly hexagonal and square crystals),k=n
, but in some cases (e.g. 2D quasicrystals), the order is 12-fold even though any given particle has fewer than 12 neighbors.freud/freud/order.pyx
Lines 250 to 251 in 3f44951
freud/cpp/order/HexaticTranslational.cc
Lines 38 to 45 in 3f44951
A temporary workaround to achieve the desired behavior is to enabled
weighted=True
in the constructor. In ball queries and nearest neighbor queries (but not Voronoi queries), the weight for each bond defaults to 1. Ifweighted=True
, the normalization will divide by the number of neighbor bonds (a sum with 1 for each bond).To resolve this issue, we should verify the literature to see which convention is more common and consider changing to normalization by
1/n
instead of1/k
.The text was updated successfully, but these errors were encountered: