SasView / sasmodels

Package for calculation of small angle scattering models using OpenCL.
BSD 3-Clause "New" or "Revised" License
15 stars 27 forks source link

Bugfix in Magnetic SLD calculation and update of magnetic scattering documentation #492

Closed dehoni closed 2 years ago

dehoni commented 2 years ago

The calculation of the magnetic scattering length density has a bug. In principle, the magnetic scattering length assumes positive magnetisation. This is fine for collinear structures, but might run into issue for some non-symmetric cases. The documentation how magnetic SLD is calculated in SASview is also updated to reflect the changes. The calculation in Sasview is not really in a cook book style covered in the current literature. Magnetic scattering usually is only expressed in terms of intensities, not really considering the scattering length a polarized neutron will observe.

dehoni commented 2 years ago

As Raffaele Pellicelli pointed out: Instead of referring to the scattering vector to calculate the orthogonal set of vectors, a better choice would be an agnostic coordinate system with the polarisation p_hat = [sin_spin cos_phi, sin_spin sin_phi, cos_spin ], and the two transversal vectors [-sin_phi, cos_phi, 0 ] and [-cos_spin cos_phi, -cos_spin sin_phi, sin_spin ]. This would avoid to obtain a divergencies for qhat x phat / | qhat x phat | = 0/0 if qhat and phat are parallel. The normalization of perpz could also create problems since P*q = 1 and so perpz -> 0/0.