nvalchemi.dynamics.hooks.total_momentum#

nvalchemi.dynamics.hooks.total_momentum(batch)[source]#

Return the total linear momentum of each graph.

Parameters:

batch (Batch) – Batch carrying velocities and atomic_masses.

Returns:

Mass-weighted velocity sum per graph, in the batch’s own units.

Return type:

Float[torch.Tensor, “G 3”]

Examples

>>> from nvalchemi.dynamics.hooks import total_momentum
>>> total_momentum(batch).shape
torch.Size([2, 3])