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_mc_init and swap_mc_step functions can be used with integrate but if a trajectory is being reported, the TorchSimTrajectory.write_state method must be called with variable_masses=True.
Examples
>>> import torch_sim as ts
>>> mc_state = ts.swap_mc_init(model, initial_state, seed=42)
>>> for _ in range(1000):
... mc_state = ts.swap_mc_step(model, mc_state, kT=0.1 * units.energy)
Functions
Generate atom swaps for a given batched system. |
|
Apply the Metropolis acceptance criterion for Monte Carlo moves. |
|
Initialize a swap Monte Carlo state from input data. |
|
Perform a single swap Monte Carlo step. |
|
Convert atom swap pairs to a full permutation tensor. |
Classes
State for Monte Carlo simulations with swap moves. |