-
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
Fix k-value/k-vector units for non-cubic systems #793
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #793 +/- ##
=======================================
Coverage 55.57% 55.57%
=======================================
Files 16 16
Lines 2438 2438
Branches 33 33
=======================================
Hits 1355 1355
Misses 1070 1070
Partials 13 13
Continue to review full report at Codecov.
|
This commit includes a rough / hacky change to diffraction.pyx that makes the long z-dimesion test pass by selecting from only the box vectors in the x and y directions. This will likely be changed in the process of making the other new tests pass.
for more information, see https://pre-commit.ci
…rlab/freud into fix/non-cubic-diffraction
for more information, see https://pre-commit.ci
Description
This PR continues work started in #777 and others to ensure Freud's diffraction module computes the correct range of k-values and k-vectors for various
grid_size
,output_size
,zoom
,view_orientation
, and box shapes, and that diffraction peaks are positioned such that their k-vectors satisfy the following relationship for lattice vectors R (from Wikipedia):Previous commits fixed diffraction results for simple cubic systems. Ideally, future commits will ensure that
freud.diffraction.compute()
generates correct k-value, k-vectors and diffraction peaks for:Some of these will likely involve changing how the compute method's
box_matrix_scale_factor
is calculated. It is currently assigned tonp.max(system.box.to_matrix())
, which produces incorrect diffraction patterns in most cases.Motivation and Context
Resolves: #750
How Has This Been Tested?
N/A. Commits to this PR will include unit tests to verify that diffraction results are correct.
Screenshots
Types of changes
Checklist: