-
Notifications
You must be signed in to change notification settings - Fork 50
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
Discrepancy between structure factors #1306
Comments
Have you tried using StaticStructureFactorDebye? |
This is the result for all three methods. As you can see between 1 and 2 there is a maximum in both my code and Debye. That maximum is also observed in the given reference, but Direct does not show that maximum. For this figure I have used num_sampled_k_points=10000, but there doesn't seem to be any change from the default value. |
Can you confirm that all the particles are inside the box? You can always wrap them for good measure. Could you also share the full code you use to run the example, including extraction of box parameters, and coordinates from the file? With that I could try and take a closer look as well. |
Thanks for the suggestion. It seems that the particles are wrapped correctly Attached is the python script I am using for this comparison. The framework I am using to calculate S(q) here is attached above. If you need anything else from me, please let me know |
Yes, that the system that I am studing You can find this behaviour for particles interacting via SALR potential, like in this reference: https://pubs.rsc.org/en/content/articlehtml/2021/sm/d1sm00445j |
I don't have time to try recreating your plots. But I would like to point out that a 1D averaged structure factor throws away a LOT of information from the full 3D S( Nominally, freud/freud/diffraction/StaticStructureFactorDirect.cc Lines 201 to 299 in 6be399c
It is unfortunate that Note that:
Could you please provide a complete minimum working example that loads your data and plots the result so that we do not need to spend our time recreating it. @DomFijan - the S(K) computation code and binning is so simple it is hard to imagine something going wrong there. If I had to guess, I would say the bug might be in the complex |
Re I used @joema10 script to test if turning off parallelization would show different results, but that doesn't seem to change results at all. I also played with number of bins and it seems that the brute force approach is very susceptible to bin width in this range as well (23 bins originally vs 48 bins plotted here). One last thing I want to try is to plot the diffraction pattern. My thinking was that diffraction pattern is based on discrete FT and shouldn't suffer from any of the sampling shenanigans. I used a view orientation similar to what @janbridley posted and rotated the camera accordingly. One thing that I'm not 100% certain about is what correct orientation to pass to freud's compute - it seems that viewport API in ovito was changed recently and now does not provide viewMatrix, but rather only view orientation so I'm not 100% sure if did the rotation right. I'm not 100% sure if there is a peak at around k=1.25 or not, might have to play with this more. I will try to implement the triple loop approach for |
I am using freud to calculate the structure factor from a trajectory computed with LAMMPS. I am trying to reproduce the results for the structure factor in figure 4 of this article: https://pubs.rsc.org/en/content/articlehtml/2021/sm/d1sm00445j
This is schematically my code using freud:
Everything works fine for most of the cases (e.g. rho=0.155, 0.252 and T=0.3), but for rho=0.407 and T=0.3 I don't get the same result. In this case the g(r) is similar, but S(k) is totally different using freud (see below)
I have made my own code (very inefficient) and calculating S(k) sampling randomly values of \vec{k} gives similar results compare to the reported S(k). Also, using ovito I have calculated S(k) and it seems to come out similar as well. I don't know if this particular case is difficult because of some of the assumptions freud makes internally and I just haven't found the right set of parameters or if something is wrong
Please find attached screenshots of ovito, the comparison between my code and freud, as well as one of the frames of the simulation I am analysing
Any help is welcome
I am using jupyter-notebook in Ubuntu 18.04.6 LTS with:
Frame_last.txt
The text was updated successfully, but these errors were encountered: