Add de la Vallée Poussin kernel on SO(3)#926
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #926 +/- ##
==========================================
+ Coverage 72.61% 73.18% +0.57%
==========================================
Files 142 145 +3
Lines 21941 22640 +699
==========================================
+ Hits 15933 16570 +637
- Misses 6008 6070 +62 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
To do:
|
Implements the radially symmetric kernel K(ω) = C · cos(ω/2)^(2κ) with normalization constant C = B(3/2, 1/2) / B(3/2, κ + 1/2) and shape parameter κ derived analytically from the half-width. - Abstract SO3Kernel base class for rotation group kernels - Concrete DeLaValleePoussinKernel with eval, eval_centered, and misorientation_angle methods Signed-off-by: Brianna Major <brianna.major@kitware.com>
Signed-off-by: Brianna Major <brianna.major@kitware.com>
Signed-off-by: Brianna Major <brianna.major@kitware.com>
Add optional crystal and sample symmetry support to DeLaValleePoussinKernel. When symmetry is provided, delegate misorientation-angle calculation to hexrd.core.rotations.misorientation. Signed-off-by: Brianna Major <brianna.major@kitware.com>
- Update misorientation_angle docstring - Use VslueError for symmetry validation failures - Update return annotations for scalar-or-batched kernel operations - Add tests covering the symmetry error behavior. Signed-off-by: Brianna Major <brianna.major@kitware.com>
fd1dc01 to
91e615d
Compare
Signed-off-by: Brianna Major <brianna.major@kitware.com>
Add SO(3) normalization, has_symmetry, and combined crystal+sample symmetry tests; fix a name shadow and make the half-maximum test go through eval(). Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Reduce the symmetry-aware misorientation through a single batched rotations.misorientation call (one reference vs many) instead of a per-pair Python loop (~40x faster on cubic symmetry, identical results). Require one operand to be a single orientation in that path and raise otherwise. Document that symmetry is opt-in. Tests: add SO(3) normalization, has_symmetry, combined crystal+sample, and single-reference-required cases; fix a name shadow and make the half-maximum test go through eval(). Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
psavery
left a comment
There was a problem hiding this comment.
I added a few more tests, and made a small API change to the symmetry-reduced misorientation so it runs much faster - it now uses the pre-existing rotations.misorientation in hexrd for batched, symmetry-aware misorientation instead of a per-pair loop (~40x faster on cubic symmetry). The one behavioral note: with symmetry enabled, one of the two operands must be a single reference orientation (it raises otherwise), which matches how the kernel is actually evaluated.
I'm rebasing #939 and #941 onto these changes, so those don't need fixing on your end. This PR looks good to me!
|
@bnmajor merge when ready! |
Overview
Adds a de la Vallée Poussin kernel implementation on SO(3) for constructing smooth orientation distribution functions.
New modules:
New public API:
Mathematical basis:
The kernel is defined as K(ω) = C · cos(ω/2)^(2κ), where C is a Beta-function normalization constant and κ is derived analytically from the halfwidth via κ = ln(0.5) / (2·ln(cos(h/2))).
Affected Workflows
N/A
Documentation Changes
User-facing documentation for the texture module will be added in the module integration PR once the full API is finalized.