get_number_of_cell_repeats

torch_sim.transforms.get_number_of_cell_repeats(cutoff, cell, pbc)[source]
Determine the number of cell repeats required for a given

cutoff distance.

This function calculates how many times the unit cell needs to be repeated in each dimension to ensure that all interactions within the specified cutoff distance are accounted for, considering periodic boundary conditions (PBC).

Parameters:
  • cutoff (float) – The cutoff distance for interactions.

  • cell (Tensor) – A tensor of shape (n_cells, 3, 3) representing the unit cell matrices.

  • pbc (Tensor) – A tensor of shape (n_cells, 3) indicating whether periodic boundary conditions are applied in each dimension.

Returns:

A tensor of shape (n_cells, 3)

containing the number of repeats for each dimension, where non-PBC dimensions are set to zero.

Return type:

Tensor