unwrap_positions

torch_sim.transforms.unwrap_positions(positions, cells, system_idx)[source]

Vectorized unwrapping for multiple systems without explicit loops.

Parameters:
  • positions ((T, N_tot, 3)) – Wrapped cartesian positions for all systems concatenated.

  • cells ((n_systems, 3, 3) or (T, n_systems, 3, 3)) – Box matrices, constant or time-dependent.

  • system_idx ((N_tot,)) – For each atom, which system it belongs to (0..n_systems-1).

  • Returns

  • -------

  • unwrapped_pos ((T, N_tot, 3)) – Unwrapped cartesian positions.

Return type:

Tensor