mindscience.e3nn.o3.Irrep

class mindscience.e3nn.o3.Irrep(l, p=None)[source]

Irreducible representation of O(3). This class does not contain any data, it is a structure that describe the representation. It is typically used as argument of other classes of the library to define the input and output representations of functions. The irrep is labeled by a non-negative integer l (the degree) and a parity p (1 for even, -1 for odd). Common aliases: "e" for even parity, "o" for odd parity, "y" for parity (-1)^l.

Parameters
  • l (Union[int, str]) – non-negative integer, the degree of the representation, \(l = 0, 1, \dots\). Alternatively, a string such as "1o" or "2e" encoding both degree and parity.

  • p (int, optional) – the parity of the representation, \(p \in \{1, -1\}\). Ignored when l is a string. Default: None.

Raises

Examples

>>> from mindscience.e3nn.o3 import Irrep
>>> Irrep(0, 1)
0e
>>> Irrep("1y")
1o
>>> Irrep("2o").dim
5
>>> Irrep("2e") in Irrep("1o") * Irrep("1o")
True
>>> Irrep("1o") + Irrep("2o")
1x1o+1x2o
is_scalar()[source]

Check whether this irrep is the trivial (scalar) representation.

Returns

bool, True if l = 0 and parity p = 1, False otherwise.

wigD_from_angles(alpha, beta, gamma, k=None)[source]

Compute the Wigner-D matrix representation of O(3) from the three Euler angles \((\alpha, \beta, \gamma)\) that describe the rotation sequence:

  1. Rotate by \(\gamma\) around the original Y axis.

  2. Rotate by \(\beta\) around the new X axis.

  3. Rotate by \(\alpha\) around the newest Y axis.

Parameters
  • alpha (Union[Tensor[float32], list[float], tuple[float], ndarray[np.float32], float]) – Rotation \(\alpha\) around Y axis, applied third.

  • beta (Union[Tensor[float32], list[float], tuple[float], ndarray[np.float32], float]) – Rotation \(\beta\) around X axis, applied second.

  • gamma (Union[Tensor[float32], list[float], tuple[float], ndarray[np.float32], float]) – Rotation \(\gamma\) around Y axis, applied first.

  • k (Union[None, Tensor[float32], list[float], tuple[float], ndarray[np.float32], float], optional) – How many times the parity is applied. Default: None .

Returns

Tensor, representation wigner D matrix of O(3). The shape of Tensor is \((..., 2l+1, 2l+1)\) .

Examples

>>> m = Irrep(1, -1).wigD_from_angles(0, 0 ,0, 1)
>>> print(m)
[[-1,  0,  0],
[ 0, -1,  0],
[ 0,  0, -1]]
wigD_from_matrix(R)[source]

Compute the Wigner-D matrix representation of O(3) from rotation matrices.

Parameters

R (Tensor) – Rotation matrices. The shape of Tensor is \((..., 3, 3)\).

Returns

Tensor, representation wigner D matrix of O(3). The shape of Tensor is \((..., 2l+1, 2l+1)\).

Raises

TypeError – If R is not a Tensor.

Examples

>>> from mindspore import ops
>>> m = Irrep(1, -1).wigD_from_matrix(-ops.eye(3))
>>> print(m)
[[-1,  0,  0],
[ 0, -1,  0],
[ 0,  0, -1]]