get_distance_matrix#

Misorientation.get_distance_matrix(chunk_size: int = 20, progressbar: bool = True, degrees: bool = False, *, lazy: bool = True) ndarray[source]#

Return the symmetry reduced smallest angle of rotation transforming every misorientation in this instance to every other misorientation [Johnstone et al., 2020].

Parameters:
chunk_size

Number of misorientations per axis to include in each iteration of the computation. Default is 20. Increasing this might reduce the computation time at the cost of increased memory use. Only used if lazy is True.

progressbar

Whether to show a progressbar during computation. Default is True. Only used if lazy is True.

degrees

If True, the angles are returned in degrees. Default is False.

lazy

Whether to compute with Dask. Default is True. Setting False should be both faster and use less memory.

False will be the default in the future.

Returns:
angles

Misorientation angles in radians (degrees is False) or degrees (degrees is True).

Notes

Given two misorientations \(M_i\) and \(M_j\) with the same two symmetry groups, the smallest angle is considered as the geodesic distance

\[d(M_i, M_j) = \arccos(2(M_i \cdot M_j)^2 - 1),\]

where \((M_i \cdot M_j)\) is the highest dot product between symmetrically equivalent misorientations to \(M_{i,j}\), given by

\[\max_{s_k \in S_k} s_k M_i s_l s_k M_j^{-1} s_l,\]

where \(s_k \in S_k\) and \(s_l \in S_l\), with \(S_k\) and \(S_l\) being the two symmetry groups.

Examples

>>> from orix.quaternion import Misorientation, symmetry
>>> mori = Misorientation.from_axes_angles([1, 0, 0], [0, 90], degrees=True)
>>> mori.symmetry = (symmetry.D6, symmetry.D6)
>>> mori.get_distance_matrix(progressbar=False, degrees=True)
array([[ 0., 90.],
       [90.,  0.]])