batched_vdot

torch_sim.math.batched_vdot(x, y, batch_indices)[source]

Computes batched vdot (sum of element-wise product) for groups of vectors.

Parameters:
  • x (Tensor) – Tensor of shape [N_total_entities, D] (e.g., forces, velocities).

  • y (Tensor) – Tensor of shape [N_total_entities, D].

  • batch_indices (Tensor) – Tensor of shape [N_total_entities] indicating batch membership.

Returns:

shape [n_batches] where each element is the sum(x_i * y_i)

Return type:

Tensor

for entities belonging to that batch,

summed over all components D and all entities in the batch.