class hplattice.MCSampler.MCSampler(lattice_factory, config)[source]

MCSampler objects are used to run replica exchange monte carlo simulations of an HP chain. The HP chain is defined in a configuration file, specified by the config parameter. The configuration file also specifies the replica exchange parameters, such as the temperature of each replica.

  • lattice_factory (hplattice.LatticeFactory) – factory object that knows how to create replicas and trajectories.
  • config (str) – path to configuration file
do_mc_sampling(save_trajectory=False, trajectory_filename='traj.xyz')[source]

Run replica exchange monte carlo of the HP chain.

  • save_trajectory (bool) – Generate xyz coordinate trajectories when True. There will be separate trajectory for each replica.
  • trajectory_filename (str) – optional, save trajectory to this path. Replica numbers will be prepended to the name specified here.