Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement other SO(3) sampling options for initial orientations #123

Open
adigitoleo opened this issue Jul 27, 2023 · 4 comments
Open

Implement other SO(3) sampling options for initial orientations #123

adigitoleo opened this issue Jul 27, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@adigitoleo
Copy link
Member

adigitoleo commented Jul 27, 2023

The current isotropic initial condition uses scipy.spatial.transform.Rotation.random which seems to be constructed by sampling normal distributions in quaternion space (scipy Rotations are implemented in Cython in terms of quaternions). This does not take into account crystallite symmetry and may not produce an appropriately dispersed sampling in SO(3). The Matlab DRex code uses pseudorandom Halton sequences instead. There are other more sophisticated options like using a Bingham distribution which is axial (-x = x) or UARS distributions which are specifically designed for crystal orientations.

@adigitoleo adigitoleo added the enhancement New feature or request label Aug 8, 2023
@adigitoleo
Copy link
Member Author

The Hopf fibration method discussed in #113 could also be used for the initial condition actually. All of these options could help reduce the required amount of grains by producing a sufficiently dispersed initial sampling that is more isotropic than the same sampling produced using normal distributions.

@drhodrid
Copy link
Collaborator

drhodrid commented Dec 1, 2023 via email

@Patol75
Copy link
Member

Patol75 commented Dec 2, 2023

How difficult is it to implement? The required number of grains is quite a central point of the manuscript; it would be good to know if that method affects things much.

@adigitoleo
Copy link
Member Author

adigitoleo commented Feb 28, 2024

The original UARS paper linked above is not easy for me to parse, I find that the follow-up work in Bingham 2015 contains a more brief overview. As far as I can tell, Prof. Melissa Bingham is not related to Christopher Bingham but they are both statisticians working in the same domain -- what are the chances!

An UARS sample $\mathbf{O} ∈ SO(3)$ for the distribution centered at the orientation $\mathbf{S} ∈ SO(3)$ is defined as $\mathbf{O}=\mathbf{S}\mathbf{P}$ where $\mathbf{P} ∈ SO(3)$

$$\mathbf{P}=\mathbf{u}\mathbf{u}^⊺ + (\mathbf{I} - \mathbf{u}\mathbf{u}^⊺) \cos r + \begin{bmatrix}0 & -u_3 & u_2 \cr u_3 & 0 & -u_1 \cr -u_2 & u_1 & 0\end{bmatrix} \sin r$$

where $\mathbf{I}$ is the 3x3 identity matrix and $r ∈ (-π,π]$. The axis $\mathbf{u} ∈ ℝ^3$ is “uniformly distributed on the unit sphere” and the angle $r$ is taken from some circular distribution $C(r|κ)$ (which is what really controls the shape of the distribution).

In practice, we need to:

  1. implement “uniform” sampling on a unit sphere to get $\mathbf{u}$
  2. choose some $C(r|k)$ (two examples given in Bingham 2015)
  3. implement sampling from the chosen $C(r|k)$
  4. document how to use this to generate some common experimental/natural sample grain orientation distributions

For 1. they don't clarify what is meant by “uniform” which is not obvious for a sphere, but we can perhaps start with geometry.shirley_concentric_squaredisk and add a z-value. A nicer implementation would again provide a choice of distributions and the ability to generate consecutive samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants