generate_swaps¶
- torch_sim.monte_carlo.generate_swaps(state, rng=None)[source]¶
Generate atom swaps for a given batched system.
Generates proposed swaps between atoms of different types within the same system. The function ensures that swaps only occur between atoms with different atomic numbers.
- Parameters:
state (
SimState) – The simulation staterng (
torch.Generator | None, optional) – Random number generator for reproducibility. Defaults to None.
- Returns:
- A tensor of proposed swaps with shape [n_systems, 2],
where each row contains indices of atoms to be swapped
- Return type: