mindscience.e3nn.o3.rand_angles

mindscience.e3nn.o3.rand_angles(*shape)[source]

Return a uniformly-random set of Euler angles \((\alpha, \beta, \gamma)\) that represents a random rotation in 3-D space. \(\alpha\) and \(\gamma\) are sampled uniformly from [0, 2π), while \(\beta\) is sampled from [0, π] with probability density proportional to sin(\(\beta\)), ensuring uniform distribution over the rotation group SO(3).

Parameters

shape (tuple[int]) – The shape of additional dimensions.

Returns

tuple[Tensor]. A tuple of \(alpha\) Tensors, each of shape shape.

Raises
  • TypeError – If dtype of 'shape' is not tuple.

  • TypeError – If dtype of the element of 'shape' is not int.

Examples

>>> from mindscience.e3nn.o3 import rand_angles
>>> m = rand_angles((1))
>>> print(m)
(Tensor(shape=[1], dtype=Float32, value= [ 4.00494671e+00]), Tensor(shape=[1], dtype=Float32,
value= [ 1.29240000e+00]), Tensor(shape=[1], dtype=Float32, value= [ 5.71690750e+00]))