00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "QMCFlags.h"
00015 #include "QMCLineSearchStepLengthSelectionAlgorithm.h"
00016 #include "QMCLineSearchStepLengthSelectionFactory.h"
00017
00018 QMCFlags::QMCFlags()
00019 {
00020 my_rank = 0;
00021 nprocs = 1;
00022 }
00023
00024 void QMCFlags::read_flags(string InFileName)
00025 {
00026
00027
00028
00029
00030 run_type = "variational";
00031 dt = 0.01;
00032 accel_delta = 5;
00033 accel_tm = 0.5*3.14159265359;
00034
00035 desired_convergence = 0.0;
00036 max_time_steps = 2000000;
00037 max_time = -1.0;
00038 number_of_walkers = 100;
00039 one_e_per_iter = 0;
00040 use_surfer = 0;
00041 set_debug = 0;
00042
00043
00044 walker_initialization_method = "dans_walker_initialization";
00045 walker_initialization_combinations = 3;
00046 dt_equilibration = 0.01;
00047 equilibration_steps = 2000;
00048 equilibration_function = "ramp";
00049 CKAnnealingEquilibration1_parameter = 500;
00050 use_equilibration_array = 0;
00051
00052
00053 branching_method = "nonunit_weight_branching";
00054 walker_reweighting_method = "umrigar93_probability_weighted";
00055 branching_threshold = 2.0;
00056 fusion_threshold = 0.45;
00057 correct_population_size_bias = 1;
00058 population_control_parameter = 1.0;
00059 old_walker_acceptance_parameter = 50;
00060 warn_verbosity = 1;
00061 rel_cutoff = 100.0;
00062 limit_branching = 1;
00063
00064
00065 sampling_method = "umrigar93_importance_sampling";
00066 QF_modification_type = "umrigar93_unequalelectrons";
00067 energy_modification_type = "umrigar93";
00068 energy_cutoff_type = "umrigar93";
00069 umrigar93_equalelectrons_parameter = 0.5;
00070 synchronize_dmc_ensemble = 0;
00071 synchronize_dmc_ensemble_interval = 1000;
00072
00073
00074 trial_function_type = "restricted";
00075 Ndeterminants = 1;
00076
00077
00078 replace_electron_nucleus_cusps = 1;
00079 calculate_bf_density = 0;
00080 use_hf_potential = 0;
00081 hf_num_average = 100;
00082 lock_trial_energy = 0;
00083 nuclear_derivatives = "none";
00084 vector<double> fwInvHartrees;
00085 fwInvHartrees.clear();
00086 fwInvHartrees.push_back(0);
00087
00088
00089 parallelization_method = "manager_worker";
00090 iseed = 0;
00091 use_basis_function_interpolation = 0;
00092 number_basis_function_interpolation_grid_points = 1000;
00093 basis_function_interpolation_first_point = 1e-10;
00094 psuedo_gridLevel = 1;
00095 psuedo_cutoff = 1e-4;
00096 use_psuedopotential = 0;
00097 walkers_per_pass = 1;
00098 mpireduce_interval = 100;
00099 mpipoll_interval = 5;
00100
00101
00102 output_interval = 1000;
00103 checkpoint_interval = 100000;
00104 checkpoint = 0;
00105 use_available_checkpoints = 0;
00106 checkin_file_name = "";
00107 checkout_file_name = "";
00108 zero_out_checkpoint_statistics = 0;
00109 checkpoint_energy_only = 0;
00110 print_transient_properties = 0;
00111 print_transient_properties_interval = 10000;
00112 print_configs = 0;
00113 print_config_frequency = 50;
00114 temp_dir = "./";
00115 write_all_energies_out = 0;
00116 write_electron_densities = 0;
00117 max_pair_distance = -1;
00118
00119 writePllxCorrelationDiagram = 0;
00120 writePllyCorrelationDiagram = 0;
00121 writePllzCorrelationDiagram = 0;
00122 writeOppxCorrelationDiagram = 0;
00123 writeOppyCorrelationDiagram = 0;
00124 writeOppzCorrelationDiagram = 0;
00125
00126
00127 optimize_Psi = 0;
00128 max_optimize_Psi_steps = 30;
00129 optimize_Psi_barrier_parameter = 1.0;
00130 calculate_Derivatives = 0;
00131 optimize_Psi_criteria = "generalized_eigenvector";
00132 optimize_Psi_method = "automatic";
00133 a_diag = -1e-5;
00134 ksi = 0.5;
00135 equilibrate_every_opt_step = 1;
00136 equilibrate_first_opt_step = 1;
00137 numerical_derivative_surface = "umrigar88";
00138 line_search_step_length = "None";
00139 optimization_max_iterations = 100;
00140 optimization_error_tolerance = 0.001;
00141 ck_genetic_algorithm_1_population_size = 1000;
00142 ck_genetic_algorithm_1_mutation_rate = 0.2;
00143 ck_genetic_algorithm_1_initial_distribution_deviation = 1.0;
00144 singularity_penalty_function_parameter = 1.0e-6;
00145
00146 optimize_EE_Jastrows = 1;
00147 optimize_EN_Jastrows = 1;
00148 optimize_NEE_Jastrows = 1;
00149 optimize_L = 1;
00150 optimize_CI = 1;
00151 optimize_Orbitals = 0;
00152 link_Jastrow_parameters = 1;
00153 link_NEE_Jastrows = 2;
00154 link_Orbital_parameters = 1;
00155 constrain_Orbital_zeros = 1;
00156 constrain_Orbital_same = 0;
00157 link_Determinant_parameters = 1;
00158
00159 use_three_body_jastrow = 0;
00160 use_jastrow = 1;
00161 detailed_energies = -1;
00162 reproduce_NE_with_NEE_jastrow = 0;
00163 reproduce_EE_with_NEE_jastrow = 0;
00164
00165
00166 programmersLongs.clear();
00167 chip_and_mike_are_cool = "false";
00168
00169
00170
00171
00172 ifstream input_file(InFileName.c_str());
00173 string temp_string;
00174
00175 if(!input_file)
00176 {
00177 cerr << "ERROR: Can't open input " << InFileName.c_str() << endl;
00178 exit(1);
00179 }
00180
00181 input_file >> temp_string;
00182 while(temp_string != "&flags")
00183 {
00184 input_file >> temp_string;
00185 }
00186
00187
00188 input_file >> temp_string;
00189
00190 while((temp_string != "&") && (input_file.eof() != 1))
00191 {
00192 if(temp_string == "run_type")
00193 {
00194 input_file >> run_type;
00195 }
00196 else if(temp_string == "use_surfer")
00197 {
00198 input_file >> temp_string;
00199 use_surfer = atoi(temp_string.c_str());
00200 }
00201 else if(temp_string == "set_debug")
00202 {
00203 input_file >> temp_string;
00204 set_debug = atoi(temp_string.c_str());
00205 }
00206 else if(temp_string == "one_e_per_iter")
00207 {
00208 input_file >> temp_string;
00209 one_e_per_iter = atoi(temp_string.c_str());
00210 }
00211 else if(temp_string == "temp_dir")
00212 {
00213 input_file >> temp_dir;
00214 }
00215 else if(temp_string == "parallelization_method")
00216 {
00217 input_file >> parallelization_method;
00218 }
00219 else if(temp_string == "walker_initialization_method")
00220 {
00221 input_file >> walker_initialization_method;
00222 }
00223 else if(temp_string == "walker_initialization_combinations")
00224 {
00225 input_file >> temp_string;
00226 walker_initialization_combinations = atoi(temp_string.c_str());
00227 }
00228 else if(temp_string == "iseed")
00229 {
00230
00231
00232
00233 input_file >> temp_string;
00234 iseed = atol(temp_string.c_str());
00235 }
00236 else if(temp_string == "sampling_method")
00237 {
00238 input_file >> sampling_method;
00239 }
00240 else if(temp_string == "nuclear_derivatives")
00241 {
00242 input_file >> nuclear_derivatives;
00243 }
00244 else if(temp_string == "QF_modification_type")
00245 {
00246 input_file >> QF_modification_type;
00247 }
00248 else if(temp_string == "energy_modification_type")
00249 {
00250 input_file >> energy_modification_type;
00251 }
00252 else if(temp_string == "energy_cutoff_type")
00253 {
00254 input_file >> energy_cutoff_type;
00255 }
00256 else if(temp_string == "umrigar93_equalelectrons_parameter")
00257 {
00258 input_file >> temp_string;
00259 umrigar93_equalelectrons_parameter = atof(temp_string.c_str());
00260 }
00261 else if(temp_string == "walker_reweighting_method")
00262 {
00263 input_file >> walker_reweighting_method;
00264 }
00265 else if(temp_string == "branching_method")
00266 {
00267 input_file >> branching_method;
00268 }
00269 else if(temp_string == "branching_threshold")
00270 {
00271 input_file >> temp_string;
00272 branching_threshold = atof(temp_string.c_str());
00273 }
00274 else if(temp_string == "fusion_threshold")
00275 {
00276 input_file >> temp_string;
00277 fusion_threshold = atof(temp_string.c_str());
00278 }
00279 else if(temp_string == "synchronize_dmc_ensemble")
00280 {
00281 input_file >> temp_string;
00282 synchronize_dmc_ensemble = atoi(temp_string.c_str());
00283 }
00284 else if(temp_string == "synchronize_dmc_ensemble_interval")
00285 {
00286 input_file >> temp_string;
00287 synchronize_dmc_ensemble_interval = atoi(temp_string.c_str());
00288 }
00289 else if(temp_string == "old_walker_acceptance_parameter")
00290 {
00291 input_file >> temp_string;
00292 old_walker_acceptance_parameter = atoi(temp_string.c_str());
00293 }
00294 else if(temp_string == "warn_verbosity")
00295 {
00296 input_file >> temp_string;
00297 warn_verbosity = atoi(temp_string.c_str());
00298 }
00299 else if(temp_string == "rel_cutoff")
00300 {
00301 input_file >> temp_string;
00302 rel_cutoff = atof(temp_string.c_str());
00303 }
00304 else if(temp_string == "limit_branching")
00305 {
00306 input_file >> temp_string;
00307 limit_branching = atoi(temp_string.c_str());
00308 }
00309 else if(temp_string == "use_basis_function_interpolation")
00310 {
00311 input_file >> temp_string;
00312 use_basis_function_interpolation = atoi(temp_string.c_str());
00313 }
00314 else if(temp_string == "number_basis_function_interpolation_grid_points")
00315 {
00316 input_file >> temp_string;
00317 number_basis_function_interpolation_grid_points =
00318 atoi(temp_string.c_str());
00319 }
00320 else if(temp_string == "basis_function_interpolation_first_point")
00321 {
00322 input_file >> temp_string;
00323 basis_function_interpolation_first_point = atof(temp_string.c_str());
00324 }
00325 else if(temp_string == "dt")
00326 {
00327 input_file >> temp_string;
00328 dt = atof(temp_string.c_str());
00329 }
00330 else if(temp_string == "accel_delta")
00331 {
00332 input_file >> temp_string;
00333 accel_delta = atof(temp_string.c_str());
00334 }
00335 else if(temp_string == "accel_tm")
00336 {
00337 input_file >> temp_string;
00338 accel_tm = atof(temp_string.c_str());
00339 }
00340 else if(temp_string == "desired_convergence")
00341 {
00342 input_file >> temp_string;
00343 desired_convergence = atof(temp_string.c_str());
00344 }
00345 else if(temp_string == "max_time_steps")
00346 {
00347 input_file >> temp_string;
00348 max_time_steps = atol(temp_string.c_str());
00349 original_max_time_steps = max_time_steps;
00350 }
00351 else if(temp_string == "max_time")
00352 {
00353 input_file >> temp_string;
00354 max_time = atof(temp_string.c_str());
00355 }
00356 else if(temp_string == "future_walking")
00357 {
00358 input_file >> ws;
00359 while(input_file.peek() >= '0' && input_file.peek() <= '9')
00360 {
00361 input_file >> temp_string;
00362 fwInvHartrees.push_back(atof(temp_string.c_str()));
00363 input_file >> ws;
00364 }
00365 }
00366 else if(temp_string == "walkers_per_pass")
00367 {
00368 input_file >> temp_string;
00369 walkers_per_pass = atol(temp_string.c_str());
00370 }
00371 else if(temp_string == "gpu_walkers_per_pass")
00372 {
00373 input_file >> temp_string;
00374 gpu_walkers_per_pass = atol(temp_string.c_str());
00375 }
00376 else if(temp_string == "number_of_walkers")
00377 {
00378 input_file >> temp_string;
00379 number_of_walkers = atol(temp_string.c_str());
00380 }
00381 else if(temp_string == "output_interval")
00382 {
00383 input_file >> temp_string;
00384 output_interval = atoi(temp_string.c_str());
00385 }
00386 else if(temp_string == "checkpoint_interval")
00387 {
00388 input_file >> temp_string;
00389 checkpoint_interval = atoi(temp_string.c_str());
00390 }
00391 else if(temp_string == "checkpoint")
00392 {
00393 input_file >> temp_string;
00394 checkpoint = atoi(temp_string.c_str());
00395 }
00396 else if(temp_string == "use_available_checkpoints")
00397 {
00398 input_file >> temp_string;
00399 use_available_checkpoints = atoi(temp_string.c_str());
00400 }
00401 else if(temp_string == "checkpoint_input_name")
00402 {
00403 input_file >> checkin_file_name;
00404 }
00405 else if(temp_string == "checkpoint_output_name")
00406 {
00407 input_file >> checkout_file_name;
00408 }
00409 else if(temp_string == "checkpoint_energy_only")
00410 {
00411 input_file >> temp_string;
00412 checkpoint_energy_only = atoi(temp_string.c_str());
00413 }
00414 else if(temp_string == "equilibration_steps")
00415 {
00416 input_file >> temp_string;
00417 equilibration_steps = atoi(temp_string.c_str());
00418 }
00419 else if(temp_string == "dt_equilibration")
00420 {
00421 input_file >> temp_string;
00422 dt_equilibration = atof(temp_string.c_str());
00423 }
00424 else if(temp_string == "equilibration_function")
00425 {
00426 input_file >> equilibration_function;
00427 }
00428 else if(temp_string == "CKAnnealingEquilibration1_parameter")
00429 {
00430 input_file >> temp_string;
00431 CKAnnealingEquilibration1_parameter = atoi(temp_string.c_str());
00432 }
00433 else if (temp_string == "use_equilibration_array")
00434 {
00435 input_file >> temp_string;
00436 use_equilibration_array = atoi(temp_string.c_str());
00437 }
00438 else if(temp_string == "mpireduce_interval")
00439 {
00440 input_file >> temp_string;
00441 mpireduce_interval = atoi(temp_string.c_str());
00442 }
00443 else if(temp_string == "mpipoll_interval")
00444 {
00445 input_file >> temp_string;
00446 mpipoll_interval = atoi(temp_string.c_str());
00447 }
00448 else if(temp_string == "atoms")
00449 {
00450 input_file >> temp_string;
00451 Natoms = atoi(temp_string.c_str());
00452 }
00453 else if(temp_string == "charge")
00454 {
00455 input_file >> temp_string;
00456 charge = atoi(temp_string.c_str());
00457 }
00458 else if(temp_string == "norbitals")
00459 {
00460 input_file >> temp_string;
00461 Norbitals = atoi(temp_string.c_str());
00462 }
00463 else if(temp_string == "nbasisfunc")
00464 {
00465 input_file >> temp_string;
00466 Nbasisfunc = atoi(temp_string.c_str());
00467 }
00468 else if(temp_string == "ndeterminants")
00469 {
00470 input_file >> temp_string;
00471 Ndeterminants = atoi(temp_string.c_str());
00472 }
00473 else if(temp_string == "trial_function_type")
00474 {
00475 input_file >> trial_function_type;
00476 }
00477 else if(temp_string == "psuedo_gridLevel")
00478 {
00479 input_file >> temp_string;
00480 psuedo_gridLevel = atoi(temp_string.c_str());
00481 }
00482 else if(temp_string == "psuedo_cutoff")
00483 {
00484 input_file >> temp_string;
00485 psuedo_cutoff = atof(temp_string.c_str());
00486 }
00487 else if(temp_string == "calculate_bf_density")
00488 {
00489 input_file >> temp_string;
00490 calculate_bf_density = atoi(temp_string.c_str());
00491 }
00492 else if(temp_string == "energy")
00493 {
00494 input_file >> temp_string;
00495 energy_trial = atof(temp_string.c_str());
00496 }
00497 else if(temp_string == "correct_population_size_bias")
00498 {
00499 input_file >> temp_string;
00500 correct_population_size_bias = atoi(temp_string.c_str());
00501 }
00502 else if(temp_string == "print_transient_properties")
00503 {
00504 input_file >> temp_string;
00505 print_transient_properties = atoi(temp_string.c_str());
00506 }
00507 else if(temp_string == "print_transient_properties_interval")
00508 {
00509 input_file >> temp_string;
00510 print_transient_properties_interval = atoi(temp_string.c_str());
00511 }
00512 else if(temp_string == "print_configs")
00513 {
00514 input_file >> temp_string;
00515 print_configs = atoi(temp_string.c_str());
00516 }
00517 else if(temp_string == "print_config_frequency")
00518 {
00519 input_file >> temp_string;
00520 print_config_frequency = atoi(temp_string.c_str());
00521 }
00522 else if(temp_string == "optimize_Psi")
00523 {
00524 input_file >> temp_string;
00525 optimize_Psi = atoi(temp_string.c_str());
00526 }
00527 else if(temp_string == "optimize_EE_Jastrows")
00528 {
00529 input_file >> temp_string;
00530 optimize_EE_Jastrows = atoi(temp_string.c_str());
00531 }
00532 else if(temp_string == "optimize_EN_Jastrows")
00533 {
00534 input_file >> temp_string;
00535 optimize_EN_Jastrows = atoi(temp_string.c_str());
00536 }
00537 else if(temp_string == "optimize_NEE_Jastrows")
00538 {
00539 input_file >> temp_string;
00540 optimize_NEE_Jastrows = atoi(temp_string.c_str());
00541 }
00542 else if(temp_string == "use_three_body_jastrow")
00543 {
00544 input_file >> temp_string;
00545 use_three_body_jastrow = atoi(temp_string.c_str());
00546 }
00547 else if(temp_string == "reproduce_NE_with_NEE_jastrow")
00548 {
00549 input_file >> temp_string;
00550 reproduce_NE_with_NEE_jastrow = atoi(temp_string.c_str());
00551 }
00552 else if(temp_string == "reproduce_EE_with_NEE_jastrow")
00553 {
00554 input_file >> temp_string;
00555 reproduce_EE_with_NEE_jastrow = atoi(temp_string.c_str());
00556 }
00557 else if(temp_string == "optimize_L")
00558 {
00559 input_file >> temp_string;
00560 optimize_L = atoi(temp_string.c_str());
00561 }
00562 else if(temp_string == "optimize_CI")
00563 {
00564 input_file >> temp_string;
00565 optimize_CI = atoi(temp_string.c_str());
00566 }
00567 else if(temp_string == "optimize_Orbitals")
00568 {
00569 input_file >> temp_string;
00570 optimize_Orbitals = atoi(temp_string.c_str());
00571 }
00572 else if(temp_string == "optimize_Psi_barrier_parameter")
00573 {
00574 input_file >> temp_string;
00575 optimize_Psi_barrier_parameter = atof(temp_string.c_str());
00576 }
00577 else if(temp_string == "max_optimize_Psi_steps")
00578 {
00579 input_file >> temp_string;
00580 max_optimize_Psi_steps = atoi(temp_string.c_str());
00581 }
00582 else if(temp_string == "optimize_Psi_criteria")
00583 {
00584 input_file >> optimize_Psi_criteria;
00585 }
00586 else if(temp_string == "optimize_Psi_method")
00587 {
00588 input_file >> optimize_Psi_method;
00589 }
00590 else if(temp_string == "a_diag")
00591 {
00592 input_file >> temp_string;
00593 a_diag = atof(temp_string.c_str());
00594 }
00595 else if(temp_string == "ksi")
00596 {
00597 input_file >> temp_string;
00598 ksi = atof(temp_string.c_str());
00599 }
00600 else if(temp_string == "singularity_penalty_function_parameter")
00601 {
00602 input_file >> temp_string;
00603 singularity_penalty_function_parameter = atof(temp_string.c_str());
00604 }
00605 else if(temp_string == "line_search_step_length")
00606 {
00607 input_file >> line_search_step_length;
00608 }
00609 else if(temp_string == "optimization_max_iterations")
00610 {
00611 input_file >> temp_string;
00612 optimization_max_iterations = atoi(temp_string.c_str());
00613 }
00614 else if(temp_string == "optimization_error_tolerance")
00615 {
00616 input_file >> temp_string;
00617 optimization_error_tolerance = atof(temp_string.c_str());
00618 }
00619 else if(temp_string == "ck_genetic_algorithm_1_population_size")
00620 {
00621 input_file >> temp_string;
00622 ck_genetic_algorithm_1_population_size = atoi(temp_string.c_str());
00623 }
00624 else if(temp_string == "ck_genetic_algorithm_1_mutation_rate")
00625 {
00626 input_file >> temp_string;
00627 ck_genetic_algorithm_1_mutation_rate = atof(temp_string.c_str());
00628 }
00629 else if(temp_string ==
00630 "ck_genetic_algorithm_1_initial_distribution_deviation")
00631 {
00632 input_file >> temp_string;
00633 ck_genetic_algorithm_1_initial_distribution_deviation =
00634 atof(temp_string.c_str());
00635 }
00636 else if(temp_string == "numerical_derivative_surface")
00637 {
00638 input_file >> numerical_derivative_surface;
00639 }
00640 else if(temp_string == "link_Jastrow_parameters")
00641 {
00642 input_file >> temp_string;
00643 link_Jastrow_parameters = atoi(temp_string.c_str());
00644 }
00645 else if(temp_string == "link_NEE_Jastrows")
00646 {
00647 input_file >> temp_string;
00648 link_NEE_Jastrows = atoi(temp_string.c_str());
00649 }
00650 else if(temp_string == "link_Orbital_parameters")
00651 {
00652 input_file >> temp_string;
00653 link_Orbital_parameters = atoi(temp_string.c_str());
00654 }
00655 else if(temp_string == "constrain_Orbital_zeros")
00656 {
00657 input_file >> temp_string;
00658 constrain_Orbital_zeros = atoi(temp_string.c_str());
00659 }
00660 else if(temp_string == "constrain_Orbital_same")
00661 {
00662 input_file >> temp_string;
00663 constrain_Orbital_same = atoi(temp_string.c_str());
00664 }
00665 else if(temp_string == "link_Determinant_parameters")
00666 {
00667 input_file >> temp_string;
00668 link_Determinant_parameters = atoi(temp_string.c_str());
00669 }
00670 else if(temp_string == "replace_electron_nucleus_cusps")
00671 {
00672 input_file >> temp_string;
00673 replace_electron_nucleus_cusps = atoi(temp_string.c_str());
00674 }
00675 else if(temp_string == "equilibrate_every_opt_step")
00676 {
00677 input_file >> temp_string;
00678 equilibrate_every_opt_step = atoi(temp_string.c_str());
00679 }
00680 else if(temp_string == "equilibrate_first_opt_step")
00681 {
00682 input_file >> temp_string;
00683 equilibrate_first_opt_step = atoi(temp_string.c_str());
00684 }
00685 else if(temp_string == "population_control_parameter")
00686 {
00687 input_file >> temp_string;
00688 population_control_parameter = atof(temp_string.c_str());
00689 }
00690 else if(temp_string == "write_electron_densities")
00691 {
00692 input_file >> temp_string;
00693 write_electron_densities = atoi(temp_string.c_str());
00694 }
00695 else if(temp_string == "max_pair_distance")
00696 {
00697 input_file >> temp_string;
00698 max_pair_distance = atof(temp_string.c_str());
00699 }
00700 else if(temp_string == "writePllxCorrelationDiagram")
00701 {
00702 input_file >> temp_string;
00703 writePllxCorrelationDiagram = atoi(temp_string.c_str());
00704 }
00705 else if(temp_string == "pllxCorrelationDiagramMin")
00706 {
00707 input_file >> temp_string;
00708 pllxCorrelationDiagramMin = atof(temp_string.c_str());
00709 }
00710 else if(temp_string == "pllxCorrelationDiagramMax")
00711 {
00712 input_file >> temp_string;
00713 pllxCorrelationDiagramMax = atof(temp_string.c_str());
00714 }
00715 else if(temp_string == "writePllyCorrelationDiagram")
00716 {
00717 input_file >> temp_string;
00718 writePllyCorrelationDiagram = atoi(temp_string.c_str());
00719 }
00720 else if(temp_string == "pllyCorrelationDiagramMin")
00721 {
00722 input_file >> temp_string;
00723 pllyCorrelationDiagramMin = atof(temp_string.c_str());
00724 }
00725 else if(temp_string == "pllyCorrelationDiagramMax")
00726 {
00727 input_file >> temp_string;
00728 pllyCorrelationDiagramMax = atof(temp_string.c_str());
00729 }
00730 else if(temp_string == "writePllzCorrelationDiagram")
00731 {
00732 input_file >> temp_string;
00733 writePllzCorrelationDiagram = atoi(temp_string.c_str());
00734 }
00735 else if(temp_string == "pllzCorrelationDiagramMin")
00736 {
00737 input_file >> temp_string;
00738 pllzCorrelationDiagramMin = atof(temp_string.c_str());
00739 }
00740 else if(temp_string == "pllzCorrelationDiagramMax")
00741 {
00742 input_file >> temp_string;
00743 pllzCorrelationDiagramMax = atof(temp_string.c_str());
00744 }
00745 else if(temp_string == "writeOppxCorrelationDiagram")
00746 {
00747 input_file >> temp_string;
00748 writeOppxCorrelationDiagram = atoi(temp_string.c_str());
00749 }
00750 else if(temp_string == "oppxCorrelationDiagramMin")
00751 {
00752 input_file >> temp_string;
00753 oppxCorrelationDiagramMin = atof(temp_string.c_str());
00754 }
00755 else if(temp_string == "oppxCorrelationDiagramMax")
00756 {
00757 input_file >> temp_string;
00758 oppxCorrelationDiagramMax = atof(temp_string.c_str());
00759 }
00760 else if(temp_string == "writeOppyCorrelationDiagram")
00761 {
00762 input_file >> temp_string;
00763 writeOppyCorrelationDiagram = atoi(temp_string.c_str());
00764 }
00765 else if(temp_string == "oppyCorrelationDiagramMin")
00766 {
00767 input_file >> temp_string;
00768 oppyCorrelationDiagramMin = atof(temp_string.c_str());
00769 }
00770 else if(temp_string == "oppyCorrelationDiagramMax")
00771 {
00772 input_file >> temp_string;
00773 oppyCorrelationDiagramMax = atof(temp_string.c_str());
00774 }
00775 else if(temp_string == "writeOppzCorrelationDiagram")
00776 {
00777 input_file >> temp_string;
00778 writeOppzCorrelationDiagram = atoi(temp_string.c_str());
00779 }
00780 else if(temp_string == "oppzCorrelationDiagramMin")
00781 {
00782 input_file >> temp_string;
00783 oppzCorrelationDiagramMin = atof(temp_string.c_str());
00784 }
00785 else if(temp_string == "oppzCorrelationDiagramMax")
00786 {
00787 input_file >> temp_string;
00788 oppzCorrelationDiagramMax = atof(temp_string.c_str());
00789 }
00790 else if(temp_string == "write_all_energies_out")
00791 {
00792 input_file >> temp_string;
00793 write_all_energies_out = atoi(temp_string.c_str());
00794 }
00795 else if(temp_string == "zero_out_checkpoint_statistics" )
00796 {
00797 input_file >> temp_string;
00798 zero_out_checkpoint_statistics = atoi(temp_string.c_str());
00799 }
00800 else if(temp_string == "programmers_longs" )
00801 {
00802 input_file >> ws;
00803 while(input_file.peek() >= '0' && input_file.peek() <= '9')
00804 {
00805 input_file >> temp_string;
00806 programmersLongs.push_back(atol(temp_string.c_str()));
00807 input_file >> ws;
00808 }
00809 }
00810 else if(temp_string == "chip_and_mike_are_cool")
00811 {
00812 input_file >> chip_and_mike_are_cool;
00813 }
00814 else if(temp_string == "use_hf_potential")
00815 {
00816 input_file >> temp_string;
00817 use_hf_potential = atoi(temp_string.c_str());
00818 }
00819 else if(temp_string == "hf_num_average")
00820 {
00821 input_file >> temp_string;
00822 hf_num_average = atoi(temp_string.c_str());
00823 }
00824 else if(temp_string == "lock_trial_energy")
00825 {
00826 input_file >> temp_string;
00827 lock_trial_energy = atoi(temp_string.c_str());
00828 }
00829 else if(temp_string.find("#",0) != string::npos)
00830 {
00831
00832
00833
00834 while(input_file.peek() != '\n')
00835 {
00836
00837
00838 input_file.get();
00839 }
00840 }
00841 else
00842 {
00843 clog << "Warning: Unknown input flag: " << temp_string << endl;
00844 }
00845 input_file >> temp_string;
00846 }
00847 input_file.close();
00848
00849 if(!checkFlags())
00850 {
00851 clog << "Error: serious flaws with parameter choices; no fix available." << endl;
00852 exit(1);
00853 }
00854
00855
00856
00857
00858
00859
00860
00861
00862 sort(fwInvHartrees.begin(), fwInvHartrees.end());
00863 vector<double>::iterator last = unique(fwInvHartrees.begin(), fwInvHartrees.end());
00864 fwInvHartrees.erase(last,fwInvHartrees.end());
00865
00866
00867
00868 for(unsigned int i=0; i<fwInvHartrees.size(); i++)
00869 {
00870 future_walking.push_back( (int)(fwInvHartrees[i]/dt) );
00871 }
00872
00873 set_filenames(InFileName);
00874
00875 dt_effective = dt;
00876 dt_run = dt;
00877 dt = dt_equilibration;
00878 number_of_walkers_initial = number_of_walkers;
00879 energy_estimated = energy_trial;
00880 energy_estimated_original = energy_estimated;
00881 }
00882
00883 void QMCFlags::set_filenames(string runfile)
00884 {
00885 string tempstring;
00886 string basename;
00887 int restart_number = 0;
00888
00889 input_file_name = runfile;
00890 string file_name = input_file_name.substr(0,input_file_name.size()-5);
00891 base_file_name = file_name;
00892 output_file_name = file_name + ".qmc";
00893 results_file_name = file_name + ".rslts";
00894 density_file_name = file_name + ".density";
00895 force_file_name = file_name + ".force";
00896
00897 if(checkin_file_name == "")
00898 {
00899 checkin_file_name = base_file_name;
00900 }
00901 if(checkout_file_name == "")
00902 {
00903 checkout_file_name = base_file_name;
00904 }
00905
00906 char my_rank_string[32];
00907 #ifdef _WIN32
00908 _snprintf( my_rank_string, 32, "%d", my_rank );
00909 #else
00910 snprintf( my_rank_string, 32, "%d", my_rank );
00911 #endif
00912 config_file_name = temp_dir + base_file_name + "." +my_rank_string + ".cfgs";
00913
00914 basename = file_name;
00915 if(file_name[file_name.size()-3] == '.')
00916 {
00917 tempstring = file_name.substr(file_name.size()-2,file_name.size()-1);
00918 restart_number = atoi(tempstring.c_str());
00919 basename = input_file_name.substr(0,file_name.size()-3);
00920 }
00921
00922 restart_number += 1;
00923
00924 char Tens, Ones;
00925 int tens = restart_number/10;
00926 int ones = restart_number%10;
00927
00928 switch(tens)
00929 {
00930 case 0: Tens = '0'; break;
00931 case 1: Tens = '1'; break;
00932 case 2: Tens = '2'; break;
00933 case 3: Tens = '3'; break;
00934 case 4: Tens = '4'; break;
00935 case 5: Tens = '5'; break;
00936 case 6: Tens = '6'; break;
00937 case 7: Tens = '7'; break;
00938 case 8: Tens = '8'; break;
00939 case 9: Tens = '9'; break;
00940 default:
00941 {
00942 cerr << "Error in naming restart!" << endl;
00943 exit(1);
00944 }
00945 }
00946 switch(ones)
00947 {
00948 case 0: Ones = '0'; break;
00949 case 1: Ones = '1'; break;
00950 case 2: Ones = '2'; break;
00951 case 3: Ones = '3'; break;
00952 case 4: Ones = '4'; break;
00953 case 5: Ones = '5'; break;
00954 case 6: Ones = '6'; break;
00955 case 7: Ones = '7'; break;
00956 case 8: Ones = '8'; break;
00957 case 9: Ones = '9'; break;
00958 default:
00959 {
00960 cerr << "Error in naming restart!" << endl;
00961 exit(1);
00962 }
00963 }
00964
00965 restart_file_name = basename + '.' + Tens + Ones + ".ckmf";
00966 }
00967
00968 ostream& operator <<(ostream& strm, QMCFlags& flags)
00969 {
00970 strm.setf( ios::fixed );
00971 strm << "&flags" << endl;
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982 strm << "# Parameters for QMC\n";
00983 strm << "run_type\n " << flags.run_type << endl;
00984 strm << "dt\n " << flags.dt_run << endl;
00985 strm << "number_of_walkers\n " << flags.number_of_walkers_initial<< endl;
00986
00987 strm << "max_time_steps\n " << flags.max_time_steps << endl;
00988 strm << "max_time\n " << flags.max_time << endl;
00989 strm << "one_e_per_iter\n " << flags.one_e_per_iter << endl;
00990 strm << "desired_convergence\n " << flags.desired_convergence << endl;
00991 strm << "warn_verbosity\n " << flags.warn_verbosity << endl;
00992 strm << "rel_cutoff\n " << flags.rel_cutoff << endl;
00993 strm << "limit_branching\n " << flags.limit_branching << endl;
00994 strm << "\n# Parameters specific to the Green's function\n";
00995 strm << "sampling_method\n " << flags.sampling_method << endl;
00996 strm << "QF_modification_type\n " << flags.QF_modification_type << endl;
00997 strm << "umrigar93_equalelectrons_parameter\n "
00998 << flags.umrigar93_equalelectrons_parameter << endl;
00999 strm << "energy_modification_type\n "
01000 << flags.energy_modification_type << endl;
01001 strm << "energy_cutoff_type\n "
01002 << flags.energy_cutoff_type << endl;
01003 strm << "lock_trial_energy\n " << flags.lock_trial_energy << endl;
01004 strm << "synchronize_dmc_ensemble\n "
01005 << flags.synchronize_dmc_ensemble << endl;
01006 strm << "synchronize_dmc_ensemble_interval\n "
01007 << flags.synchronize_dmc_ensemble_interval << endl;
01008
01009 strm << "\n# Parameters specific to weights, branching, and fusion\n";
01010 strm << "walker_reweighting_method\n "
01011 << flags.walker_reweighting_method << endl;
01012 strm << "branching_method\n " << flags.branching_method << endl;
01013 strm << "branching_threshold\n " << flags.branching_threshold << endl;
01014 strm << "fusion_threshold\n " << flags.fusion_threshold << endl;
01015 strm << "population_control_parameter\n "
01016 << flags.population_control_parameter << endl;
01017 strm << "correct_population_size_bias\n "
01018 << flags.correct_population_size_bias << endl;
01019 strm << "old_walker_acceptance_parameter\n "
01020 << flags.old_walker_acceptance_parameter << endl;
01021
01022 strm << "\n# Parameters for initialization\n";
01023 strm << "dt_equilibration\n " << flags.dt_equilibration << endl;
01024 strm << "use_equilibration_array\n " << flags.use_equilibration_array << endl;
01025 strm << "equilibration_steps\n " << flags.equilibration_steps << endl;
01026 strm << "equilibration_function\n " << flags.equilibration_function << endl;
01027 strm << "CKAnnealingEquilibration1_parameter\n "
01028 << flags.CKAnnealingEquilibration1_parameter << endl;
01029 strm << "walker_initialization_method\n "
01030 << flags.walker_initialization_method << endl;
01031 strm << "walker_initialization_combinations\n "
01032 << flags.walker_initialization_combinations << endl;
01033
01034 strm << "\n# Parameters for added functionality/improvements\n";
01035 strm << "calculate_bf_density\n " << flags.calculate_bf_density << endl;
01036 strm << "use_hf_potential\n " << flags.use_hf_potential << endl;
01037 strm << "hf_num_average\n " << flags.hf_num_average << endl;
01038 strm << "replace_electron_nucleus_cusps\n "
01039 << flags.replace_electron_nucleus_cusps << endl;
01040 strm << "nuclear_derivatives\n " << flags.nuclear_derivatives << endl;
01041 if(flags.future_walking.size() > 0)
01042 {
01043 strm << "future_walking\n";
01044 for(unsigned int i=0; i<flags.future_walking.size(); i++)
01045 {
01046 strm << " " << (double)(flags.future_walking[i]*flags.dt);
01047 }
01048 strm << endl;
01049 }
01050
01051 strm << "\n# Parameters relating to output\n";
01052 strm << "output_interval\n " << flags.output_interval << endl;
01053 strm << "checkpoint\n " << flags.checkpoint << endl;
01054 strm << "checkpoint_interval\n " << flags.checkpoint_interval << endl;
01055
01056 if(flags.checkpoint)
01057 strm << "use_available_checkpoints\n "
01058 << 1 << endl;
01059 else
01060 strm << "use_available_checkpoints\n "
01061 << flags.use_available_checkpoints << endl;
01062
01063 strm << "checkpoint_input_name\n "
01064 << flags.checkout_file_name << endl;
01065 strm << "zero_out_checkpoint_statistics\n "
01066 << flags.zero_out_checkpoint_statistics << endl;
01067 strm << "checkpoint_energy_only\n " << flags.checkpoint_energy_only << endl;
01068 strm << "print_configs\n " << flags.print_configs << endl;
01069 strm << "print_config_frequency\n " << flags.print_config_frequency << endl;
01070 strm << "temp_dir\n " << flags.temp_dir << endl;
01071 strm << "write_all_energies_out\n " << flags.write_all_energies_out << endl;
01072 strm << "write_electron_densities\n "
01073 << flags.write_electron_densities << endl;
01074 strm << "max_pair_distance\n " << flags.max_pair_distance << endl;
01075 strm << "print_transient_properties\n "
01076 << flags.print_transient_properties << endl;
01077 strm << "print_transient_properties_interval\n "
01078 << flags.print_transient_properties_interval << endl;
01079
01080 strm << "writePllxCorrelationDiagram\n " << flags.writePllxCorrelationDiagram
01081 << endl;
01082 strm << "pllxCorrelationDiagramMin\n " << flags.pllxCorrelationDiagramMin
01083 << endl;
01084 strm << "pllxCorrelationDiagramMax\n " << flags.pllxCorrelationDiagramMax
01085 << endl;
01086 strm << "writePllyCorrelationDiagram\n " << flags.writePllyCorrelationDiagram
01087 << endl;
01088 strm << "pllyCorrelationDiagramMin\n " << flags.pllyCorrelationDiagramMin
01089 << endl;
01090 strm << "pllyCorrelationDiagramMax\n " << flags.pllyCorrelationDiagramMax
01091 << endl;
01092 strm << "writePllzCorrelationDiagram\n " << flags.writePllzCorrelationDiagram
01093 << endl;
01094 strm << "pllzCorrelationDiagramMin\n " << flags.pllzCorrelationDiagramMin
01095 << endl;
01096 strm << "pllzCorrelationDiagramMax\n " << flags.pllzCorrelationDiagramMax
01097 << endl;
01098
01099 strm << "writeOppxCorrelationDiagram\n " << flags.writeOppxCorrelationDiagram
01100 << endl;
01101 strm << "oppxCorrelationDiagramMin\n " << flags.oppxCorrelationDiagramMin
01102 << endl;
01103 strm << "oppxCorrelationDiagramMax\n " << flags.oppxCorrelationDiagramMax
01104 << endl;
01105 strm << "writeOppyCorrelationDiagram\n " << flags.writeOppyCorrelationDiagram
01106 << endl;
01107 strm << "oppyCorrelationDiagramMin\n " << flags.oppyCorrelationDiagramMin
01108 << endl;
01109 strm << "oppyCorrelationDiagramMax\n " << flags.oppyCorrelationDiagramMax
01110 << endl;
01111 strm << "writeOppzCorrelationDiagram\n " << flags.writeOppzCorrelationDiagram
01112 << endl;
01113 strm << "oppzCorrelationDiagramMin\n " << flags.oppzCorrelationDiagramMin
01114 << endl;
01115 strm << "oppzCorrelationDiagramMax\n " << flags.oppzCorrelationDiagramMax
01116 << endl;
01117
01118 strm << "\n# Parameters for wavefunction optimization\n";
01119 strm << "optimize_Psi\n " << flags.optimize_Psi << endl;
01120 strm << "optimize_EE_Jastrows\n " << flags.optimize_EE_Jastrows << endl;
01121 strm << "optimize_EN_Jastrows\n " << flags.optimize_EN_Jastrows << endl;
01122 strm << "optimize_NEE_Jastrows\n " << flags.optimize_NEE_Jastrows << endl;
01123 strm << "optimize_L\n " << flags.optimize_L << endl;
01124 strm << "optimize_CI\n " << flags.optimize_CI << endl;
01125 strm << "optimize_Orbitals\n " << flags.optimize_Orbitals << endl;
01126 strm << "optimize_Psi_method\n " << flags.optimize_Psi_method << endl;
01127 strm << "optimize_Psi_criteria\n " << flags.optimize_Psi_criteria << endl;
01128 strm << "a_diag\n " << flags.a_diag << endl;
01129 strm << "ksi\n " << flags.ksi << endl;
01130 strm << "max_optimize_Psi_steps\n " << flags.max_optimize_Psi_steps << endl;
01131 strm << "equilibrate_first_opt_step\n "
01132 << flags.equilibrate_first_opt_step << endl;
01133 strm << "equilibrate_every_opt_step\n "
01134 << flags.equilibrate_every_opt_step << endl;
01135 strm << "optimization_max_iterations\n "
01136 << flags.optimization_max_iterations << endl;
01137 strm << "optimization_error_tolerance\n "
01138 << flags.optimization_error_tolerance << endl;
01139 strm << "singularity_penalty_function_parameter\n "
01140 << flags.singularity_penalty_function_parameter << endl;
01141 strm << "optimize_Psi_barrier_parameter\n "
01142 << flags.optimize_Psi_barrier_parameter << endl;
01143 strm << "numerical_derivative_surface\n "
01144 << flags.numerical_derivative_surface << endl;
01145 strm << "line_search_step_length\n "
01146 << flags.line_search_step_length << endl;
01147 strm << "ck_genetic_algorithm_1_population_size\n "
01148 << flags.ck_genetic_algorithm_1_population_size << endl;
01149 strm << "ck_genetic_algorithm_1_mutation_rate\n "
01150 << flags.ck_genetic_algorithm_1_mutation_rate << endl;
01151 strm << "ck_genetic_algorithm_1_initial_distribution_deviation\n "
01152 << flags.ck_genetic_algorithm_1_initial_distribution_deviation << endl;
01153
01154 strm << "\n# Parameters for computation/MPI\n";
01155 if (flags.iseed > 0) strm << "iseed\n " << -1*flags.iseed << endl;
01156 else if (flags.iseed <= 0) strm << "iseed\n " << flags.iseed << endl;
01157 strm << "parallelization_method\n " << flags.parallelization_method << endl;
01158 strm << "mpireduce_interval\n " << flags.mpireduce_interval << endl;
01159 strm << "mpipoll_interval\n " << flags.mpipoll_interval << endl;
01160 strm << "walkers_per_pass\n " << flags.walkers_per_pass << endl;
01161
01162 strm << "use_basis_function_interpolation\n "
01163 << flags.use_basis_function_interpolation << endl;
01164 strm << "number_basis_function_interpolation_grid_points\n "
01165 << flags.number_basis_function_interpolation_grid_points << endl;
01166 strm << "basis_function_interpolation_first_point\n "
01167 << flags.basis_function_interpolation_first_point << endl;
01168
01169 strm << "\n# Parameters for the molecule and wavefunction\n";
01170 strm << "atoms\n " << flags.Natoms << endl;
01171 strm << "charge\n " << flags.charge << endl;
01172 strm << "energy\n " << flags.energy_trial << endl;
01173 strm << "trial_function_type\n " << flags.trial_function_type << endl;
01174 strm << "psuedo_gridLevel\n " << flags.psuedo_gridLevel << endl;
01175 strm << "psuedo_cutoff\n " << flags.psuedo_cutoff << endl;
01176 strm << "norbitals\n " << flags.Norbitals << endl;
01177 strm << "nbasisfunc\n " << flags.Nbasisfunc << endl;
01178 strm << "ndeterminants\n " << flags.Ndeterminants << endl;
01179 strm << "link_Jastrow_parameters\n "
01180 << flags.link_Jastrow_parameters << endl;
01181 strm << "link_NEE_Jastrows\n "
01182 << flags.link_NEE_Jastrows << endl;
01183 strm << "link_Orbital_parameters\n "
01184 << flags.link_Orbital_parameters << endl;
01185 strm << "link_Determinant_parameters\n "
01186 << flags.link_Determinant_parameters << endl;
01187 strm << "use_three_body_jastrow\n " << flags.use_three_body_jastrow << endl;
01188 strm << "reproduce_NE_with_NEE_jastrow\n "
01189 << flags.reproduce_NE_with_NEE_jastrow << endl;
01190 strm << "reproduce_EE_with_NEE_jastrow\n "
01191 << flags.reproduce_EE_with_NEE_jastrow << endl;
01192
01193 strm << "\n# Other parameters\n";
01194 strm << "chip_and_mike_are_cool\n " << flags.chip_and_mike_are_cool << endl;
01195
01196 strm << "& " << endl;
01197 strm.unsetf( ios::fixed );
01198 return strm;
01199 }
01200
01201 bool QMCFlags::checkFlags()
01202 {
01203
01204
01205
01206
01207 if(run_type != "variational" && run_type != "diffusion")
01208 {
01209 clog << "ERROR: Unknown run_type: " << run_type << endl;
01210 return false;
01211 }
01212
01213 if(max_time_steps <= equilibration_steps)
01214 {
01215 clog << "ERROR: (max_time_steps = " << max_time_steps
01216 << ") < (equilibration_steps = " << equilibration_steps << ")" << endl;
01217 return false;
01218 }
01219
01220 if(dt_equilibration < 0)
01221 {
01222 dt_equilibration = dt;
01223 }
01224
01225 if(sampling_method == "umrigar93_accelerated_sampling")
01226 {
01227 if(run_type != "variational"){
01228 clog << "Error: sampling method " << sampling_method <<
01229 " can only be used with run_type = variational.";
01230 return false;
01231 }
01232 clog << "Using sampling_method = " << sampling_method << endl;
01233 clog << " accel_delta = " << accel_delta << endl;
01234 clog << " accel_tm = " << accel_tm << endl;
01235 }
01236
01237 if(dt > dt_equilibration)
01238 {
01239 clog << "Warning: dt (" << dt << ") > dt_equilibration (" << dt_equilibration << "), setting dt_equilibration = dt." << endl;
01240 dt_equilibration = dt;
01241 }
01242
01243 if(rel_cutoff < 10.0)
01244 {
01245 clog << "Warning: the filter rel_cutoff = " << rel_cutoff << " might be too low..." << endl;
01246 }
01247
01248 if(checkpoint == 1)
01249 {
01250 string filename =
01251 globalInput.flags.temp_dir
01252 + "/"
01253 + globalInput.flags.checkout_file_name;
01254
01255 clog << "Notice: checkpoint files will be written into " << filename << endl;
01256 }
01257
01258 if(one_e_per_iter == 1 && optimize_Psi == 1)
01259 {
01260
01261
01262
01263
01264
01265
01266
01267
01268 clog << "Error: the code is unable to optimize psi using one_e_per_iter.\n";
01269 return false;
01270 }
01271
01276 if(trial_function_type == "harmonicoscillator")
01277 {
01278 if(walker_initialization_method != "amos_boring_initialization")
01279 {
01280 walker_initialization_method = "amos_boring_initialization";
01281 clog << "Warning: Setting walker_initialization_method to \"" <<
01282 walker_initialization_method << "\" since trial_function_type = " <<
01283 trial_function_type << endl;
01284 }
01285
01286 if(Natoms != 0)
01287 {
01288 clog << "Warning: Setting Natoms to 0 since trial_function_type = "
01289 << trial_function_type << endl;
01290 Natoms = 0;
01291 }
01292
01293 if(Nbasisfunc <= 0)
01294 {
01295 clog << "Error: set nbasisfunc to the number of dimensions for trial_function_type = "
01296 << trial_function_type << endl;
01297 return false;
01298 }
01299
01300 if(charge == 0)
01301 {
01302 clog << "Error: set charge to the number of electrons for trial_function_type = "
01303 << trial_function_type << endl;
01304 return false;
01305 }
01306 }
01307
01308 bool needPrintedConfigs = false;
01309 if(optimize_Psi == 1)
01310 {
01311 if(run_type != "variational")
01312 {
01313 clog << "Warning: attempting to optimize the wavefunction for"
01314 << " run_type = " << run_type << "!" << endl;
01315
01316
01317
01318 }
01319
01320
01321
01322
01323
01324 QMCLineSearchStepLengthSelectionAlgorithm *stepAlg =
01325 QMCLineSearchStepLengthSelectionFactory::factory(line_search_step_length);
01326
01327 delete stepAlg;
01328 stepAlg = 0;
01329
01330 if(optimize_Psi_method == "analytical_energy_variance" ||
01331 optimize_Psi_method == "automatic")
01332 {
01333 needPrintedConfigs = false;
01334
01335 if(optimize_Psi_criteria != "analytical_energy_variance" &&
01336 optimize_Psi_criteria != "generalized_eigenvector")
01337 {
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347 clog << "Warning: if optimize_Psi_method = " << optimize_Psi_method
01348 << " then optimize_Psi_criteria must = \"analytical_energy_variance\"" << endl;
01349 clog << "Warning: setting optimize_Psi_criteria = \"analytical_energy_variance\"" << endl;
01350 optimize_Psi_criteria = "analytical_energy_variance";
01351 }
01352
01353 if(line_search_step_length == "Wolfe" ||
01354 line_search_step_length == "MikesBracketing")
01355 {
01356
01357
01358
01359 clog << "Warning: you probably want \"None\" as your line_search_step_length!" << endl;
01360 needPrintedConfigs = true;
01361 }
01362
01363 if(ksi < 0.0 || ksi > 1)
01364 {
01365 clog << "Error: bad value for ksi = " << ksi << endl;
01366 return false;
01367 }
01368 }
01369 else
01370 {
01371 needPrintedConfigs = true;
01372
01373 if(optimize_Psi_method == "Steepest_Descent" &&
01374 (optimize_Psi_criteria == "analytical_energy_variance" ||
01375 optimize_Psi_criteria == "generalized_eigenvector"))
01376 needPrintedConfigs = false;
01377
01378 if(optimize_Psi_method == "BFGSQuasiNewton" &&
01379 optimization_max_iterations <= 1)
01380 {
01381 clog << "Warning: BFGSQuasiNewton needs optimization_max_iterations > " << optimization_max_iterations << endl;
01382 clog << "Setting optimization_max_iterations = 2" << endl;
01383 optimization_max_iterations = 2;
01384 }
01385 }
01386
01387 if(replace_electron_nucleus_cusps == 1 &&
01388 optimize_Psi_method == "automatic")
01389 {
01390
01391
01392
01393
01394
01395 }
01396
01397 if(link_Orbital_parameters == 0)
01398 {
01399 if(trial_function_type == "restricted")
01400 {
01401 clog << "Notice: optimization with link_Orbital_parameters == " << link_Orbital_parameters
01402 << " will convert your\n"
01403 << " trial_function_type == \"" << trial_function_type << "\" into\n"
01404 << " trial_function_type == \"unrestricted\"" << endl;
01405 }
01406 } else {
01407 if(trial_function_type == "unrestricted")
01408 {
01409 clog << "Warning: link_Orbital_parameters == " << link_Orbital_parameters
01410 << " has no effect on a\n"
01411 << " trial_function_type == \"" << trial_function_type << "\"\n";
01412
01413 }
01414 }
01415
01416 } else {
01417
01418 needPrintedConfigs = false;
01419 }
01420
01421 if(needPrintedConfigs && print_configs == 0)
01422 {
01423 clog << "Warning: based on your parameter choices, you need to have print_configs == 1."
01424 << " It will be set to 1 now." << endl;
01425 print_configs = 1;
01426 }
01427 else if(!needPrintedConfigs && print_configs == 1)
01428 {
01429 clog << "Warning: print_configs == 1 is very expensive, and none of your parameter choices required it." << endl;
01430 }
01431
01432 if(print_configs == 1)
01433 {
01434 clog << "Using " << temp_dir << " as scratch space for writing config files." << endl;
01435 }
01436 else if(optimize_Psi == 1)
01437 {
01438 calculate_Derivatives = 1;
01439 }
01440
01441 if(nuclear_derivatives != "none" && Natoms == 0)
01442 {
01443 clog << "Warning: Setting nuclear_derivatives to \"none\" since Natoms = "
01444 << Natoms << endl;
01445 nuclear_derivatives = "none";
01446 }
01447
01448 if(sampling_method == "umrigar93_importance_sampling" && Natoms == 0)
01449 {
01450 clog << "Warning: Setting sampling_method to \"no_importance_sampling\" since " <<
01451 "umrigar93_importance_sampling requires Natoms > 0\n" << endl;
01452 sampling_method = "no_importance_sampling";
01453 }
01454
01455 if(walkers_per_pass > number_of_walkers)
01456 {
01457 clog << "Warning: you requested more walkers_per_pass (" << walkers_per_pass
01458 << ") than walkers (" << number_of_walkers << "), resetting walkers_per_pass." << endl;
01459 walkers_per_pass = number_of_walkers;
01460 }
01461
01462 if(psuedo_gridLevel > 31){
01463 clog << "Error: our Lebedev-Laikov grids are only defined up to psuedo_gridLevel = 31.\n";
01464 clog << "You requested psuedo_gridLevel = " << psuedo_gridLevel << endl;
01465 return false;
01466 } else {
01467
01468 }
01469
01470 #ifdef QMC_GPU
01471 if( getNumGPUWalkers() == 0)
01472 {
01473 clog << "A GPU run with no GPU walkers? Please set the gpu_walkers_per_pass parameter.\n";
01474 return false;
01475 }
01476
01477 if( getNumGPUWalkers() + walkers_per_pass != number_of_walkers)
01478 {
01479
01480 gpu_walkers_per_pass = -1;
01481 }
01482
01483 cout << "Running GPUQMC with " << walkers_per_pass << " walkers per pass, " <<
01484 getNumGPUWalkers() << " of them on the GPU\n";
01485
01486 #endif
01487
01488 if(chip_and_mike_are_cool != "Yea_Baby!")
01489 {
01490 clog << "ERROR: Incorrect value for chip_and_mike_are_cool set" << endl;
01491 return false;
01492 }
01493 return true;
01494 }
01495
01496
01497