Skip to content

Add de la Vallée Poussin kernel on SO(3)#926

Open
bnmajor wants to merge 7 commits into
masterfrom
texture-DeLaValleePoussinKernel
Open

Add de la Vallée Poussin kernel on SO(3)#926
bnmajor wants to merge 7 commits into
masterfrom
texture-DeLaValleePoussinKernel

Conversation

@bnmajor
Copy link
Copy Markdown
Collaborator

@bnmajor bnmajor commented Apr 22, 2026

Overview

Adds a de la Vallée Poussin kernel implementation on SO(3) for constructing smooth orientation distribution functions.

New modules:

  • SO3Kernel
  • DeLaValleePoussinKernel

New public API:

  • DeLaValleePoussinKernel(halfwidth: float) - constructor, halfwidth in radians
  • .eval(R1, R2) - evaluate kernel between rotation matrices
  • .eval_centered(R, center) - convenience wrapper for unimodal distributions
  • .misorientation_angle(R1, R2) - compute misorientation angle from 3×3 rotation matrices

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 98.97959% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.73%. Comparing base (7e05098) to head (8c9ec8f).

Files with missing lines Patch % Lines
hexrd/phase_transition/texture/kernels.py 98.95% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #926      +/-   ##
==========================================
+ Coverage   72.61%   72.73%   +0.12%     
==========================================
  Files         142      144       +2     
  Lines       21941    22039      +98     
==========================================
+ Hits        15933    16031      +98     
  Misses       6008     6008              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@psavery
Copy link
Copy Markdown
Collaborator

psavery commented May 6, 2026

To do:

  • move the texture directory inside the phase_transition directory
  • Add a simple test for running the __str__ and __repr__ functions
  • Keep in mind that for misorientation_angle, we may need to take into account crystal symmetry (depending on how it will be used), and misorientation in the rotations.py file may be able to work.

bnmajor added 5 commits June 3, 2026 11:09
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>
@bnmajor bnmajor force-pushed the texture-DeLaValleePoussinKernel branch from fd1dc01 to 91e615d Compare June 3, 2026 15:30
bnmajor added 2 commits June 3, 2026 11:50
Signed-off-by: Brianna Major <brianna.major@kitware.com>
@bnmajor bnmajor mentioned this pull request Jun 3, 2026
@bnmajor bnmajor requested review from psavery and saransh13 June 3, 2026 19:28
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

Successfully merging this pull request may close these issues.

2 participants