swaps_to_permutation

torch_sim.monte_carlo.swaps_to_permutation(swaps, n_atoms)[source]

Convert atom swap pairs to a full permutation tensor.

Creates a permutation tensor that represents the result of applying the specified swaps to the system.

Parameters:
  • swaps (Tensor) – Tensor of shape [n_swaps, 2] containing pairs of indices to swap

  • n_atoms (int) – Total number of atoms in the system

Returns:

Permutation tensor of shape [n_atoms] where permutation[i]

contains the index of the atom that should be moved to position i

Return type:

Tensor