mindchemistry.e3.o3.Irrep

View Source On Gitee
class mindchemistry.e3.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.

Parameters
  • l (Union[int, str]) – non-negative integer, the degree of the representation, \(l = 0, 1, \dots\). Or string to indicate the degree and parity.

  • p (int) – {1, -1}, the parity of the representation. Default: None.

Raises
Supported Platforms:

Ascend

Examples

>>> from mindchemistry.e3.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
wigD_from_angles(alpha, beta, gamma, k=None)[source]

Representation wigner D matrices of O(3) from Euler angles.

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]) – 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]

Representation wigner D matrices 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]]