MayerSampling
-
class MayerSampling : public feasst::Criteria
Mayer-sampling Monte Carlo acceptance criteria as described in Singh and Kofke[1]. Extrapolation in temperature is performed as descirbed in Hatch et al.[2]. The coefficients for the Taylor series extrapolation are written to file and include the factorial division.
The RefPotential may need to be carefully adjusted when the tutorials are changed. Typically, the RefPotential is a HardSphere with a given ModelParams::sigma. For example, in <a href=”../tutorial/tutorial_4_cgmab.html”>this tutorial</a>, the size of the HardSphere RefPotential is given by “sigmaCOM=30 cutoffCOM=30”. Too small of a sigma leads to high error bars because the RefPotential will not often be sampled while sampling the Potential. Too large of a sigma means the RefPotential will not be fully sampled while sampling the Potential, and therefore gives incorrect results. A more optimal value of sigma typically results in a mayer_ref() of approximately 0.3 to 0.5.
References:
Public Functions
-
bool is_accepted(const System &system, Acceptance *acceptance, Random *random)
Return whether or not the trial attempt should be accepted.
-
const Accumulator &mayer() const
Return the mayer ensemble of the full potential.
-
const Accumulator &mayer_ref() const
Return the mayer ensemble of the reference potential.
-
double second_virial_ratio() const
Return the ratio of the second virial coefficient of the full potential to the second virial coefficient of the reference potential.
-
double second_virial_ratio_block_stdev() const
Return the block standard deviation of the second_virial_ratio. This is computed using the error propogation formula variance formula:
\(f = mayer/mayer_ref\)
\(\sigma_f = \sqrt{(\sigma_{mayer}/mayer_ref)^2 + (f\sigma_{mayer_ref}/mayer_ref)^2}\)
-
int num_beta_taylor() const
Return the number of beta derivatives, starting with 1.
-
const std::vector<Accumulator> &beta_taylor() const
Return the beta derivatives in the mayer function f12.
-
double beta_taylor(const int deriv) const
Return the beta derivative in the second virial ratio by n factorial.
-
std::string write() const
Return a human-readable output of all data (not as brief as status).
Arguments
trials_per_cycle: define a cycle as a number of trials (as measured by number of calls to is_accepted) default: 1e9.
intra_potential: index of intramolecular potential that will be used to select the move. Ignore if -1 (default: -1).
num_beta_taylor: number of derivatives of second virial ratio with respect to beta. (default: 0).
training_file: if not empty, file name to write training data (default: empty).
training_per_write: write every this many sets of data (default: 1e4).
Criteria arguments.
-
bool is_accepted(const System &system, Acceptance *acceptance, Random *random)