40#ifndef MADNESS_CHEM_CALCULATIONPARAMETERS_H__INCLUDED
41#define MADNESS_CHEM_CALCULATIONPARAMETERS_H__INCLUDED
64 initialize<std::string>(
"prefix",
"mad",
"prefixes your output/restart/json/plot/etc files");
65 initialize<double>(
"charge",0.0,
"total molecular charge");
66 initialize<std::string> (
"xc",
"hf",
"XC input line");
67 initialize<std::string> (
"hfexalg",
"multiworld",
"hf exchange algorithm: choose from multiworld (default), smallmem, largemem");
68 initialize<double>(
"smear",0.0,
"smearing parameter");
69 initialize<double>(
"econv",1.e-5,
"energy convergence");
70 initialize<double>(
"dconv",1.e-4,
"density convergence");
71 initialize<std::vector<std::string> >(
"convergence_criteria",{
"bsh_residual",
"total_energy"},
"possible values are: bsh_residual, total_energy, each_energy, density");
72 initialize<int> (
"k",-1,
"polynomial order");
73 initialize<double>(
"l",20,
"user coordinates box size");
74 initialize<std::string>(
"deriv",
"abgv",
"derivative method",{
"abgv",
"bspline",
"ble"});
75 initialize<std::string>(
"dft_deriv",
"abgv",
"derivative method for gga potentials",{
"abgv",
"bspline",
"ble"});
76 initialize<double>(
"maxrotn",0.25,
"step restriction used in autoshift algorithm");
77 initialize<int> (
"nvalpha",0,
"number of alpha virtuals to compute");
78 initialize<int> (
"nvbeta",0,
"number of beta virtuals to compute");
79 initialize<int> (
"nopen",0,
"number of unpaired electrons = nalpha-nbeta");
80 initialize<int> (
"maxiter",25,
"maximum number of iterations");
81 initialize<int> (
"nio",1,
"no. of io servers to use");
82 initialize<bool> (
"spin_restricted",
true,
"true if spin restricted");
83 initialize<int> (
"plotlo",0,
"range of MOs to print (for both spins if polarized");
84 initialize<int> (
"plothi",-1,
"range of MOs to print (for both spins if polarized");
85 initialize<bool> (
"plotdens",
false,
"If true print the density at convergence");
86 initialize<bool> (
"plotcoul",
false,
"If true plot the total coulomb potential at convergence");
87 initialize<std::string> (
"localize",
"new",
"localization method",{
"pm",
"boys",
"new",
"canon"});
88 initialize<std::string> (
"pointgroup",
"c1",
"use point (sub) group symmetry if not localized",{
"c1",
"c2",
"ci",
"cs",
"c2v",
"c2h",
"d2",
"d2h"});
89 initialize<bool> (
"restart",
false,
"if true restart from orbitals on disk");
90 initialize<bool> (
"restartao",
false,
"if true restart from orbitals projected into AO basis (STO3G) on disk");
91 initialize<bool> (
"no_compute",
false,
"if true use orbitals on disk, set value to computed");
92 initialize<bool> (
"save",
true,
"if true save orbitals to disk");
93 initialize<int> (
"maxsub",10,
"size of iterative subspace ... set to 0 or 1 to disable");
94 initialize<double> (
"orbitalshift",0.0,
"scf orbital shift: shift the occ orbitals to lower energies");
95 initialize<int> (
"npt_plot",101,
"no. of points to use in each dim for plots");
97 initialize<std::vector<double> > (
"plot_cell",std::vector<double>(),
"lo hi in each dimension for plotting (default is all space)");
98 initialize<std::string> (
"aobasis",
"6-31g",
"AO basis used for initial guess (6-31gss, 6-31g, 3-21g, sto-6g, sto-3g)");
99 initialize<bool> (
"derivatives",
false,
"if true calculate nuclear derivatives");
100 initialize<bool> (
"dipole",
false,
"if true calculate dipole moment");
101 initialize<bool> (
"conv_only_dens",
false,
"if true remove bsh_residual from convergence criteria (deprecated)");
102 initialize<bool> (
"psp_calc",
false,
"pseudopotential calculation for all atoms");
103 initialize<std::string> (
"pcm_data",
"none",
"do a PCM (solvent) calculation");
104 initialize<std::string> (
"ac_data",
"none",
"do a calculation with asymptotic correction (see ACParameters class in chem/AC.h for details)");
105 initialize<bool> (
"pure_ae",
true,
"pure all electron calculation with no pseudo-atoms");
106 initialize<int> (
"print_level",3,
"0: no output; 1: final energy; 2: iterations; 3: timings; 10: debug");
107 initialize<std::string> (
"molecular_structure",
"inputfile",
"where to read the molecule from: inputfile or name from the library");
110 initialize<int> (
"nalpha",-1,
"number of alpha spin electrons");
111 initialize<int> (
"nbeta",-1,
"number of beta spin electrons");
112 initialize<int> (
"nmo_alpha",-1,
"number of alpha spin molecular orbitals");
113 initialize<int> (
"nmo_beta",-1,
"number of beta spin molecular orbitals");
114 initialize<double> (
"lo",1.e-10,
"smallest length scale we need to resolve");
115 initialize<std::vector<double> > (
"protocol",{1.e-4,1.e-6},
"calculation protocol");
119 initialize<bool> (
"gopt",
false,
"geometry optimizer");
120 initialize<double> (
"gtol",1.e-4,
"geometry tolerance");
121 initialize<bool> (
"gtest",
false,
"geometry tolerance");
122 initialize<double> (
"gval",1.e-5,
"value precision");
123 initialize<double> (
"gprec",1.e-4,
"gradient precision");
124 initialize<int> (
"gmaxiter",20,
"optimization maxiter");
125 initialize<bool> (
"ginitial_hessian",
false,
"compute inital hessian for optimization");
126 initialize<std::string> (
"algopt",
"bfgs",
"algorithm used for optimization",{
"bfgs",
"cg"});
127 initialize<int> (
"nv_factor",1,
"factor to multiply number of virtual orbitals with when automatically decreasing nvirt");
128 initialize<int> (
"vnucextra",2,
"load balance parameter for nuclear pot");
129 initialize<int> (
"loadbalparts",2,
"??");
132 initialize<std::string> (
"nwfile",
"none",
"Base name of nwchem output files (.out and .movecs extensions) to read from");
139 std::string
prefix()
const {
return get<std::string>(
"prefix");}
141 double econv()
const {
return get<double>(
"econv");}
142 double dconv()
const {
return get<double>(
"dconv");}
145 std::vector<std::string> criteria=get<std::vector<std::string> >(
"convergence_criteria");
146 return std::find(criteria.begin(),criteria.end(),
"density")!=criteria.end();
149 std::vector<std::string> criteria=get<std::vector<std::string> >(
"convergence_criteria");
150 return std::find(criteria.begin(),criteria.end(),
"bsh_residual")!=criteria.end();
153 std::vector<std::string> criteria=get<std::vector<std::string> >(
"convergence_criteria");
154 return std::find(criteria.begin(),criteria.end(),
"total_energy")!=criteria.end();
157 std::vector<std::string> criteria=get<std::vector<std::string> >(
"convergence_criteria");
158 return std::find(criteria.begin(),criteria.end(),
"each_energy")!=criteria.end();
161 int nopen()
const {
return get<int>(
"nopen");}
162 int nalpha()
const {
return get<int>(
"nalpha");}
163 int nbeta()
const {
return get<int>(
"nbeta");}
165 int nvalpha()
const {
return get<int>(
"nvalpha");}
166 int nvbeta()
const {
return get<int>(
"nvbeta");}
170 int nmo_beta()
const {
return get<int>(
"nmo_beta");}
177 double lo()
const {
return get<double>(
"lo");}
178 double L()
const {
return get<double>(
"l");}
179 int k()
const {
return get<int>(
"k");}
185 std::string
pointgroup()
const {
return get<std::string>(
"pointgroup");}
187 double charge()
const {
return get<double>(
"charge");}
190 int maxiter()
const {
return get<int>(
"maxiter");}
193 std::string
deriv()
const {
return get<std::string>(
"deriv");}
194 std::string
dft_deriv()
const {
return get<std::string>(
"dft_deriv");}
195 std::string
pcm_data()
const {
return get<std::string>(
"pcm_data");}
196 std::string
ac_data()
const {
return get<std::string>(
"ac_data");}
197 std::string
xc()
const {
return get<std::string>(
"xc");}
198 std::string
hfexalg()
const {
return get<std::string>(
"hfexalg");}
200 std::string
aobasis()
const {
return get<std::string>(
"aobasis");}
202 std::vector<double>
protocol()
const {
return get<std::vector<double> >(
"protocol");}
203 bool save()
const {
return get<bool>(
"save");}
204 bool restart()
const {
return get<bool>(
"restart");}
208 int maxsub()
const {
return get<int>(
"maxsub");}
209 double maxrotn()
const {
return get<double>(
"maxrotn");}
216 bool dipole()
const {
return get<bool>(
"dipole");}
218 bool gopt()
const {
return get<bool>(
"gopt");}
219 std::string
algopt()
const {
return get<std::string>(
"algopt");}
220 int gmaxiter()
const {
return get<int>(
"gmaxiter");}
221 double gtol()
const {
return get<double>(
"gtol");}
222 double gval()
const {
return get<double>(
"gval");}
223 double gprec()
const {
return get<double>(
"gprec");}
226 std::string
nwfile()
const {
return get<std::string>(
"nwfile");}
229 std::vector<double> vcell=get<std::vector<double> >(
"plot_cell");
247 for (
size_t iatom = 0; iatom <
molecule.natom(); iatom++) {
248 if (
molecule.get_pseudo_atom(iatom)){
254 const int n_core =
molecule.n_core_orb_all();
257 std::vector<double> proto=get<std::vector<double> >(
"protocol");
266 double z =
molecule.total_nuclear_charge();
267 const double charge=get<double>(
"charge");
268 int nelec = int(z -
charge - n_core*2);
269 if (fabs(nelec+
charge+n_core*2-z) > 1
e-6) {
270 error(
"non-integer number of electrons?", nelec+
charge+n_core*2-z);
308 error(
"\n\nsymmetry and localization cannot be used at the same time\n"
309 "switch from local to canonical orbitals (keyword canon)\n\n");
313 if (get<bool>(
"gopt") &&
nwfile() !=
"none")
error(
"NWchem initialization only supports single point energy calculations.");
Contracted Gaussian basis.
Definition madness/chem/molecularbasis.h:465
Definition molecule.h:124
class for holding the parameters for calculation
Definition QCCalculationParametersBase.h:290
virtual void read_input_and_commandline_options(World &world, const commandlineparser &parser, const std::string tag)
Definition QCCalculationParametersBase.h:325
void set_user_defined_value(const std::string &key, const T &value)
Definition QCCalculationParametersBase.h:533
void set_derived_value(const std::string &key, const T &value)
Definition QCCalculationParametersBase.h:403
A tensor is a multidimension array.
Definition tensor.h:317
A parallel world class.
Definition world.h:132
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
void error(const char *msg)
Definition world.cc:139
Definition CalculationParameters.h:51
double gval() const
Definition CalculationParameters.h:222
bool converge_each_energy() const
Definition CalculationParameters.h:156
std::vector< double > protocol() const
Definition CalculationParameters.h:202
double charge() const
Definition CalculationParameters.h:187
void set_derived_values(const Molecule &molecule, const AtomicBasisSet &aobasis, const commandlineparser &parser)
Definition CalculationParameters.h:242
CalculationParameters(const CalculationParameters &other)=default
bool converge_density() const
Definition CalculationParameters.h:144
virtual void read_input_and_commandline_options(World &world, const commandlineparser &parser, const std::string tag)
Definition QCCalculationParametersBase.h:325
int nv_factor() const
Definition CalculationParameters.h:167
bool do_symmetry() const
Definition CalculationParameters.h:186
bool localize_pm() const
Definition CalculationParameters.h:183
bool gopt() const
Definition CalculationParameters.h:218
int k() const
Definition CalculationParameters.h:179
bool converge_bsh_residual() const
Definition CalculationParameters.h:148
CalculationParameters()
ctor reading out the input file
Definition CalculationParameters.h:62
bool converge_total_energy() const
Definition CalculationParameters.h:152
Tensor< double > plot_cell() const
Definition CalculationParameters.h:228
std::string nwfile() const
Definition CalculationParameters.h:226
std::string prefix() const
Definition CalculationParameters.h:139
std::string ac_data() const
Definition CalculationParameters.h:196
int nmo_alpha() const
Definition CalculationParameters.h:169
int nopen() const
Definition CalculationParameters.h:161
bool dipole() const
Definition CalculationParameters.h:216
bool save() const
Definition CalculationParameters.h:203
double dconv() const
Definition CalculationParameters.h:142
std::string algopt() const
Definition CalculationParameters.h:219
double econv() const
Definition CalculationParameters.h:141
int nvalpha() const
Definition CalculationParameters.h:165
int vnucextra() const
Definition CalculationParameters.h:211
int print_level() const
Definition CalculationParameters.h:188
std::string deriv() const
Definition CalculationParameters.h:193
bool do_localize() const
Definition CalculationParameters.h:182
std::string hfexalg() const
Definition CalculationParameters.h:198
double L() const
Definition CalculationParameters.h:178
int gmaxiter() const
Definition CalculationParameters.h:220
std::string localize_method() const
Definition CalculationParameters.h:181
bool ginitial_hessian() const
Definition CalculationParameters.h:224
int loadbalparts() const
Definition CalculationParameters.h:212
std::string aobasis() const
Definition CalculationParameters.h:200
int nalpha() const
Definition CalculationParameters.h:162
std::string dft_deriv() const
Definition CalculationParameters.h:194
int maxsub() const
Definition CalculationParameters.h:208
int nvbeta() const
Definition CalculationParameters.h:166
double gprec() const
Definition CalculationParameters.h:223
bool derivatives() const
Definition CalculationParameters.h:215
int nbeta() const
Definition CalculationParameters.h:163
int nmo_beta() const
Definition CalculationParameters.h:170
double gtol() const
Definition CalculationParameters.h:221
bool have_beta() const
Definition CalculationParameters.h:172
bool no_compute() const
Definition CalculationParameters.h:175
bool spin_restricted() const
Definition CalculationParameters.h:174
int maxiter() const
Definition CalculationParameters.h:190
double orbitalshift() const
Definition CalculationParameters.h:191
double lo() const
Definition CalculationParameters.h:177
std::string pcm_data() const
Definition CalculationParameters.h:195
bool restart() const
Definition CalculationParameters.h:204
bool restart_cphf() const
Definition CalculationParameters.h:206
bool restartao() const
Definition CalculationParameters.h:205
std::string pointgroup() const
Definition CalculationParameters.h:185
double maxrotn() const
Definition CalculationParameters.h:209
std::string xc() const
Definition CalculationParameters.h:197
CalculationParameters(World &world, const commandlineparser &parser)
Definition CalculationParameters.h:55
very simple command line parser
Definition commandlineparser.h:15
std::string value(const std::string key) const
Definition commandlineparser.h:59
bool key_exists(std::string key) const
Definition commandlineparser.h:55
static std::string base_name(std::string const &path, std::string const &delims="/")
Definition commandlineparser.h:129
static std::string remove_extension(std::string const &filename)
Definition commandlineparser.h:134
void e()
Definition test_sig.cc:75
static Molecule molecule
Definition testperiodicdft.cc:38