torch_sim.monte_carloΒΆ

Propagators for Monte Carlo simulations.

This module provides functionality for performing Monte Carlo simulations, particularly focused on swap Monte Carlo for atomic systems. It includes implementations of the Metropolis criterion, swap generation, and utility functions for handling permutations in batched systems.

The swap_monte_carlo function can be used with integrate but if a trajectory is being reported, the TorchSimTrajectory.write_state method must be called with variable_masses=True.

Functions

generate_swaps

Generate atom swaps for a given batched system.

metropolis_criterion

Apply the Metropolis acceptance criterion for Monte Carlo moves.

swap_monte_carlo

Initialize a swap Monte Carlo simulation for atomic structure optimization.

swaps_to_permutation

Convert atom swap pairs to a full permutation tensor.

validate_permutation

Validate that permutations only swap atoms within the same batch.

Classes

SwapMCState

State for Monte Carlo simulations with swap moves.