validate_permutation

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

Validate that permutations only swap atoms within the same batch.

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

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

  • batch (Tensor) – Batch assignments for each atom of shape [n_atoms]

Raises:

ValueError – If any swaps are between atoms in different batches

Return type:

None