mindchemistry.e3.o3.TensorSquare

View Source On Gitee
class mindchemistry.e3.o3.TensorSquare(irreps_in, irreps_out=None, filter_ir_out=None, ncon_dtype=float32, **kwargs)[source]

Compute the square tensor product of a tensor.

Equivalent to TensorProduct with irreps_in2=None and instructions='full' or 'connect'. For details, see mindchemistry.e3.o3.TensorProduct.

If irreps_out is given, this operation is fully connected. If irreps_out is not given, the operation has no parameter and is like full tensor product.

Parameters
  • irreps_in (Union[str, Irrep, Irreps]) – Irreps for the input.

  • irreps_out (Union[str, Irrep, Irreps, None]) – Irreps for the output. Default: None.

  • filter_ir_out (Union[str, Irrep, Irreps, None]) – Filter to select only specific Irrep of the output. Default: None.

  • irrep_norm (str) – {'component', 'norm'}, the assumed normalization of the input and output representations. Default: 'component'.

  • path_norm (str) – {'element', 'path'}, the normalization method of path weights. Default: 'element'.

  • weight_init (str) – {'zeros', 'ones', 'truncatedNormal', 'normal', 'uniform', 'he_uniform', 'he_normal', 'xavier_uniform'}, the initial method of weights. Default: 'normal'.

  • ncon_dtype (mindspore.dtype) – The type of input tensors of ncon computation module. Default: mindspore.float32 .

Raises

ValueError – If both irreps_out and filter_ir_out are not None.

Supported Platforms:

Ascend

Examples

>>> from mindchemistry.e3.o3 import TensorSquare
>>> TensorSquare('2x1o', irreps_out='5x2e+4x1e+7x1o')
TensorProduct [connect] (2x1o x 2x1o -> 5x2e+4x1e)
>>> TensorSquare('2x1o+3x0e', filter_ir_out='5x2o+4x1e+2x0e')
TensorProduct [full] (2x1o+3x0e x 2x1o+3x0e -> 4x0e+9x0e+4x1e)