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 is related to box shape #1

Open
zhangyemayapro opened this issue Mar 27, 2023 · 4 comments
Open

Diffraction pattern is related to box shape #1

zhangyemayapro opened this issue Mar 27, 2023 · 4 comments

Comments

@zhangyemayapro
Copy link

I'm dealing with a system composed of particles comfined in a circle and particles have arranged themselves into a triangular lattice. But I find that, the diffraction pattern is related to the box. Shouldn't the diffraction pattern independent of box?

from matplotlib import pyplot as plt
import numpy as np
import freud
uc = freud.data.UnitCell.hex()
n_repeats = (20, 20,1)
system = uc.generate_system(n_repeats)
position=system[1]
position=position[np.linalg.norm(position,axis=1)<10]
box=np.array([20., 40.,  0.,  0.,  0.,  0.], dtype="float32")
system=(box,position)

sf=freud.diffraction.DiffractionPattern(grid_size=512)
sf.compute(system,peak_width=1)

image
image

@fill-10
Copy link

fill-10 commented Mar 27, 2023

It could be the periodic boundary condition.

@zhangyemayapro
Copy link
Author

When I choose bigger box, the box still affects the symmetry.

box=np.array([40., 80.,  0.,  0.,  0.,  0.], dtype="float32")

How can I set non-period boundary?

Thanks for your help~

@fill-10
Copy link

fill-10 commented Mar 28, 2023

My guess: Lazy solution: use a smaller box, discard the particles outside and make sure that there is no vacuum space in your box. You will lose some resolution at small kx or ky. Permanent solution: write your own code/wait for the owner of this repo.

@zhangyemayapro
Copy link
Author

Thanks for your help~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants