-
Notifications
You must be signed in to change notification settings - Fork 30
Description
A last idea: maybe usage of numba package could help decreasing the calculation time for pure python even more ?
Yes, we could use numba and/or torch for models, but they use the pure python interface. Oriented 2D, magnetism and model reparameterization are only available for C models.
Python models do support polydispersity by looping a parameter like radius over (radius ± Δradius), but we can't do this for orientational dispersion. At the pole (θ=0°) the scattering from φ+Δφ is the same as φ, so ranging over φ±Δφ would have no effect. Instead we first apply dispersion to the shape, rotating the (a, b, c) axes by (Δθ, Δφ, Δψ) [pitch-yaw-roll] then we rotate by (θ, φ, ψ) to set the orientation. We then call Iqabc with the equivalent q vector for the particle in canonical orientation, with the c-axis aligned along the beam. The code for this is in kernel_iq.c for C models, but not yet in kernelpy.py for python models.
Originally posted by @pkienzle in #694 (comment)