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 (
torch.Tensor) – Tensor of shape [n_swaps, 2] containing pairs of indices to swapn_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: