mindchemistry.e3.o3.SphericalHarmonics

View Source On Gitee
class mindchemistry.e3.o3.SphericalHarmonics(irreps_out, normalize, normalization='integral', irreps_in=None, dtype=float32)[source]

Return Spherical harmonics layer.

Parameters
  • irreps_out (Union[str, Irreps]) – irreducible representations of output for spherical harmonics.

  • normalize (bool) – whether to normalize the input Tensor to unit vectors that lie on the sphere before projecting onto the spherical harmonics.

  • normalization (str) – {'integral', 'component', 'norm'}, normalization method of the output tensors. Default: 'integral'.

  • irreps_in (Union[str, Irreps, None]) – irreducible representations of input for spherical harmonics. Default: None.

  • dtype (mindspore.dtype) – The type of input tensor. Default: mindspore.float32 .

Inputs:
  • x (Tensor) - Tensor for construct spherical harmonics. The shape of Tensor is \((..., 3)\).

Outputs:
  • output (Tensor) - the spherical harmonics \(Y^l(x)\). The shape of Tensor is \((..., 2l+1)\).

Raises
  • ValueError – If normalization is not in {'integral', 'component', 'norm'}.

  • ValueError – If irreps_in for SphericalHarmonics is not neither a vector (1x1o) nor a pseudovector (1x1e).

  • ValueError – If the l and p of irreps_out are not consistent with irreps_in for spherical harmonics. The output parity should have been p = {input_p**l}.

  • NotImplementedError – If l is larger than 11.

Supported Platforms:

Ascend

Examples

>>> from mindchemistry.e3.o3 import SphericalHarmonics
>>> from mindspore import ops
>>> sh = SphericalHarmonics(0, False, normalization='component')
>>> x = ops.rand(2,3)
>>> m = sh(x)
[[1.]
[1.]]