{ } Raw JSON

bundles / scipy 1.17.1 / scipy / spatial / transform / _rotation / Rotation / reduce

function

scipy.spatial.transform._rotation:Rotation.reduce

source: /scipy/spatial/transform/_rotation.py :2055

Signature

def   reduce ( self left : Rotation | None = None right : Rotation | None = None return_indices : bool = False )  →  Rotation | tuple[Rotation, Array, Array]

Summary

Reduce this rotation with the provided rotation groups.

Extended Summary

Reduction of a rotation p is a transformation of the form q = l * p * r, where l and r are chosen from left and right respectively, such that rotation q has the smallest magnitude.

If left and right are rotation groups representing symmetries of two objects rotated by p, then q is the rotation of the smallest magnitude to align these objects considering their symmetries.

Parameters

left : `Rotation` instance, optional

Object containing the left rotation(s). Default value (None) corresponds to the identity rotation.

right : `Rotation` instance, optional

Object containing the right rotation(s). Default value (None) corresponds to the identity rotation.

return_indices : bool, optional

Whether to return the indices of the rotations from left and right used for reduction.

Returns

reduced : `Rotation` instance

Object containing reduced rotations.

: left_best, right_best: integer ndarray

Indices of elements from left and right used for reduction.

Notes

Array API Standard Support

reduce has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.

====================  ====================  ====================
Library               CPU                   GPU
====================  ====================  ====================
NumPy                 ✅                     n/a                 
CuPy                  n/a                   ✅                   
PyTorch               ✅                     ✅                   
JAX                   ✅                     ✅                   
Dask                  ⛔                     n/a                 
====================  ====================  ====================

See dev-arrayapi for more information.

Aliases

  • scipy.spatial.transform.Rotation.reduce