omnisolver.pt.algorithm#
Module Contents#
Functions#
|
Perform given number of Monte Carlo sweeps for each replica. |
|
Determine if given replicas should exchange their states. |
|
Exchange state and energies of two replicas. |
- omnisolver.pt.algorithm.perform_monte_carlo_sweeps(replicas: numba.typed.List[omnisolver.pt.replica.Replica], num_sweeps) None#
Perform given number of Monte Carlo sweeps for each replica.
The operation is parallelized over replicas.
- Parameters:
replicas – replicas for which to perform sweeps. The caller should make sure that replicas don’t share common data (e.g. their states don’t point to the same place in memory.
num_sweeps – number of sweeps to perform.
- omnisolver.pt.algorithm.should_exchange_states(replica_1: omnisolver.pt.replica.Replica, replica_2: omnisolver.pt.replica.Replica) bool#
Determine if given replicas should exchange their states.
The probability of exchanging states depends on current energy and temperatures of replicas. in particular, colder replica should always exchange state with hotter replica if its energy is lower.
- omnisolver.pt.algorithm.exchange_states(replica_1, replica_2)#
Exchange state and energies of two replicas.
This function exchanges current states and energies between replicas. All other properties of replicas stay the same. In particular, best energies and best states found so far by each replica remain unchanged. Temperatures (beta) also remain unchanged. This is important for the implementation of PTSampler.