TrialStage

class TrialStage

A stage contains both a selection and perturbation. Random realizations of the perturbation are performed in a number of steps. The use of reference potentials in stages is a generalization of the dual-cut configurational bias (DC-CB) methodology as described in http://doi.org/10.1080/002689798167881.

Public Functions

int reference() const

Return the index of the reference potential.

bool is_new_only() const

Return true if the trial computes new configuration only.

const Rosenbluth &rosenbluth() const

Return the Rosenbluth.

const int num_steps() const

Return the number of steps in Rosenbluth.

void set(std::shared_ptr<TrialSelect> select)

Set the selection.

const TrialSelect &select() const

Return the above.

void precompute(System *system)

Initialization before any stage attempt.

void before_select()

Initializations before each stage attempt.

bool select(System *system, Acceptance *acceptance, Random *random)

Perform the selection and update the acceptance. Return false if selection fails. Otherwise, set sites involved in stage as unphysical and return true.

void set(std::shared_ptr<Perturb> perturb)

Set the perturbation.

const Perturb &perturb() const

Return the above.

void set_mobile_physical(const bool physical, System *system)

Set mobile selection physical.

void attempt(System *system, Acceptance *acceptance, Criteria *criteria, const int old, Random *random)

Attempt all steps in a stage. Consider reference potentials and compute Rosenbluth factors. Set sites involves in stage as physical.

param old:

Set to 1 for “old” system and “0” for new.

void mid_stage(System *system)

Call between multiple attempts (e.g., old vs new) Set mobile sites unphysical.

bool are_constraints_satisfied(const int old, const System &system) const

Return true if constraints are satisfied.

void revert(System *system)

Revert the attempt.

void finalize(System *system)

Finalize the attempt.

void tune(const double acceptance)

Tune parameters.

std::string status_header() const

Print status header.

std::string status() const

Print status.

void serialize(std::ostream &ostr) const

Serialize.

TrialStage(std::istream &istr)

Deserialize.

Arguments

TrialStage(argtype *args)

args:

  • num_steps: number of Rosenbluth steps (default: 1).

  • reference_index: index of reference potential. Otherwise, if full potential is desired, set to -1 (default: -1).

  • new_only: do not compute the Rosenbluth of the old configuration (default: false).