xnn.gnn.models.blocks.tp_path_exists#

xnn.gnn.models.blocks.tp_path_exists(irreps_in1, irreps_in2, ir_out)[source]#

Whether some tensor-product path irreps_in1 x irreps_in2 -> ir_out exists.

Behaves like nequip.utils.tp_utils.tp_path_exists (independent implementation): used to prune hidden irreps that no tensor-product path can populate (e.g. 0o features in the first NequIP layer, where the node features are still all 0e).

Parameters:
  • irreps_in1 (e3nn.o3.Irreps) – The two tensor-product operand irreps.

  • irreps_in2 (e3nn.o3.Irreps) – The two tensor-product operand irreps.

  • ir_out (e3nn.o3.Irrep or str) – The candidate output irrep.

Returns:

True if any pair of input irreps couples to ir_out.

Return type:

bool