Skip to content
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

Diffraction pattern depends on shape of simulation box #750

Open
tcmoore3 opened this issue Apr 20, 2021 · 3 comments · May be fixed by #793
Open

Diffraction pattern depends on shape of simulation box #750

tcmoore3 opened this issue Apr 20, 2021 · 3 comments · May be fixed by #793
Labels
bug Something isn't working diffraction

Comments

@tcmoore3
Copy link
Member

Describe the bug
When calculating a diffraction pattern, I expect the symmetry of the diffraction to reflect that of the particle positions. However, if the box has edges of different lengths, then this is not the case. E.g., if I make a square lattice with different numbers of unit cells in each direction, then I get a diffraction pattern that does not have a 4-fold symmetric rotation axis. See this notebook for an example.

System configuration (please complete the following information):

  • I get this behavior with versions 2.4 and 2.5
@tcmoore3 tcmoore3 added bug Something isn't working diffraction labels Apr 20, 2021
@bdice
Copy link
Member

bdice commented Apr 20, 2021

Thanks for filing this issue — @tcmoore3 I know you’ve been working on this, have you been able to make any progress on fixing the problem?

@tcmoore3
Copy link
Member Author

@bdice I've figured out the origin of this bug in the code, which comes from how the k-vectors are generated, relevant lines here and here. I need help figuring out how to proceed from here, since fixing this requires decisions about what kinds of assumptions/approximations you have to make to do this calculation.

@joaander
Copy link
Member

When I last looked at it with @tcmoore3 I was looking at the coordinate transforms used to map the system from the box to a unit cube on which the FFT is performed. The k-vectors should be spaced at 1/width (or 2pi/width) in this space. There should be an inverse transformation to map the k-vectors back to simulation units that is a function of the shear and scale matrices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working diffraction
Projects
None yet
3 participants