xnn.gnn.models.dimenet.directed_triplets#
- xnn.gnn.models.dimenet.directed_triplets(edge_index, edge_vec, num_nodes)[source]#
Enumerate the message pairs
(k -> j, j -> i)of directional message passing.For every directed edge
j -> i(the messagem_ji) all edgesk -> jarriving at its source are listed, except the reverse of the edge itself (k = iin a molecule; in a periodic system only the same image ofi, found by the exact antisymmetry of the two edge vectors, so other images oficount as neighborsk). Vectorized: the edges are grouped by their destination node and every edgej -> iis paired with the whole group ofj.- Parameters:
edge_index (Tensor) – Edge index of shape
(2, E); row 0 is the sourcejand row 1 the destinationiof each edge.edge_vec (Tensor) – Edge vectors
x_i - x_j(cell shifts included), shape(E, 3).num_nodes (int) – Number of atoms.
- Returns:
(kj, ji), long tensors of shape(T,)indexing the edge dimension:kj[t]is the edgek -> jwhose message feeds the update of the edgeji[t](j -> i). Empty when there is no triplet. TorchScript-compatible.- Return type:
tuple of Tensor