Dear All,
I would like to ask about performing QMC in the canonical ensemble. This is what I found in the documentation:

RESTRICT_MEASUREMENTS[N]:
"if defined this restricts measurements to configurations where the quantum number N (particle number) has the value given as this parameter. Note that the simulation will still performed in the grand canonical ensemble and the chemical potential needs to be tuned to the right range, to actually sample configurations with the desired particle number."

If I understand correctly this means that sampling is done over larger set of configurations than necessary and if by chance the configuration wanders to the correct value the measurement takes place. More specifically: the average is calculated over the canonical ensemble, but sampling is over the grand canonical ensemble (and therefore it may be inefficient). If one sets the value of canonical potential to a value such that the desired occupation is close to the average occupation in the grand canonical ensemble then probability of wandering into the correct value of N is relatively high. Not optimal \mu means that although in "number of samples" ->infty limit the result is the same, the probability of wandering is impractically low (and therefore the calculation will last forever). All in all the averages are over the canonical ensemble.

Additionally: chemical potential is set automatically ? if I set the chemical potential manually, then this is considered an initial value?

It this right?


I found the following quotation in the Wdostep.C file:

if (canonical) {
  if (static_cast<int>(parms["NUMBER_OF_PARTICLES"])==get_particle_number()) 
    measure();
}
else 
  measure();

It seems to support my interpretation of documentation.

Regards,
Mateusz Łącki