Refactoring #1407

rotate the sample, not Q

Added by wuttke almost 5 years ago. Updated 4 months ago.

Status:RejectedStart date:
Priority:LowDue date:
Assignee:-% Done:


Target version:-


Currently, rotation of particles is emulated by rotating Q. In the future, keep Q=ki-kf invariant, and apply rotations to sample components.


Rotating Q instead of the sample was never more than a workaround. It may have helped to achieve some optimization with minimal coding. But it clearly does not reflect the given geometry, and is now becoming constringing.

In the future, we will have different sample components rotated relative to each other. It will be much more natural to model this by rotation of sample components, than by rotating Q.

In the past, keeping particles unrotated appeared advantageous because form factors were given in terms of x,y,z coordinates. This has completely changed with the reimplementation of the polyhedral form factors, which is based on coordinate-free algebra, with vertex coordinates only appearing in the constructor. This makes particle rotation very easy and fast: Just rotate the vertices in the constructor. Nothing has to change in evaluate_for_q(). Much more efficient than rotating every single Q.


#1 Updated by wuttke almost 5 years ago

  • Parent task set to #1406

#2 Updated by wuttke over 4 years ago

  • Status changed from New to Long Term Idea

#3 Updated by wuttke about 4 years ago

  • Status changed from Long Term Idea to Rejected

Not worth a separate refactoring, but will be done when implementing graded layers, as explained in design proposal.

#4 Updated by wuttke 4 months ago

  • Parent task deleted (#1406)

Also available in: Atom PDF