-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/form factors #92
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
Conversation
…polygon calculation.
@DomFijan I'd be curious to get your thoughts on these calculations. The content of this PR is a means for evaluating the form factor amplitudes for a few shapes (spheres, polygons, and polyhedra). The sphere calculation is very straightforward, but the polyhedron calculation (and by extension, the polygon calculation it uses) were original contributions from one of our old grad students @eirrgang. The code has been shuffled around to various different parts of the glotzerlab code base as we've more clearly delineated the scope and goals for different packages over time. This package focuses on shapes, so it seemed like the best place to retain a reference version of this calculation. Of course, it's not particularly practical; the implementation here is the amplitude for just a single shape, whereas a realistic form factor calculation would need to accumulate over many particles and then take the complex norm to get the observable intensity. Since that's out of scope for this package, I wanted to maintain this code here as a reference implementation in case we eventually want to implement this directly in something like glotzerlab/freud#660. Having said all that, your perspective on the utility of the code in this form and what might be useful to provide would be helpful. @bdice you don't really need to review this, I'm just tagging you here so you're aware of it since this is relevant to your ongoing structure factor work and you originally copied this code into coxeter. Review if you'd like, but don't waste your time if you're busy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments but looks good overall! Thanks for porting this code over.
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
@vyasr FYI looks like there was an unexpected test failure here: https://app.circleci.com/pipelines/github/glotzerlab/coxeter/291/workflows/a160cbff-7514-41ff-b36b-6d2e9b9ceced/jobs/929 |
Description
This PR adds the ability to compute the form factor for a shape. The calculation is currently implemented for spheres, polygons, and polyhedra.
Motivation and Context
The code in ft.py is important to maintain in some form since it represents a relatively unique contribution and may be of future use for purposes of high fidelity diffraction calculations for anisotropic shapes. However, the code quality, style, and correctness could benefit from bringing into the fold of the newer object-base shape API.
Types of Changes
1The change breaks (or has the potential to break) existing functionality.
Checklist: