Path Integral Quantum Monte Carlo
Public Member Functions
ClassicalMonteCarlo Class Reference

Pre-equilibration via classical Monte Carlo. More...

#include <cmc.h>

Public Member Functions

 ClassicalMonteCarlo (PotentialBase *, PotentialBase *, MTRand &, const Container *, Array< dVec, 1 > &)
 Constructor.
 
 ~ClassicalMonteCarlo ()
 Destructor.
 
void run (uint32, bool)
 Perform the Monte Carlo equilibration. More...
 

Detailed Description

Pre-equilibration via classical Monte Carlo.

We perform a series of classical Monte Carlo updates with the hopes of obtaining a good classical ground state from which to initiate our quantum monte carlo from.

Definition at line 26 of file cmc.h.

Member Function Documentation

◆ run()

void ClassicalMonteCarlo::run ( uint32  numMCSteps,
bool  gce 
)

Perform the Monte Carlo equilibration.

Perform the monte carlo simulation.

Definition at line 88 of file cmc.cpp.

88  {
89 
90  int numMeasure = 0;
91  double x;
92  for(uint32 n = 1; n < numMCSteps; n++) {
93  int m = 0;
94  do {
95  if (gce)
96  x = random.rand();
97  else
98  x = 0.0;
99 
100  /* Perform updates */
101  if (x < 1.0/3.0)
102  moveParticle();
103  else if (x < 2.0/3.0)
104  deleteParticle();
105  else
106  insertParticle();
107 
108  /* Update observables */
109  aveEnergy += energy;
110  aveNumParticles += numParticles;
111  aveEoN += energy/(1.0*numParticles);
112  numMeasure++;
113 
114  m++;
115  } while (m < numParticles);
116 
117  // if ((n % 50) == 0)
118  // measure(numMeasure);
119  }
120 
121  /* Update the config array */
122  config.resizeAndPreserve(numParticles);
123 }
unsigned long uint32
Unsigned integer type, at least 32 bits.
Definition: common.h:105
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: