validate_permutation

torch_sim.monte_carlo.validate_permutation(permutation, system_idx)[source]

Validate that permutations only swap atoms within the same system.

Confirms that no swaps are attempted between atoms in different systems, which would lead to physically invalid configurations.

Parameters:
  • permutation (Tensor) – Permutation tensor of shape [n_atoms]

  • system_idx (Tensor) – system_idx for each atom of shape [n_atoms]

Raises:

ValueError – If any swaps are between atoms in different systems

Return type:

None