25 string getList(
const vector<string> &options) {
27 ostringstream optionList;
28 std::copy(options.begin(),options.end()-1,
29 std::ostream_iterator<string>(optionList,
", "));
30 optionList << options.back();
31 return optionList.str();
37 ostream&
operator<<(ostream& os,
const vector<string>& vals)
39 for (
auto const& val :vals) {
40 if (val != vals.back())
61 vector<string> Parameters::split(
const string &s,
char delim) {
65 while (getline(ss, item, delim))
66 elems.push_back(item);
77 for(
auto const& par : params ) {
78 if (!par.second.empty()) {
79 string key = par.first;
81 if (type.at(key) ==
typeid(
bool))
82 cout << params.count(key);
84 extract[par.first](par.second);
100 for (
auto & par : params) {
103 string key = par.first;
106 po::options_description &option = _options[pClass[key]];
110 if (shortName[key] !=
"")
111 label +=
"," + shortName[key];
114 if (type.at(key) ==
typeid(
bool))
115 option.add_options()(label.c_str(),helpMessage[key].c_str());
117 else if (type.at(key) ==
typeid(double))
118 option.add_options()(label.c_str(),initValue<double>(key),helpMessage[key].c_str());
119 else if (type.at(key) ==
typeid(int))
120 option.add_options()(label.c_str(),initValue<int>(key),helpMessage[key].c_str());
121 else if (type.at(key) ==
typeid(
uint32))
122 option.add_options()(label.c_str(),initValue<uint32>(key),helpMessage[key].c_str());
123 else if (type.at(key) ==
typeid(string))
124 option.add_options()(label.c_str(),initValue<string>(key),helpMessage[key].c_str());
125 else if (type.at(key) ==
typeid(vector<string>)) {
127 if (state[key] == DEFAULTED) {
129 vector<string> ops = par.second.as<vector<string>>();
130 option.add_options()(label.c_str(), po::value<vector<string>>()->
131 default_value(ops,
getList(ops))->composing(), helpMessage[key].c_str());
134 option.add_options()(label.c_str(),
135 po::value<vector<string>>()->composing(), helpMessage[key].c_str());
138 cerr <<
"insertOption Failed to find a valid type.";
154 po::variables_map cmdparams;
157 po::store(po::parse_command_line(argc, argv, cmdLineOptions), cmdparams);
158 po::notify(cmdparams);
162 for (
auto & par : params) {
165 string key = par.first;
166 auto &val = par.second;
169 if (cmdparams.count(key)) {
171 val = cmdparams[key];
174 if (cmdparams[key].empty())
176 else if (cmdparams[key].defaulted())
177 state[key] = DEFAULTED;
185 if (!params[
"param_file"].empty()) {
189 pt::read_xml(params[
"param_file"].as<string>(),xmlParams);
190 xmlParams = xmlParams.get_child(
"pimc");
194 for (
auto & par : params) {
197 string key = par.first;
200 string paramClass = pClass[key] +
"_parameters";
204 if (getNode(xmlParams,xml,paramClass)) {
206 if (type.at(key) ==
typeid(
bool)){
209 else if (type.at(key) ==
typeid(
double)) {
210 set<double>(key,xml);
212 else if (type.at(key) ==
typeid(
int)) {
215 else if (type.at(key) ==
typeid(
uint32)) {
216 set<uint32>(key,xml);
218 else if (type.at(key) ==
typeid(
string)) {
219 set<string>(key,xml);
221 else if (type.at(key) ==
typeid(vector<string>)) {
223 string pluralKey = key +
"s";
224 if (xml.count(pluralKey) != 0) {
230 for (
auto const &opName : xml.get_child(pluralKey))
231 ops.push_back(opName.second.data());
234 set<vector<string>>(key,ops);
239 cerr <<
"xmlInsertOption Failed to find a valid type.";
245 cerr <<
"Cannot read parameter file: " << params[
"param_file"].as<
string>() << endl;
264 cmdLineOptions(
"Command Line Options")
267 optionClassNames = {
"simulation",
"physical",
"cell",
"algorithm",
"potential",
271 interactionPotentialName = {
"aziz",
"szalewicz",
"delta",
"lorentzian",
"sutherland",
272 "hard_sphere",
"hard_rod",
"free",
"delta1D",
"harmonic",
"dipole"};
273 interactionNames =
getList(interactionPotentialName);
276 externalPotentialName = {
"free",
"harmonic",
"osc_tube",
"lj_tube",
"plated_lj_tube",
277 "hard_tube",
"hg_tube",
"fixed_aziz",
"gasp_prim",
"fixed_lj",
"graphene",
"graphenelut",
278 "graphenelut3d",
"graphenelut3dgenerate",
"graphenelut3dtobinary",
"graphenelut3dtotext"};
279 externalNames =
getList(externalPotentialName);
282 actionName = {
"primitive",
"li_broughton",
"gsf",
"pair_product"};
283 actionNames =
getList(actionName);
286 waveFunctionName = {
"constant",
"sech",
"jastrow",
"lieb",
"sutherland"};
287 waveFunctionNames =
getList(waveFunctionName);
290 randomGeneratorName = {
"boost_mt19937",
"std_mt19937",
"pimc_mt19937"};
291 randomGeneratorNames =
getList(randomGeneratorName);
294 estimatorName = estimatorFactory()->getNames();
295 vector<string> multiEstimatorName = multiEstimatorFactory()->getNames();
296 estimatorName.insert(estimatorName.end(), multiEstimatorName.begin(),
297 multiEstimatorName.end());
298 estimatorNames =
getList(estimatorName);
301 moveName = moveFactory()->getNames();
309 void Setup::initParameters() {
312 for(
string oClass : optionClassNames) {
313 string optionClassName = oClass;
314 optionClassName[0] = toupper(optionClassName[0]);
315 optionClassName +=
" Options";
316 optionClasses.insert(oClass,
new po::options_description(optionClassName));
320 string oClass =
"simulation";
321 params.
add<
bool>(
"help,h",
"produce help message",oClass);
322 params.
add<
bool>(
"version",
"output repo version",oClass);
323 params.
add<
bool>(
"validate",
"validate command line or xml options",oClass);
324 params.
add<
bool>(
"dimension",
"output currently compiled dimension",oClass);
325 params.
add<
int>(
"output_config,o",
"number of output configurations",oClass,0);
327 params.
add<
string>(
"restart,R",
"restart running simulation with PIMCID",oClass);
328 params.
add<
double>(
"wall_clock,W",
"set wall clock limit in hours",oClass);
329 params.
add<
string>(
"start_with_state,s",
"start simulation with a supplied state file.",oClass,
"");
330 params.
add<
bool>(
"no_save_state",
"Only save a state file at the end of a simulation",oClass);
331 params.
add<
bool>(
"estimator_list",
"Output a list of estimators in xml format.",oClass);
332 params.
add<
bool>(
"update_list",
"Output a list of updates in xml format.",oClass);
333 params.
add<
string>(
"label",
"a label to append to all estimator files.",oClass,
"");
334 params.
add<
string>(
"rng,G",str(format(
"random number generator type:\n%s") % randomGeneratorNames).c_str(),oClass,
"pimc_mt19937");
335 params.
add<
string>(
"param_file",
"a valid path to the parameters input xml file.",oClass);
339 params.
add<
string>(
"geometry,b",
"simulation cell type [prism,cylinder]",oClass,
"prism");
340 params.
add<
double>(
"size,L",
"linear system size [angstroms]",oClass);
341 params.
add<
double>(
"Lx",
"system size in x-direction [angstroms]",oClass);
342 params.
add<
double>(
"Ly",
"system size in y-direction [angstroms]",oClass);
343 params.
add<
double>(
"Lz",
"system size in z-direction [angstroms]",oClass);
344 params.
add<
double>(
"radius,r",
"tube radius [angstroms]",oClass);
347 oClass =
"potential";
348 params.
add<
string>(
"interaction,I",str(format(
"interaction potential type:\n%s") % interactionNames).c_str(),oClass,
"aziz");
349 params.
add<
string>(
"external,X",str(format(
"external potential type:\n%s") % externalNames).c_str(),oClass,
"free");
350 params.
add<
double>(
"scattering_length,a",
"scattering length [angstroms]",oClass,1.0);
351 params.
add<
double>(
"delta_width",
"delta function potential width",oClass,1.0E-3);
352 params.
add<
double>(
"delta_strength,c",
"delta function potential integrated strength",oClass,10.0);
353 params.
add<
double>(
"interaction_strength,g",
"interaction parameter",oClass,1.0);
354 params.
add<
double>(
"omega",
"harmonic interaction potential frequency",oClass,1.0);
355 params.
add<
double>(
"lj_sigma",
"Lennard-Jones hard-core radius [angstroms]",oClass,2.74);
356 params.
add<
double>(
"lj_epsilon",
"Lennard-Jones energy scale [kelvin]",oClass,16.2463);
357 params.
add<
double>(
"lj_width",
"Radial with of LJ plated cylinder material [angstroms]",oClass);
358 params.
add<
double>(
"lj_density",
"Density LJ plated cylinder material [angstroms^(-3)]",oClass);
359 params.
add<
double>(
"hourglass_radius",
"differential radius for hourglass potential [angstroms]",oClass,0.0);
360 params.
add<
double>(
"hourglass_width",
"constriction width for hourglass potential [angstroms]",oClass,0.0);
361 params.
add<
string>(
"fixed,f",
"input file name for fixed atomic positions.",oClass,
"");
362 params.
add<
double>(
"potential_cutoff,l",
"interaction potential cutoff length [angstroms]",oClass);
363 params.
add<
double>(
"empty_width_y,y",
"how much space (in y-) around Gasparini barrier",oClass);
364 params.
add<
double>(
"empty_width_z,z",
"how much space (in z-) around Gasparini barrier",oClass);
367 params.
add<
double>(
"strain",
"strain of graphene lattice in y-direction",oClass,0.00);
368 params.
add<
double>(
"poisson",
"Poisson's ratio for graphene",oClass,0.165);
369 params.
add<
double>(
"carbon_carbon_dist,A",
"Carbon-Carbon distance for graphene",oClass,1.42);
370 params.
add<
string>(
"graphenelut3d_file_prefix",
"GrapheneLUT3D file prefix <prefix>serialized.{dat|txt}",oClass,
"");
374 params.
add<
bool>(
"canonical",
"perform a canonical simulation",oClass);
375 params.
add<
double>(
"mass,m",
"particle mass [amu]",oClass,4.0030);
376 params.
add<
double>(
"density,n",str(format(
"initial density [angstroms^(-%d)]") %
NDIM).c_str(),oClass);
377 params.
add<
int>(
"number_particles,N",
"number of particles",oClass);
378 params.
add<
double>(
"temperature,T",
"temperature [kelvin]",oClass);
379 params.
add<
string>(
"wavefunction",str(format(
"trial wave function type:\n%s")
380 % waveFunctionNames).c_str(),oClass,
"constant");
381 params.
add<
double>(
"R_LL_wfn",
"length scale of the lieb liniger wave function",oClass,0.0);
382 params.
add<
double>(
"k_LL_wfn",
"wave number of the lieb liniger wave function",oClass,0.0);
383 params.
add<
double>(
"end_factor",
"end bead potential action multiplicatave factor",oClass,1.0);
384 params.
add<
double>(
"chemical_potential,u",
"chemical potential [kelvin]",oClass,0.0);
385 params.
add<
int>(
"number_paths",
"number of paths",oClass,1);
388 oClass =
"algorithm";
389 params.
add<
bool>(
"relax",
"perform a worm constant relaxation",oClass);
390 params.
add<
bool>(
"relaxmu",
"perform a chemical potential relaxation to target a fixed density",oClass);
391 params.
add<
int>(
"number_time_slices,P",
"number of time slices",oClass);
392 params.
add<
int>(
"window",
"set particle number window",oClass);
393 params.
add<
double>(
"gaussian_window_width",
"set gaussian ensemble weight",oClass);
394 params.
add<
double>(
"imaginary_time_step,t",
"imaginary time step [kelvin^(-1)]",oClass);
395 params.
add<
double>(
"imaginary_time_length",
"total path length in imaginary time [kelvin^(-1)]",oClass);
396 params.
add<
double>(
"worm_constant,C",
"worm acceptance constant",oClass,1.0);
397 params.
add<
double>(
"com_delta,D",
"center of mass update radius[angstroms]",oClass);
398 params.
add<
double>(
"displace_delta,d",
"displace update radius [angstroms]",oClass);
399 params.
add<
int>(
"update_length,M",
"non-local update length, (Mbar), -1 sets maximal value",oClass);
400 params.
add<
string>(
"action", str(format(
"action type:\n%s") % actionNames).c_str(),oClass,
"gsf");
401 params.
add<
bool>(
"full_updates",
"perform full staging updates",oClass);
402 params.
add<
bool>(
"var_updates",
"perform variable length diagonal updates",oClass);
403 params.
add<
bool>(
"staging",
"perform staging instead of bisection for the diagonal update",oClass);
404 params.
add<
int>(
"max_winding",
"the maximum winding number to sample",oClass,1);
407 oClass =
"measurement";
408 params.
add<
uint32>(
"number_eq_steps,E",
"number of equilibration steps",oClass,1);
409 params.
add<
int>(
"number_bins_stored,S",
"number of estimator bins stored",oClass,1);
410 params.
add<
int>(
"bin_size",
"number of updates per bin",oClass,100);
411 params.
add<
double>(
"estimator_radius,w",
"maximum radius for cylinder estimators",oClass,2.0);
412 params.
add<
int>(
"virial_window,V",
"centroid virial energy estimator window",oClass,5);
413 params.
add<
int>(
"number_broken",
"number of broken world-lines",oClass,0);
414 params.
add<
double>(
"spatial_subregion",
"define a spatial subregion",oClass);
417 vector<string> estimatorsToMeasure;
418 vector<string> movesToPerform;
421 estimatorsToMeasure = {EnergyEstimator::name, TimeEstimator::name};
422 movesToPerform = {CenterOfMassMove::name, StagingMove::name, EndStagingMove::name,
426 estimatorsToMeasure = {EnergyEstimator::name, NumberParticlesEstimator::name,
427 TimeEstimator::name, DiagonalFractionEstimator::name};
429 movesToPerform = {CenterOfMassMove::name, BisectionMove::name, OpenMove::name,
430 CloseMove::name, InsertMove::name, RemoveMove::name, AdvanceHeadMove::name,
431 RecedeHeadMove::name, AdvanceTailMove::name, RecedeTailMove::name, SwapHeadMove::name,
435 params.
add<vector<string>>(
"update", str(format(
"Monte Carlo updates to be performed:\n%s")
436 % moveNames).c_str(),
"algorithm",movesToPerform);
437 params.
add<vector<string>>(
"estimator,e", str(format(
"estimators to be measured:\n%s")
438 % estimatorNames).c_str(),
"measurement",estimatorsToMeasure);
448 string Setup::getXMLOptionList(
const vector<string> &options,
const string tag) {
450 string optionList =
"";
451 for(
auto name : options)
452 optionList += str(format(
"<%s>\n %s\n<\\%s>\n") % tag % name % tag);
474 for(
string oClass : optionClassNames)
475 cmdLineOptions.add(optionClasses[oClass]);
492 cout << cmdLineOptions << endl;
497 if (
params(
"dimension")) {
498 cout << endl << format(
"Code was compiled for a %d-dimensional system.") %
NDIM
505 cout << endl << format(
"Code was compiled with repo version %s.") % REPO_VERSION
511 if (
params(
"estimator_list")) {
512 cout << endl <<
"The following estimators can be included in an xml input file." << endl;
513 cout << getXMLOptionList(estimatorName,
"estimator") << endl << endl;
518 if (!
params(
"temperature") && !PIGS ) {
519 cerr << endl <<
"ERROR: No temperature defined!" << endl << endl;
520 cerr <<
"Action: specify temperature (T)" << endl;
525 if (
params(
"temperature") && PIGS) {
526 cerr << endl <<
"ERROR: Did you mean to define a non-zero temperature for PIGS?" << endl << endl;
527 cerr <<
"Action: remove temperature (T)" << endl;
536 side =
params[
"size"].as<
double>();
544 vector<string> sides = {
"Lx",
"Ly",
"Lz"};
545 for (
int i = 0; i <
NDIM; i++)
546 side[i] =
params[sides[i]].as<double>();
551 if (!( (
params(
"density") &&
params(
"number_particles")) ||
552 (definedCell &&
params(
"number_particles")) ||
553 (definedCell &&
params(
"density")) ) ) {
554 cerr << endl <<
"ERROR: Cannot create the simulation cell!" << endl << endl;
555 cerr <<
"Action: define a valid simulation cell." << endl;
556 cerr <<
"Need: [number_particles (N) AND density (n)] OR " << endl;
557 cerr <<
" [number_particles (N) AND size (L) or Lx,Ly,Lz] OR" << endl;
558 cerr <<
" [size (L) or Lx,Ly,Lz AND density (n)]" << endl << endl;
559 cerr << optionClasses[
"cell"] << endl;
564 if (!( (
params[
"geometry"].as<string>() ==
"cylinder") ||
565 (
params[
"geometry"].as<string>() ==
"prism") ))
567 cerr << endl <<
"ERROR: Invalid simulation cell type." << endl << endl;
568 cerr <<
"Action: change cell (b) to one of:" << endl
569 <<
"\t[prism,cylinder]" << endl;
574 if (!((
params(
"imaginary_time_length") &&
params(
"number_time_slices")) ||
575 (
params(
"imaginary_time_length") &&
params(
"imaginary_time_step")) ||
576 (
params(
"number_time_slices") &&
params(
"imaginary_time_step")) ||
577 (
params(
"temperature") && (
params(
"number_time_slices") ||
578 (
params(
"imaginary_time_step")))) ) ) {
579 cerr << endl <<
"ERROR: Cannot create imaginary time paths!" << endl << endl;
580 cerr <<
"Action: define imaginary_time_length AND imaginary_time_step (t) OR" << endl;
581 cerr <<
" define imaginary_time_length AND number_time_steps (P) OR" << endl;
582 cerr <<
" define number_time_slices (P) AND imaginary_time_step (t)" << endl << endl;
583 cerr <<
" define temperature (T) AND (number_time_slices (P) OR imaginary_time_step (t))" << endl << endl;
584 cerr << optionClasses[
"algorithm"] << endl;
589 if (std::find(interactionPotentialName.begin(), interactionPotentialName.end(),
590 params[
"interaction"].as<
string>()) == interactionPotentialName.end()) {
591 cerr << endl <<
"ERROR: Invalid interaction potential!" << endl << endl;
592 cerr <<
"Action: set interaction (I) to one of:" << endl
593 <<
"\t[" << interactionNames <<
"]" << endl;
598 if (std::find(externalPotentialName.begin(), externalPotentialName.end(),
599 params[
"external"].as<
string>()) == externalPotentialName.end()) {
600 cerr << endl <<
"ERROR: Invalid external potential!" << endl << endl;
601 cerr <<
"Action: set external (X) must to one of:" << endl
602 <<
"\t[" << externalNames <<
"]" << endl;
607 if (std::find(actionName.begin(), actionName.end(),
608 params[
"action"].as<
string>()) == actionName.end()) {
609 cerr << endl <<
"ERROR: Invalid action!" << endl << endl;
610 cerr <<
"Action: set action to one of:" << endl
611 <<
"\t[" << actionNames <<
"]" << endl;
616 if (std::find(waveFunctionName.begin(), waveFunctionName.end(),
617 params[
"wavefunction"].as<
string>()) == waveFunctionName.end()) {
618 cerr << endl <<
"ERROR: Invalid trial wave function!" << endl << endl;
619 cerr <<
"Action: set wave function to one of :" << endl
620 <<
"\t[" << waveFunctionNames <<
"]" << endl;
626 if (((
params[
"interaction"].as<string>() ==
"hard_sphere") ||
627 (
params[
"interaction"].as<string>() ==
"hard_rod") ||
628 (
params[
"interaction"].as<string>() ==
"delta1D") ) &&
629 (
params[
"action"].as<
string>() !=
"pair_product") ) {
631 cerr <<
"ERROR: Need to use the pair product approximation with discontinuous potentials!";
632 cout << endl << endl;
633 cerr <<
"Action: change the action to pair_product." << endl;
638 if ((
params[
"external"].as<string>().find(
"tube") != string::npos) && (
NDIM != 3)) {
639 cerr << endl <<
"ERROR: Can only use tube potentials for a 3D system!" << endl << endl;
640 cerr <<
"Action: change the potential or recompile with ndim=3." << endl;
645 if ( (
params[
"external"].as<string>().find(
"tube") != string::npos) && (!
params(
"radius")) ) {
646 cerr << endl <<
"ERROR: Incomplete specification for external potential!" << endl << endl;
647 cerr <<
"Action: specfiy a radius (r) for the tube potentials." << endl;
652 if ( (
params[
"external"].as<string>().find(
"gasp_prim") != string::npos) &&
653 (!
params(
"empty_width_y")) ) {
654 cerr << endl <<
"ERROR: Incomplete specification for external potential!" << endl << endl;
655 cerr <<
"Action: specify a y- scale factor (y) for the Gasparini potential." << endl;
660 if ( (
params[
"external"].as<string>().find(
"gasp_prim") != string::npos) &&
661 (!
params(
"empty_width_z")) ) {
662 cerr << endl <<
"ERROR: Incomplete specification for external potential!" << endl << endl;
663 cerr <<
"Action: specify a z- scale factor (z) for the Gasparini potential." << endl;
668 if ((
params[
"interaction"].as<string>().find(
"hard_sphere") != string::npos) && (
NDIM != 3)) {
669 cerr << endl <<
"ERROR: Can only use hard sphere potentials for a 3D system!" << endl << endl;
670 cerr <<
"Action: change the potential or recompile with ndim=3." << endl;
675 if ((
params[
"interaction"].as<string>().find(
"hard_rod") != string::npos) && (
NDIM != 1)) {
676 cerr << endl <<
"ERROR: Can only use hard rod potentials for a 1D system!" << endl << endl;
677 cerr <<
"Action: change the potential or recompile with ndim=1." << endl;
682 if ((
params[
"interaction"].as<string>().find(
"delta1D") != string::npos) && (
NDIM != 1)) {
683 cerr << endl <<
"ERROR: Can only use delta1D potentials for a 1D system!" << endl << endl;
684 cerr <<
"Action: change the potential or recompile with ndim=1." << endl;
689 for (
string name :
params[
"estimator"].as<vector<string>>()){
690 if (std::find(estimatorName.begin(), estimatorName.end(), name) == estimatorName.end()) {
691 cerr <<
"ERROR: Tried to measure a non-existent estimator: " << name << endl;
692 cerr <<
"Action: set estimator to one of:" << endl
693 <<
"\t[" << estimatorNames<<
"]" << endl;
724 if (
params[
"geometry"].as<string>() ==
"prism") {
725 for (
string name :
params[
"estimator"].as<vector<string> >()) {
726 bool foundCylinderEstimator = (name.find(
"cylinder") != string::npos);
727 if (foundCylinderEstimator) {
728 cerr <<
"ERROR: Tried to measure a cylinder estimator in a prism: " << name << endl;
729 cerr <<
"Action: remove " << name <<
" estimator." << endl;
736 for (
string name :
params[
"update"].as<vector<string>>()){
737 if (std::find(moveName.begin(), moveName.end(), name) == moveName.end()) {
738 cerr <<
"ERROR: Tried to perform a non-existent move: " << name << endl;
739 cerr <<
"Action: set move to one of:" << endl
740 <<
"\t[" << moveNames <<
"]" << endl;
746 cerr <<
"SUCCESS: All command line and/or xml options have been verified." << endl;
747 cerr <<
"Action: remove --validate flag to proceed with simulation." << endl;
777 if (
params[
"geometry"].as<string>() ==
"cylinder") {
779 double radius =
params[
"radius"].as<
double>();
783 if ( (
params[
"external"].as<string>() ==
"hg_tube") &&
784 (
params[
"hourglass_radius"].as<
double>() > 0) )
785 radius +=
params[
"hourglass_radius"].as<double>();
788 if (definedCell &&
params(
"number_particles"))
790 else if (definedCell &&
params(
"density")) {
796 radius,
params[
"number_particles"].as<int>());
799 else if (
params[
"geometry"].as<string>() ==
"prism") {
805 if (
params[
"external"].as<string>().find(
"graphene") != string::npos)
806 periodic[
NDIM-1] = 0;
808 if (definedCell &&
params(
"number_particles"))
809 boxPtr =
new Prism(
params[
"side"].as<dVec>(),periodic);
810 else if (definedCell &&
params(
"density")) {
811 boxPtr =
new Prism(
params[
"side"].as<dVec>(),periodic);
815 boxPtr =
new Prism(
params[
"density"].as<double>(),
params[
"number_particles"].as<int>());
835 int numTimeSlices,numDeltaTau;
836 double tau,imaginaryTimeLength;
837 bool pathBreak = (
params[
"number_broken"].as<
int>() > 0 ||
838 params(
"spatial_subregion"));
845 if (!
params(
"imaginary_time_length"))
846 params.
set<
double>(
"imaginary_time_length",1.0/
params[
"temperature"].as<
double>());
850 if (!
params(
"number_time_slices")) {
851 tau =
params[
"imaginary_time_step"].as<
double>();
852 numTimeSlices =
static_cast<int>(1.0/(
params[
"temperature"].as<
double>() * tau) +
EPS);
853 if ((numTimeSlices % 2) != 0)
855 params.
set<
int>(
"number_time_slices",numTimeSlices);
858 numTimeSlices =
params[
"number_time_slices"].as<
int>();
859 if ((numTimeSlices % 2) != 0)
861 tau = 1.0/(
params[
"temperature"].as<
double>() * numTimeSlices);
862 params.
set<
int>(
"number_time_slices",numTimeSlices);
863 params.
set<
double>(
"imaginary_time_step",tau);
869 if (
params(
"imaginary_time_length") &&
params(
"number_time_slices") ) {
872 numTimeSlices =
params[
"number_time_slices"].as<
int>();
873 if ((numTimeSlices % 2) == 0)
877 numDeltaTau = (numTimeSlices-1)/2;
878 if ( ((pathBreak)&&(numDeltaTau%2==0)) || ((!pathBreak)&&(numDeltaTau%2==1)) )
881 tau =
params[
"imaginary_time_length"].as<
double>() / (numTimeSlices-1);
882 params.
set<
int>(
"number_time_slices",numTimeSlices);
883 params.
set<
double>(
"imaginary_time_step",tau);
887 else if (
params(
"imaginary_time_length") &&
params(
"imaginary_time_step") ) {
888 tau =
params[
"imaginary_time_step"].as<
double>();
889 numTimeSlices =
static_cast<int>((
params[
"imaginary_time_length"].as<
double>() / tau) +
EPS)+1;
892 if ((numTimeSlices % 2) == 0)
897 numDeltaTau = (numTimeSlices-1)/2;
898 if ( ((pathBreak)&&(numDeltaTau%2==0)) || ((!pathBreak)&&(numDeltaTau%2==1)) )
901 imaginaryTimeLength = (numTimeSlices-1)*tau;
902 params.
set<
double>(
"imaginary_time_length",imaginaryTimeLength);
904 params.
set<
int>(
"number_time_slices",numTimeSlices);
909 numTimeSlices =
params[
"number_time_slices"].as<
int>();
910 if ((numTimeSlices % 2) == 0)
914 numDeltaTau = (numTimeSlices-1)/2;
915 if ( ((pathBreak)&&(numDeltaTau%2==0)) || ((!pathBreak)&&(numDeltaTau%2==1)) )
919 params.
set<
int>(
"number_time_slices",numTimeSlices);
920 imaginaryTimeLength = (numTimeSlices-1)*
params[
"imaginary_time_step"].as<double>();
921 params.
set<
double>(
"imaginary_time_length",imaginaryTimeLength);
925 params.
set<
double>(
"temperature",1.0/
params[
"imaginary_time_length"].as<
double>());
931 if (!
params(
"update_length")) {
933 double ell = pow((1.0*
params[
"number_particles"].as<int>() /
934 params[
"volume"].as<double>()),-1.0/(1.0*
NDIM));
935 double lambda = 24.24 /
params[
"mass"].as<
double>();
936 Mbar = int(ell*ell/(16*lambda*
params[
"imaginary_time_step"].as<double>()));
939 else if (Mbar > numTimeSlices)
940 Mbar = numTimeSlices/2;
946 if (
params[
"update_length"].as<int>() < 0)
947 Mbar = numTimeSlices - 2;
949 Mbar =
params[
"update_length"].as<
int>();
958 if (Mbar > numTimeSlices) {
959 cerr << Mbar <<
" " << numTimeSlices << endl;
960 cerr << endl <<
"ERROR: Update length > number time slices!" << endl << endl;
961 cerr <<
"Action: Increase number_time_slices (P) OR" << endl;
962 cerr <<
" Decrease update_length (M) OR" << endl;
963 cerr <<
" Decrease imaginary_time_step (t) OR" << endl;
964 cerr <<
" Increase imaginary_time_length" << endl;
980 if (
params[
"action"].as<string>() ==
"pair_product" ||
981 !
params(
"potential_cutoff") )
994 if (
params(
"displace_delta"))
1016 (
params[
"output_config"].as<int>() > 0),
params[
"start_with_state"].as<string>(),
1017 params[
"fixed"].as<string>());
1029 if (
constants()->intPotentialType() ==
"free")
1031 else if (
constants()->intPotentialType() ==
"delta")
1033 params[
"delta_strength"].as<double>());
1034 else if (
constants()->intPotentialType() ==
"sutherland")
1036 else if (
constants()->intPotentialType() ==
"hard_sphere")
1038 else if (
constants()->intPotentialType() ==
"hard_rod")
1040 else if (
constants()->intPotentialType() ==
"delta1D")
1042 else if (
constants()->intPotentialType() ==
"lorentzian")
1044 params[
"delta_strength"].as<double>());
1045 else if (
constants()->intPotentialType() ==
"aziz")
1047 else if (
constants()->intPotentialType() ==
"szalewicz")
1049 else if (
constants()->intPotentialType() ==
"harmonic")
1051 else if (
constants()->intPotentialType() ==
"dipole")
1054 return interactionPotentialPtr;
1067 if (
constants()->extPotentialType() ==
"harmonic")
1069 else if (
constants()->extPotentialType() ==
"free")
1071 else if (
constants()->extPotentialType() ==
"osc_tube")
1073 else if (
constants()->extPotentialType() ==
"hg_tube")
1075 params[
"hourglass_radius"].as<double>(),
params[
"hourglass_width"].as<double>());
1076 else if (
constants()->extPotentialType() ==
"plated_lj_tube")
1078 params[
"lj_width"].as<double>(),
params[
"lj_sigma"].as<double>(),
1079 params[
"lj_epsilon"].as<double>(),
params[
"lj_density"].as<double>());
1080 else if (
constants()->extPotentialType() ==
"lj_tube")
1082 else if (
constants()->extPotentialType() ==
"hard_tube")
1084 else if (
constants()->extPotentialType() ==
"single_well")
1086 else if (
constants()->extPotentialType() ==
"fixed_aziz")
1088 else if (
constants()->extPotentialType() ==
"gasp_prim")
1090 params[
"empty_width_y"].as<double>(),boxPtr);
1091 else if (
constants()->extPotentialType() ==
"graphene")
1093 params[
"poisson"].as<double>(),
1094 params[
"carbon_carbon_dist"].as<double>(),
1095 params[
"lj_sigma"].as<double>(),
1096 params[
"lj_epsilon"].as<double>()
1098 else if (
constants()->extPotentialType() ==
"graphenelut")
1100 params[
"poisson"].as<double>(),
1101 params[
"carbon_carbon_dist"].as<double>(),
1102 params[
"lj_sigma"].as<double>(),
1103 params[
"lj_epsilon"].as<double>(),
1106 else if (
constants()->extPotentialType() ==
"fixed_lj")
1108 params[
"lj_epsilon"].as<double>(),boxPtr);
1109 else if (
constants()->extPotentialType() ==
"graphenelut3d")
1111 params[
"graphenelut3d_file_prefix"].as<string>(),
1114 else if (
constants()->extPotentialType() ==
"graphenelut3dgenerate")
1116 params[
"strain"].as<double>(),
1117 params[
"poisson"].as<double>(),
1118 params[
"carbon_carbon_dist"].as<double>(),
1119 params[
"lj_sigma"].as<double>(),
1120 params[
"lj_epsilon"].as<double>(),
1123 else if (
constants()->extPotentialType() ==
"graphenelut3dtobinary")
1125 params[
"graphenelut3d_file_prefix"].as<string>(),
1128 else if (
constants()->extPotentialType() ==
"graphenelut3dtotext")
1130 params[
"graphenelut3d_file_prefix"].as<string>(),
1134 return externalPotentialPtr;
1147 if (
constants()->waveFunctionType() ==
"constant")
1149 else if (
constants()->waveFunctionType() ==
"sech")
1151 else if (
constants()->waveFunctionType() ==
"jastrow")
1153 else if (
constants()->waveFunctionType() ==
"lieb")
1155 else if (
constants()->waveFunctionType() ==
"sutherland")
1157 params[
"interaction_strength"].as<double>());
1159 return waveFunctionPtr;
1176 if (
constants()->actionType() ==
"pair_product") {
1178 interactionPotentialPtr,waveFunctionPtr,
false,
constants()->actionType());
1184 TinyVector <double,2> VFactor;
1185 TinyVector <double,2> gradVFactor;
1191 if (
constants()->actionType() ==
"gsf") {
1195 VFactor[0] = 2.0/3.0;
1196 VFactor[1] = 4.0/3.0;
1199 gradVFactor[0] = 2.0*alpha/9.0;
1200 gradVFactor[1] = 2.0*(1.0-alpha)/9.0;
1204 gradVFactor = 1.0 / 12.0;
1209 bool local = !
params(
"full_updates");
1211 actionPtr =
new LocalAction(path,lookup,externalPotentialPtr,
1212 interactionPotentialPtr,waveFunctionPtr,VFactor,gradVFactor,local,
1231 vector<string> updates =
params[
"update"].as<vector<string>>();
1235 if (
params[
"number_broken"].as<int>() > 0) {
1238 if (std::find(updates.begin(), updates.end(), SwapBreakMove::name)
1240 updates.push_back(SwapBreakMove::name);
1242 params.
set<vector<string>>(
"update",updates);
1243 constants()->setAttemptProb(
"diagonal",0.5);
1244 constants()->setAttemptProb(
"swap break",0.1);
1246 }
else if (
params(
"spatial_subregion")) {
1249 if (std::find(updates.begin(), updates.end(), MidStagingMove::name)
1251 updates.push_back(MidStagingMove::name);
1253 params.
set<vector<string>>(
"update",updates);
1254 constants()->setAttemptProb(
"diagonal",0.5);
1255 constants()->setAttemptProb(
"mid staging",0.1);
1262 (
params[
"action"].as<string>() ==
"pair_product") ||
1263 (
params[
"max_winding"].as<int>() > 1) )
1267 auto it = std::find(updates.begin(), updates.end(), BisectionMove::name);
1268 if (it == updates.end())
1269 updates.push_back(StagingMove::name);
1271 updates.at(std::distance(updates.begin(),it)) = StagingMove::name;
1273 params.
set<vector<string>>(
"update",updates);
1278 boost::ptr_vector<MoveBase>* movePtr =
new boost::ptr_vector<MoveBase>();
1281 for (
auto& name :
params[
"update"].as<vector<string>>())
1282 movePtr->push_back(moveFactory()->Create(name,path,actionPtr,random));
1300 boost::ptr_vector<EstimatorBase>* estimatorPtr =
new boost::ptr_vector<EstimatorBase>();
1303 for (
auto& name :
params[
"estimator"].as<vector<string>>()) {
1305 if (name.find(
"multi") == string::npos)
1306 estimatorPtr->push_back(estimatorFactory()->Create(name,path,
1307 actionPtr,random,
params[
"estimator_radius"].as<double>()));
1312 for (
const auto & common : {
"estimator",
"cyl_estimator"}) {
1313 auto ePtr = find_if(estimatorPtr->rbegin(), estimatorPtr->rend(),
1314 [common](
EstimatorBase &e) { return e.getLabel() == common; });
1315 if (ePtr != estimatorPtr->rend())
1319 return estimatorPtr;
1330 boost::ptr_vector<Path> &pathPtrVec,
1331 boost::ptr_vector<ActionBase> &actionPtrVec, MTRand &random) {
1334 boost::ptr_vector<EstimatorBase>* multiEstimatorPtr =
new boost::ptr_vector<EstimatorBase>();
1337 for (
auto& name :
params[
"estimator"].as<vector<string>>()) {
1339 if (name.find(
"multi") != string::npos)
1340 multiEstimatorPtr->push_back(multiEstimatorFactory()->Create(name,pathPtrVec[0],
1341 pathPtrVec[1],&actionPtrVec[0],&actionPtrVec[1],random,
1342 params[
"estimator_radius"].as<double>()));
1345 return multiEstimatorPtr;
1354 void Setup::cleanCommandLineOptions(
int argc,
char*argv[], vector<string> &cmdArg,
1355 vector<string> &cmdSep, vector<string> &cmdVal) {
1358 cmdArg.push_back(argv[0]);
1359 cmdSep.push_back(
"");
1360 cmdVal.push_back(
"");
1362 for (
int n = 1; n < argc; n++) {
1364 string carg(argv[n]);
1367 auto numDashes = std::count(carg.begin(), carg.end(),
'-');
1370 if (numDashes == 1) {
1371 if (carg.length() <= 2) {
1372 cmdArg.push_back(carg);
1375 cmdSep.push_back(
" ");
1376 cmdVal.push_back(
string(argv[n+1]));
1379 cmdSep.push_back(
"");
1380 cmdVal.push_back(
"");
1385 cmdArg.push_back(carg.substr(0,2));
1386 cmdSep.push_back(
" ");
1387 cmdVal.push_back(carg.substr(2,carg.length()-2));
1391 else if (numDashes == 2) {
1394 auto posEqual = carg.find(
"=");
1395 if (posEqual != string::npos) {
1396 cmdArg.push_back(carg.substr(0,posEqual));
1397 cmdSep.push_back(
"=");
1398 string nextArg(carg.substr(posEqual+1));
1401 if (nextArg.find(
" ") != string::npos)
1402 cmdVal.push_back(
string(
"\"") + nextArg +
string(
"\""));
1404 cmdVal.push_back(nextArg);
1407 cmdArg.push_back(carg);
1411 string nextArg(argv[n+1]);
1414 if (nextArg.find(
'-') == string::npos) {
1416 cmdSep.push_back(
" ");
1419 if (nextArg.find(
" ") != string::npos)
1420 cmdVal.push_back(
string(
"\"") + nextArg +
string(
"\""));
1422 cmdVal.push_back(nextArg);
1426 cmdSep.push_back(
"");
1427 cmdVal.push_back(
"");
1431 cmdSep.push_back(
"");
1432 cmdVal.push_back(
"");
1456 vector<string> cmdArg, cmdSep, cmdVal;
1457 cleanCommandLineOptions(argc,argv,cmdArg,cmdSep,cmdVal);
1462 bool outputC0 =
false;
1463 bool outputmu =
false;
1464 bool outputD =
false;
1465 bool outputd =
false;
1466 bool outputEstimator =
false;
1467 bool outputUpdate =
false;
1469 for (
uint32 n = 0; n < cmdArg.size(); ++n) {
1471 auto arg = cmdArg[n];
1473 if ( (arg ==
"-s") || (arg ==
"--start_with_state") ) {
1476 else if ( (arg ==
"-C") || (arg ==
"worm_constant") ) {
1480 else if ( (arg ==
"-u") || (arg ==
"chemical_potential") ) {
1484 else if ((arg ==
"-p") || (arg ==
"--process")) {
1487 else if ((arg ==
"-D") || (arg ==
"--com_delta")) {
1491 else if ((arg ==
"-d") || (arg ==
"--displace_delta")) {
1495 else if ((arg ==
"--estimator") || (arg ==
"-e")) {
1496 outputEstimator =
true;
1498 else if (arg ==
"--update") {
1499 outputUpdate =
false;
1502 communicate()->
file(
"log")->stream() << cmdArg[n] << cmdSep[n] << cmdVal[n] <<
" ";
1521 if (PIGS && !outputd)
1525 if (outputEstimator) {
1526 for (
const auto &estName :
params[
"estimator"].as<vector<string>>()) {
1528 if (estName.find(
" ") != string::npos)
1530 communicate()->
file(
"log")->stream() <<
"--estimator=" << wrapper << estName << wrapper <<
" ";
1536 for (
const auto &mvName :
params[
"updates"].as<vector<string>>()) {
1538 if (mvName.find(
" ") != string::npos)
1540 communicate()->
file(
"log")->stream() <<
"--update=" << wrapper << mvName << wrapper <<
" ";
1545 communicate()->
file(
"log")->stream() <<
"---------- Begin Simulation Parameters ----------" << endl;
1549 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t") %
"Command String";
1551 for (
uint32 n = 0; n < cmdArg.size(); n++)
1552 communicate()->
file(
"log")->stream() << cmdArg[n] << cmdSep[n] << cmdVal[n] <<
" ";
1556 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%s\n") %
"Ensemble" %
"canonical";
1558 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%s\n") %
"Ensemble" %
"grand canonical";
1561 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%s\n") %
"Simulation Type" %
"PIGS";
1563 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%s\n") %
"Simulation Type" %
"PIMC";
1564 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%s\n") %
"Action Type" %
params[
"action"].as<
string>();
1565 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%s\n") %
"Number of paths" %
params[
"number_paths"].as<
int>();
1566 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%s\n") %
"Interaction Potential" %
1567 params[
"interaction"].as<
string>();
1570 if ( (
params[
"interaction"].as<string>().find(
"delta") != string::npos) ||
1571 (
params[
"interaction"].as<
string>().find(
"lorentzian") != string::npos) ) {
1572 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%8.3e\n") %
"Delta Width"
1573 %
params[
"delta_width"].as<
double>();
1574 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%-7.2f\n") %
"Delta Strength"
1575 %
params[
"delta_strength"].as<
double>();
1579 if (
params[
"interaction"].as<string>().find(
"sutherland") != string::npos) {
1580 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%8.3e\n") %
"Interaction Strength"
1581 %
params[
"interaction_strength"].as<
double>();
1585 if ( (
params[
"interaction"].as<string>().find(
"harmonic") != string::npos) ) {
1586 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%-7.2f\n") %
"Harmonic Int. Freq."
1587 %
params[
"omega"].as<
double>();
1591 if ( (
params[
"interaction"].as<string>().find(
"hard_sphere") != string::npos) ||
1592 (
params[
"interaction"].as<
string>().find(
"hard_rod") != string::npos) ) {
1593 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%-7.2f\n") %
"Scattering Length"
1594 %
params[
"scattering_length"].as<
double>();
1597 %
"External Potential" %
params[
"external"].as<
string>();
1600 if (
params[
"external"].as<string>().find(
"hg_tube") != string::npos) {
1602 %
"HourGlass Radius" %
params[
"hourglass_radius"].as<
double>();
1604 %
"HourGlass Width" %
params[
"hourglass_width"].as<
double>();
1609 if (
params[
"external"].as<string>().find(
"graphene") != string::npos) {
1611 %
"Carbon Carbon Distance" %
params[
"carbon_carbon_dist"].as<
double>();
1613 %
"Graphene Strain %" %
params[
"strain"].as<
double>();
1615 %
"Graphene Poission Ratio %" %
params[
"poisson"].as<
double>();
1617 %
"Graphene-Carbon LJ Sigma" %
params[
"lj_sigma"].as<
double>();
1619 %
"Graphene-Carbon LJ Epsilon" %
params[
"lj_epsilon"].as<
double>();
1623 if (
params[
"external"].as<string>().find(
"plated") != string::npos) {
1625 %
"Plating Radial Width" %
params[
"lj_width"].as<
double>();
1627 %
"Plating LJ Sigma" %
params[
"lj_sigma"].as<
double>();
1629 %
"Plating LJ Epsilon" %
params[
"lj_epsilon"].as<
double>();
1631 %
"Plating LJ Density" %
params[
"lj_density"].as<
double>();
1636 %
"Wavefunction Type" %
params[
"wavefunction"].as<
string>();
1638 format(
"%-24s\t:\t%7.5f\n") %
"End Factor" %
params[
"end_factor"].as<
double>();
1640 if ( (
params[
"wavefunction"].as<string>().find(
"lieb") != string::npos) ) {
1641 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%-7.2f\n") %
"Wavefunction length scale"
1642 %
params[
"R_LL_wfn"].as<
double>();
1643 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%-7.4f\n") %
"Wavefunction wave number"
1644 %
params[
"k_LL_wfn"].as<
double>();
1648 format(
"%-24s\t:\t%7.5f\n") %
"Temperature" %
params[
"temperature"].as<
double>();
1650 format(
"%-24s\t:\t%7.5f\n") %
"Chemical Potential" %
constants()->
mu();
1652 format(
"%-24s\t:\t%7.5f\n") %
"Particle Mass" %
params[
"mass"].as<
double>();
1656 format(
"%-24s\t:\t%7.5f\n") %
"Specified Imaginary Time Step" %
params[
"imaginary_time_step"].as<
double>();
1658 format(
"%-24s\t:\t%7.5f\n") %
"Imaginary Time Step" %
constants()->
tau();
1662 format(
"%-24s\t:\t%d\n") %
"Initial Number Particles" %
params[
"number_particles"].as<
int>();
1664 format(
"%-24s\t:\t%7.5f\n") %
"Initial Density"
1665 % (1.0*
params[
"number_particles"].as<
int>()/boxPtr->
volume);
1667 format(
"%-24s\t:\t%d\n") %
"Num. Broken World-lines" %
params[
"number_broken"].as<
int>();
1668 if (
constants()->spatialSubregionOn()){
1670 format(
"%-24s\t:\t%d\n") %
"Spatial Subregion" %
params[
"spatial_subregion"].as<
double>();
1673 format(
"%-24s\t:\t%s\n") %
"Container Type" % boxPtr->
name;
1674 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t") %
"Container Dimensions";
1675 for (
int i = 0; i <
NDIM; i++) {
1682 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%7.5f\n") %
"Container Volume"
1684 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t") %
"Lookup Table";
1685 for (
int i = 0; i <
NDIM; i++) {
1693 format(
"%-24s\t:\t%d\n") %
"Maximum Winding Sector" %
params[
"max_winding"].as<
int>();
1694 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%7.5f\n") %
"Initial Worm Constant" %
1695 params[
"worm_constant"].as<
double>();
1697 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%7.5f\n") %
"Initial CoM Delta" %
params[
"com_delta"].as<
double>();
1700 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%7.5f\n") %
"Initial Displace Delta" %
params[
"displace_delta"].as<
double>();
1704 format(
"%-24s\t:\t%d\n") %
"Bisection Parameter" %
constants()->
b();
1706 format(
"%-24s\t:\t%d\n") %
"Update Length" %
constants()->
Mbar();
1708 format(
"%-24s\t:\t%7.5f\n") %
"Potential Cutoff Length" %
params[
"potential_cutoff"].as<
double>();
1710 format(
"%-24s\t:\t%d\n") %
"Bin Size" %
params[
"bin_size"].as<
int>();
1712 format(
"%-24s\t:\t%d\n") %
"Number EQ Steps" %
params[
"number_eq_steps"].as<
uint32>();
1714 format(
"%-24s\t:\t%d\n") %
"Number Bins Stored" %
params[
"number_bins_stored"].as<
int>();
1715 communicate()->
file(
"log")->stream() << format(
"%-24s\t:\t%d\n") %
"Random Number Seed" % _seed;
1716 if (
params[
"virial_window"].as<int>() == 0){
1722 format(
"%-24s\t:\t%d\n") %
"Virial Window" %
params[
"virial_window"].as<
int>();
1725 communicate()->
file(
"log")->stream() <<
"---------- End Simulation Parameters ------------" << endl;
Action class definitions.
Holds a base class that all action classes will be derived from.
Computes the value of the semi-empircal Aziz potential that is known to be accurate for He-4.
File * file(string type)
Get method returning file object.
void init(double, bool, string, string)
Initialize the output files.
int numTimeSlices()
Get number of time slices.
double mu() const
Get chemical potential.
void setCoMDelta(double _comDelta)
Set the CoM move size.
double displaceDelta() const
Get center of mass shift.
double imagTimeLength() const
Get the extent in imaginary time.
string id()
Get simulation UUID.
void initConstants(po::variables_map &)
Initialize all constants from command line, XMl and defaults.
double C0() const
Get worm factor C0.
double tau() const
Get imaginary time step.
int b()
Get bisection level.
double comDelta() const
Get center of mass shift.
string actionType() const
Get wave action type.
void setDisplaceDelta(double _displaceDelta)
Set the displace move size.
The base class which holds details on the generalized box that our system will be simulated inside of...
double volume
The volume of the container in A^3.
string name
The name of the container.
dVec side
The linear dimensions of the box.
A three dimensional cylinder with fixed boundary conditions in the x and y directions and periodic bo...
Computes the effective potential from the exact two-body density matrix for delta interactions in 1D.
Computes the potential energy for delta function interaction potential, approximated here as the limi...
Computes the potential energy for polarized electrical dipoles with strength D in reduced units where...
The base class that all estimator classes will be derived from.
Computes the potential energy resulting from a series of fixed helium atoms that are not updated and ...
Returns Lennard-Jones potential between adatoms and fixed postions in FILENAME.
Computes potential energy for Gasparini potential.
FIXME Returns van der Waals' potential between a helium adatom and a graphene sheet using summation i...
FIXME Returns van der Waals' potential between a helium adatom and a graphene sheet using summation i...
FIXME Returns van der Waals' potential between a helium adatom and a graphene sheet using summation i...
Returns van der Waals' potential between a helium adatom and a graphene sheet using summation in reci...
Returns van der Waals' potential between a helium adatom and a graphene sheet using summation in reci...
The smooth non-corregated version of the helium-carbon nanotube potential.
Computes the value of the external wall potential for a hard-walled cylindrical cavity.
Computes the effective potential from the exact two-body density matrix for hard rods in 1D.
Computes the effective potential from the exact two-body density matrix for hard spheres in 3D.
Computes the potential energy for an external harmonic potential with axial symmetry.
Computes the potential energy for an external harmonic potential.
Implementation of a Jastrow trial wave function suitable for He.
Computes the value of the external wall potential for a cylindrical cavity.
Computes the value of the external wall potential for an hour-glass shaped cavity.
Implementation of a Jastrow trial wave function suitable for He.
A base class to be inherited by actions that are local in imaginary time.
The particle (bead) lookup table.
Computes the potential energy for delta function interaction potential, approximated here as the limi...
A base class to be inherited by actions that are non-local in imaginary time.
void print()
print out the parameter map
void set(const string &, const Ttype)
Set a parameter from a value.
void update(int, char *[], po::options_description &)
Update parameters from command line.
void add(string, string, string)
Add a parameter to the map without a default value.
void setupCommandLine(boost::ptr_map< string, po::options_description > &)
Insert options into the options_description data structure to be read from the command line.
The space-time trajectories.
Computes the value of the external wall potential for a plated cylindrical cavity.
The base class from which all specific potentials are derived from.
A NDIM-dimensional hyperprism with periodic boundary conditions.
Implementation of the Psi_T = sech(a*x) trial wave function suitable for the simple harmonic osscilat...
ActionBase * action(const Path &, LookupTable &, PotentialBase *, PotentialBase *, WaveFunctionBase *)
Setup the action.
Setup()
Setup the program_options variables.
uint32 seed(const uint32)
Return the random seed.
bool parseOptions()
Parse the command line options for obvious errors and return values.
PotentialBase * interactionPotential(const Container *)
Setup the interaction potential.
WaveFunctionBase * waveFunction(const Path &, LookupTable &)
Setup the trial wave function.
void setConstants()
Setup the simulation constants.
void outputOptions(int, char *[], const uint32, const Container *, const iVec &)
Output the simulation parameters to a log file.
void communicator()
Setup the communicator.
boost::ptr_vector< EstimatorBase > * estimators(Path &, ActionBase *, MTRand &)
Create a list of estimators to be measured.
void getOptions(int, char *[])
Define all command line options and get them from the command line.
boost::ptr_vector< MoveBase > * moves(Path &, ActionBase *, MTRand &)
Define the Monte Carlo updates that will be performed.
Parameters params
All simulation parameters.
Container * cell()
Setup the simulation cell.
bool worldlines()
Setup the worldlines.
PotentialBase * externalPotential(const Container *)
Setup the external potential.
Computes the potential energy for an external single well potential.
Computes the potential energy for the periodic Sutherland model which approximates long-range 1/r^2 i...
Implementation of the Sutherland model exact wavefunction.
Computes the value of the semi-empircal Szalewicz potential that is known to be accurate for He-4.
Holds a base class that all trial wave function classes will be derived from.
#define NDIM
Number of spatial dimnsions.
unsigned long uint32
Unsigned integer type, at least 32 bits.
#define EPS
A small number.
TinyVector< double, NDIM > dVec
A NDIM-vector of type double.
TinyVector< int, NDIM > iVec
A NDIM-vector of type integer.
Class definitions for all file input/output.
Communicator * communicate()
Global public access to the communcator singleton.
ConstantParameters class definition.
ConstantParameters * constants()
Global public access to the constants.
Estimator class definitions.
All possible potential classes.
string getList(const vector< string > &options)
Create a comma separated list from a vector of strings.
ostream & operator<<(ostream &os, const vector< string > &vals)
Overload << to print a vector of strings to the terminal.
Parses command line input and sets up the details of the simulation.
Action class definitions.