compute_instantaneous_pressure_tensor

torch_sim.quantities.compute_instantaneous_pressure_tensor(*, momenta, masses, system_idx, stress, volumes)[source]

Compute forces on the cell for NPT dynamics.

This function calculates the instantaneous internal pressure tensor.

Parameters:
  • momenta (torch.Tensor) – Particle momenta, shape (n_particles, 3)

  • masses (torch.Tensor) – Particle masses, shape (n_particles,)

  • system_idx (torch.Tensor) – Tensor indicating system membership of each particle

  • stress (torch.Tensor) – Stress tensor of the system, shape (n_systems, 3, 3)

  • volumes (torch.Tensor) – Volumes of the systems, shape (n_systems,)

Returns:

Instanteneous internal pressure tesnor [n_systems, 3, 3]

Return type:

Tensor