34#include "./base/base_uses.f90"
39 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_optimize_basis'
55 cpassert(.NOT.
ASSOCIATED(section))
56 CALL section_create(section, __location__, name=
"OPTIMIZE_BASIS", &
57 description=
"describes a basis optimization job, in which an ADMM like approach is used to"// &
58 " find the best exponents and/or coefficients to match a given training set.", &
60 NULLIFY (keyword, subsection)
62 CALL keyword_create(keyword, __location__, name=
"BASIS_TEMPLATE_FILE", &
63 description=
"Name of the basis set file, containing the structure of the new basis set", &
64 usage=
"BASIS_TEMPLATE_FILE <FILENAME>", &
65 type_of_var=
char_t, repeats=.false., &
66 default_c_val=
"BASIS_SET", n_var=-1)
70 CALL keyword_create(keyword, __location__, name=
"BASIS_WORK_FILE", &
71 description=
"Name of the basis set file which is created to be read as initial guess", &
72 usage=
"BASIS_WORK_FILE <FILENAME>", &
73 type_of_var=
char_t, repeats=.false., &
74 default_c_val=
"BASIS_WORK_FILE", n_var=-1)
78 CALL keyword_create(keyword, __location__, name=
"BASIS_OUTPUT_FILE", &
79 description=
"Name of the basis set file containing the optimized basis", &
80 usage=
"BASIS_OUTPUT_FILE <FILENAME>", &
81 type_of_var=
char_t, repeats=.false., &
82 default_c_val=
"BASIS_OUTPUT_FILE", n_var=-1)
86 CALL keyword_create(keyword, __location__, name=
"WRITE_FREQUENCY", &
87 description=
"Frequency at which the intermediate results should be written", &
88 usage=
"WRITE_FREQUENCY 1000", &
93 CALL keyword_create(keyword, __location__, name=
"USE_CONDITION_NUMBER", &
94 description=
"Determines whether condition number should be part of optimization or not", &
95 usage=
"USE_CONDITION_NUMBER", &
96 default_l_val=.false., lone_keyword_l_val=.true.)
101 keyword, __location__, name=
"BASIS_COMBINATIONS", &
102 description=
"If multiple atomic kinds are fitted at the same time, this keyword "// &
103 "allows to specify which basis sets should be used together in optimization (underived set ID=0). "// &
104 "If skipped all combinations are used. The order is taken as the kinds and sets are specified in the input", &
106 usage=
"BASIS_COMBINATIONS SET_ID(KIND1) SET_ID(KIND2) ... ", type_of_var=
integer_t, n_var=-1)
111 keyword, __location__, name=
"RESIDUUM_WEIGHT", &
112 description=
"This keyword allows to give different weight factors to the "// &
113 "residuum of the different basis combinations. "// &
114 "The first entry corresponds to the original basis sets. Every further value is assigned to the combinations "// &
115 "in the order given for BASIS_COMBINATIONS.", &
117 usage=
"RESIDUUM_WEIGHT REAL ", default_r_val=1.0_dp)
122 keyword, __location__, name=
"CONDITION_WEIGHT", &
123 description=
"This keyword allows to give different weight factors to the "// &
124 "condition number of different basis combinations (LOG(cond) is used). "// &
125 "The first entry corresponds to the original basis sets. Every further value is assigned to the combinations "// &
126 "in the order given for BASIS_COMBINATIONS.", &
128 usage=
"CONDITION_WEIGHT REAL ", default_r_val=1.0_dp)
132 CALL keyword_create(keyword, __location__, name=
"GROUP_PARTITION", &
133 description=
"Allows the specification of the group mpi group sizes in parallel "// &
134 "runs. If less Groups than tasks are speciefied, consecutive calculations "// &
135 "Will be assigned to one group (derived basis sets and then training sets) "// &
136 "If keyword is skipped, equal group sizes will be generated trying to fit all calculations.", &
138 usage=
"GROUP_PARTITION INT INT ... ", type_of_var=
integer_t, n_var=-1)
142 CALL create_fit_kinds_section(subsection)
146 CALL create_frontier_orbitals_section(subsection)
150 CALL create_frontier_orbital_screening_section(subsection)
154 CALL create_training_section(subsection)
158 CALL create_powell_section(subsection)
168 SUBROUTINE create_frontier_orbitals_section(section)
171 CHARACTER(len=2),
PARAMETER :: paragraph_break = new_line(
"A")//new_line(
"A")
175 cpassert(.NOT.
ASSOCIATED(section))
177 section, __location__, name=
"FRONTIER_ORBITALS", &
178 description=
"Optimizes a compact basis set to reproduce the occupied and low-energy virtual "// &
179 "Kohn-Sham states obtained from a very large reference basis set. For each training system, "// &
180 "a quantum-mechanical DFT reference calculation using this basis must be provided through "// &
181 "TRAINING_FILES, including a converged reference wavefunction. The Kohn-Sham Hamiltonian from "// &
182 "the reference calculation is frozen and "// &
183 "projected into every trial compact basis. Consequently, all candidate orbital subspaces and "// &
184 "energies, including the HOMO-LUMO gap, are evaluated relative to the reference Hamiltonian. "// &
185 "When optimizing the compact basis against the large reference basis, the following loss "// &
186 "function is minimized:"//paragraph_break// &
187 "$$\mathcal{L}=\alpha_{\mathrm{occ}}\mathcal{L}_{\mathrm{occ}}+ "// &
188 "\alpha_{\mathrm{vir}}\mathcal{L}_{\mathrm{vir}}+ "// &
189 "\alpha_{\mathrm{empty}}\mathcal{L}_{\mathrm{empty}}+ "// &
190 "\alpha_{\mathrm{gap}}\mathcal{L}_{\mathrm{gap}}+ "// &
191 "\alpha_{\mathrm{coeff}}\mathcal{L}_{\mathrm{coeff}}+ "// &
192 "\alpha_\kappa\mathcal{L}_\kappa.$$"//paragraph_break// &
193 "Below, all loss functions $\mathcal{L}$ are defined. $R$ and $C$ label reference and "// &
194 "candidate quantities, $i$ and $j$ label occupied orbitals, and $a$ and $b$ label virtual "// &
195 "orbitals. Their overlaps are $M_{ij}=\langle\psi_i^R\vert\psi_j^C\rangle$ and "// &
196 "$M_{ab}=\langle\psi_a^R\vert\psi_b^C\rangle$, respectively. "// &
197 "$N_{\mathrm{occ}}$ is the number of occupied spatial orbitals. "// &
198 "The occupied-subspace loss is"//paragraph_break// &
199 "$$\mathcal{L}_{\mathrm{occ}}=1-\frac{1}{N_{\mathrm{occ}}} "// &
200 "\sum_{i,j\in\mathrm{occ}}\lvert M_{ij}\rvert^2.$$"//paragraph_break// &
201 "It penalizes a poor representation of the reference occupied orbitals by the occupied "// &
202 "orbitals of the compact candidate basis. "// &
203 "Low-energy virtual orbitals are selected smoothly using"//paragraph_break// &
204 "$$w_a^X=\left[1+\exp\left( "// &
205 "\frac{\epsilon_a^X-\epsilon_{\mathrm{LUMO}}^X-E_{\mathrm{cut}}}{\Delta E} "// &
206 "\right)\right]^{-1},\qquad X\in\{R,C\}.$$"//paragraph_break// &
207 "Define $N_X=\sum_{a\in\mathrm{vir}}(w_a^X)^2$. The virtual-subspace loss can be written "// &
208 "directly as the normalized squared distance between the two energy-weighted virtual-space "// &
211 "$$\begin{aligned} "// &
212 "\mathcal{L}_{\mathrm{vir}}&=\frac{1}{2N_R}\left\| "// &
213 "\sum_{a\in\mathrm{vir}}w_a^R\lvert\psi_a^R\rangle\langle\psi_a^R\rvert- "// &
214 "\sum_{b\in\mathrm{vir}}w_b^C\lvert\psi_b^C\rangle\langle\psi_b^C\rvert "// &
215 "\right\|_F^2\\ "// &
216 "&=\frac{N_R+N_C-2\sum_{a,b\in\mathrm{vir}} "// &
217 "w_a^R w_b^C\lvert M_{ab}\rvert^2}{2N_R}. "// &
218 "\end{aligned}$$"//paragraph_break// &
219 "The first operator represents the reference low-energy virtual space and the second represents "// &
220 "the candidate low-energy virtual space. Here, $\lVert\cdot\rVert_F^2$ is the squared Frobenius "// &
221 "norm, which measures their squared matrix distance. Thus, $\mathcal{L}_{\mathrm{vir}}$ penalizes "// &
222 "differences between the low-energy virtual orbitals of the compact candidate basis and the "// &
223 "reference space; it is zero when these spaces coincide. The compact candidate basis can contain "// &
224 "empty orbitals outside the "// &
225 "selected low-energy interval. To test whether the reference low-energy virtual orbitals can be "// &
226 "represented in the entire candidate empty space, the empty-subspace loss is"//paragraph_break// &
227 "$$\mathcal{L}_{\mathrm{empty}}=1- "// &
228 "\frac{\sum_{a,b\in\mathrm{vir}}(w_a^R)^2\lvert M_{ab}\rvert^2}{N_R}. "// &
229 "$$"//paragraph_break// &
230 "It penalizes reference low-energy virtual orbitals that cannot be represented by any empty "// &
231 "orbital of the compact candidate basis. "// &
232 "With $E_{\mathrm{gap}}^X=\epsilon_{\mathrm{LUMO}}^X-\epsilon_{\mathrm{HOMO}}^X$, "// &
233 "the gap loss is"//paragraph_break// &
234 "$$\mathcal{L}_{\mathrm{gap}}=\left( "// &
235 "\frac{E_{\mathrm{gap}}^C-E_{\mathrm{gap}}^R}{E_{\mathrm{scale}}} "// &
236 "\right)^2.$$"//paragraph_break// &
237 "It penalizes deviations of the candidate HOMO-LUMO gap from the reference gap."// &
239 "During the optimization, the electron density and the corresponding Kohn-Sham Hamiltonian "// &
240 "are held fixed at the values obtained with the large reference basis set. Therefore, the "// &
241 "candidate gap reported in the optimization output is the fixed-density gap of the reference "// &
242 "Hamiltonian projected into the compact candidate basis. A separate self-consistent Kohn-Sham "// &
243 "DFT calculation with the optimized compact basis can produce a different electron density and, "// &
244 "consequently, a different HOMO-LUMO gap."//paragraph_break// &
246 "optimized and initial contraction coefficients of the compact basis set, $c$ and $c_0$, "// &
247 "the coefficient loss is"//paragraph_break// &
248 "$$\mathcal{L}_{\mathrm{coeff}}= "// &
249 "\frac{\sum_p(c_p-c_{0,p})^2}{\sum_p c_{0,p}^2}.$$"//paragraph_break// &
250 "It penalizes large deviations from the coefficients of the initially supplied compact "// &
251 "basis set. Finally, the conditioning loss is"//paragraph_break// &
252 "$$\mathcal{L}_\kappa=\log_{10}\kappa(S_C),\qquad "// &
253 "\kappa(S_C)=\frac{\lambda_{\max}(S_C)}{\lambda_{\min}(S_C)}.$$"//paragraph_break// &
254 "It penalizes an ill-conditioned candidate overlap matrix. The weights "// &
255 "$\alpha_{\mathrm{occ}}$, $\alpha_{\mathrm{vir}}$, $\alpha_{\mathrm{empty}}$, "// &
256 "$\alpha_{\mathrm{gap}}$, and $\alpha_{\mathrm{coeff}}$ are set below; "// &
257 "CONDITION_WEIGHT supplies $\alpha_\kappa$."//paragraph_break// &
258 "The loss weights $\alpha_{\mathrm{occ}}$, $\alpha_{\mathrm{vir}}$, "// &
259 "$\alpha_{\mathrm{empty}}$, $\alpha_{\mathrm{gap}}$, "// &
260 "$\alpha_{\mathrm{coeff}}$, and $\alpha_\kappa$ can have a strong and "// &
261 "system-dependent effect on the accuracy of the optimized basis set. In particular, the user "// &
262 "has to test the new basis set in a self-consistent DFT calculation, which also uses the "// &
263 "self-consistent electron density computed with the optimized basis set (during the "// &
264 "optimization, the electron density is kept fixed at the density obtained with the large "// &
265 "reference basis set). Several combinations of loss weights should be tested, and the optimal "// &
266 "basis should be selected based on validation with a self-consistent DFT calculation using the "// &
267 "new basis set (for example, by focusing on the resulting DFT gap, GW gap, or GW-BSE excitation "// &
268 "energy). Useful candidate parameter combinations include:"//paragraph_break// &
269 "1. OCCUPIED_WEIGHT 1, VIRTUAL_WEIGHT 1, EMPTY_OVERLAP_WEIGHT 1, GAP_WEIGHT 10, "// &
270 "GAP_ENERGY_SCALE [eV] 1, CONDITION_WEIGHT 0.1, COEFFICIENT_WEIGHT 0.001"//new_line(
"A")// &
271 "2. OCCUPIED_WEIGHT 10, VIRTUAL_WEIGHT 10, EMPTY_OVERLAP_WEIGHT 10, GAP_WEIGHT 10, "// &
272 "GAP_ENERGY_SCALE [eV] 1, CONDITION_WEIGHT 0.001, COEFFICIENT_WEIGHT 0.001"//new_line(
"A")// &
273 "3. OCCUPIED_WEIGHT 30, VIRTUAL_WEIGHT 30, EMPTY_OVERLAP_WEIGHT 30, GAP_WEIGHT 10, "// &
274 "GAP_ENERGY_SCALE [eV] 1, CONDITION_WEIGHT 0.001, COEFFICIENT_WEIGHT 0.001"//new_line(
"A")// &
275 "4. OCCUPIED_WEIGHT 10, VIRTUAL_WEIGHT 30, EMPTY_OVERLAP_WEIGHT 30, GAP_WEIGHT 10, "// &
276 "GAP_ENERGY_SCALE [eV] 1, CONDITION_WEIGHT 0.001, COEFFICIENT_WEIGHT 0.01", &
280 keyword, __location__, name=
"OCCUPIED_WEIGHT", &
281 description=
"Prefactor $\alpha_{\mathrm{occ}}$ multiplying the occupied-subspace loss "// &
282 "$\mathcal{L}_{\mathrm{occ}}$.", &
283 usage=
"OCCUPIED_WEIGHT 1.0", type_of_var=
real_t, default_r_val=1.0_dp)
288 keyword, __location__, name=
"VIRTUAL_WEIGHT", &
289 description=
"Prefactor $\alpha_{\mathrm{vir}}$ multiplying the virtual-subspace loss "// &
290 "$\mathcal{L}_{\mathrm{vir}}$.", &
291 usage=
"VIRTUAL_WEIGHT 1.0", type_of_var=
real_t, default_r_val=1.0_dp)
296 keyword, __location__, name=
"EMPTY_OVERLAP_WEIGHT", &
297 description=
"Prefactor $\alpha_{\mathrm{empty}}$ multiplying "// &
298 "$\mathcal{L}_{\mathrm{empty}}$, the loss of reference low-energy virtual-state "// &
299 "completeness in the candidate virtual subspace.", &
300 usage=
"EMPTY_OVERLAP_WEIGHT 1.0", type_of_var=
real_t, default_r_val=1.0_dp)
305 keyword, __location__, name=
"GAP_WEIGHT", &
306 description=
"Prefactor $\alpha_{\mathrm{gap}}$ multiplying the normalized HOMO-LUMO gap loss "// &
307 "$\mathcal{L}_{\mathrm{gap}}$. Because $\mathcal{L}_{\mathrm{gap}}$ is proportional to "// &
308 "$1/E_{\mathrm{scale}}^2$, reducing GAP_ENERGY_SCALE by a factor "// &
309 "of 100 requires reducing GAP_WEIGHT by a factor of 10000 to retain the same balance.", &
310 usage=
"GAP_WEIGHT 1.0E-3", type_of_var=
real_t, default_r_val=1.0e-3_dp)
315 keyword, __location__, name=
"COEFFICIENT_WEIGHT", &
316 description=
"Prefactor $\alpha_{\mathrm{coeff}}$ multiplying the normalized squared change "// &
317 "$\mathcal{L}_{\mathrm{coeff}}$ of the optimized contraction coefficients from their "// &
319 usage=
"COEFFICIENT_WEIGHT 1.0E-3", type_of_var=
real_t, default_r_val=1.0e-3_dp)
324 keyword, __location__, name=
"GAP_ENERGY_SCALE", &
325 description=
"$E_{\mathrm{scale}}$ in the gap loss. A gap error of this magnitude gives "// &
326 "$\mathcal{L}_{\mathrm{gap}}=1$. The default is 0.01 eV.", &
327 usage=
"GAP_ENERGY_SCALE [eV] 0.01", type_of_var=
real_t, unit_str=
"eV", &
333 keyword, __location__, name=
"VIRTUAL_ENERGY_CUTOFF", &
334 description=
"$E_{\mathrm{cut}}$, the virtual-orbital energy window measured "// &
335 "from the corresponding LUMO. The default is 3 eV.", &
336 usage=
"VIRTUAL_ENERGY_CUTOFF [eV] 3.0", type_of_var=
real_t, unit_str=
"eV", &
342 keyword, __location__, name=
"VIRTUAL_ENERGY_SMOOTHING", &
343 description=
"$\Delta E$, the smoothing width at the outer boundary of the "// &
344 "virtual-orbital energy window. It must be positive; the default is 0.2 eV.", &
345 usage=
"VIRTUAL_ENERGY_SMOOTHING [eV] 0.2", type_of_var=
real_t, unit_str=
"eV", &
350 END SUBROUTINE create_frontier_orbitals_section
356 SUBROUTINE create_frontier_orbital_screening_section(section)
362 cpassert(.NOT.
ASSOCIATED(section))
364 section, __location__, name=
"FRONTIER_ORBITAL_SCREENING", &
365 description=
"Optimize a basis set to match frontier orbitals of a reference basis "// &
366 "(frontier orbitals: orbitals close to the HOMO and close to the LUMO). This section uses the "// &
367 "optimization described in OPTIMIZE_BASIS%FRONTIER_ORBITALS, where the complete optimization "// &
368 "theory is given. The optimization contains several parameters, in particular the prefactors "// &
369 "of its different loss functions, and the resulting optimized basis set can depend strongly "// &
370 "on these prefactors. This section runs up to five pre-tabulated sets of optimization "// &
371 "parameters. All optimized basis sets are reported together with their self-consistent "// &
372 "HOMO-LUMO gaps and total energies. The optimization uses the fixed electron density obtained "// &
373 "with a large reference basis, and CP2K also converges an SCF calculation with every optimized "// &
374 "basis set and reports the resulting HOMO-LUMO gap and total energy. No training calculation "// &
375 "or previous DFT calculation needs to be read. All DFT calculations are performed automatically "// &
376 "inside CP2K when this section is activated, using the DFT input parameters supplied in the "// &
377 "FORCE_EVAL section of the input file. All optimized basis sets are written to "// &
378 "BASIS_OUTPUT_FILE with suffixes such as _1 and _2.", &
381 CALL keyword_create(keyword, __location__, name=
"NUMBER_OF_OPTIMIZATIONS", &
382 description=
"Number of pre-tabulated sets of optimization parameters.", &
383 usage=
"NUMBER_OF_OPTIMIZATIONS 5", &
388 END SUBROUTINE create_frontier_orbital_screening_section
394 SUBROUTINE create_fit_kinds_section(section)
400 NULLIFY (keyword, subsection)
401 cpassert(.NOT.
ASSOCIATED(section))
403 description=
"specicifies the atomic kinds to be fitted and the basis"// &
404 " sets associated with the kind.", &
407 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
408 description=
"The name of the kind described in this section.", &
409 usage=
"H", default_c_val=
"DEFAULT")
414 description=
"The name of the basis set for the kind. Has to be specified in BASIS_TEMPLATE_FILE.", &
415 usage=
"BASIS_SET H", default_c_val=
"DEFAULT")
419 CALL keyword_create(keyword, __location__, name=
"INITIAL_DEGREES_OF_FREEDOM", &
420 description=
"Specifies the initial degrees of freedom in the basis optimization. "// &
421 "This can be used to make further specifications easier", &
422 usage=
"INITIAL_DEGREES_OF_FREEDOM ALL", &
423 enum_c_vals=
s2a(
"ALL",
"NONE",
"COEFFICIENTS",
"EXPONENTS"), &
424 enum_desc=
s2a(
"Set all parameters in the basis to be variable.", &
425 "Set all parameters in the basis to be fixed.", &
426 "Set all coefficients in the basis set to be variable.", &
427 "Set all exponents in the basis to be variable."), &
433 CALL keyword_create(keyword, __location__, name=
"SWITCH_COEFF_STATE", &
434 description=
"Allows to switch the state of a given coefficient from current state "// &
435 "(varibale/fixed)) to the opposite state. The three integers indicate "// &
436 "the set number, the angular momentum i'th contraction and i'th coefficient", repeats=.true., &
437 usage=
"SWITCH_COEFF_STATE SET L CONTRACTION IPGF", type_of_var=
integer_t, n_var=4)
441 CALL keyword_create(keyword, __location__, name=
"SWITCH_CONTRACTION_STATE", &
442 description=
"Allows to switch the state of a given contraction from current state "// &
443 "(varibale/fixed)) to the opposite state. The three integers indicate "// &
444 "the set number, the angular momentum and i'th contraction ", repeats=.true., &
445 usage=
"SWITCH_CONTRACTION_STATE SET L CONTRACTION ", type_of_var=
integer_t, n_var=3)
449 CALL keyword_create(keyword, __location__, name=
"SWITCH_EXP_STATE", &
450 description=
"Allows to switch the state of a given exponent from current state "// &
451 "(varibale/fixed)) to the opposite state. The two integers indicate "// &
452 "the set number and i'th exponent", repeats=.true., &
453 usage=
"SWITCH_EXP_STATE SET IEXP", type_of_var=
integer_t, n_var=2)
457 CALL keyword_create(keyword, __location__, name=
"SWITCH_SET_STATE", &
458 description=
"Allows to switch the states of in a set from current state "// &
459 "(varibale/fixed)) to the opposite state. The two integers indicate "// &
460 "the affected part (0=ALL,1=EXPS,2=COEFF) and i'th set", repeats=.true., &
461 usage=
"SWITCH_SET_STATE SET IEXP", type_of_var=
integer_t, n_var=2)
465 CALL create_constrain_exp_section(subsection)
469 CALL create_derived_sets_section(subsection)
473 END SUBROUTINE create_fit_kinds_section
479 SUBROUTINE create_derived_sets_section(section)
485 cpassert(.NOT.
ASSOCIATED(section))
486 CALL section_create(section, __location__, name=
"DERIVED_BASIS_SETS", &
487 description=
"This section can be used to create subsets of a basis"// &
488 " which will be fitted at the same time. This is especially useful if connected"// &
489 " bsis sets e.g. TZVP, DZVP, SZV should be fitted.", &
492 CALL keyword_create(keyword, __location__, name=
"BASIS_SET_NAME", &
493 description=
"Defines the name of the derived basis set, which will be "// &
494 "automatically generated otherwise.", &
495 usage=
"BASIS_SET_NAME {word}", &
502 CALL keyword_create(keyword, __location__, name=
"REFERENCE_SET", &
503 description=
"Specifies the reference basis ID which is used as template to create the new set. "// &
504 "The original basis has ID 0. All following sets are counted in order as specified in the Input."// &
505 " The descriptors always assume the structure of the input basis set.", &
506 repeats=.false., usage=
"REFERENCE_SET INTEGER", default_i_val=0)
510 CALL keyword_create(keyword, __location__, name=
"REMOVE_CONTRACTION", &
511 description=
"Can be used to remove a contraction from the reference basis set. "// &
512 "The contraction is speciefied by set number, angular momentum and number of contraction."// &
513 " The descriptors always assume the structure of the input basis set.", &
514 repeats=.true., usage=
"REMOVE_CONTRACTION SET L ICONTRACTION", type_of_var=
integer_t, n_var=3)
519 description=
"Can be used to remove a set from the reference basis set. ", &
520 repeats=.true., usage=
"REMOVE_SET SET", type_of_var=
integer_t, n_var=1)
524 END SUBROUTINE create_derived_sets_section
530 SUBROUTINE create_constrain_exp_section(section)
536 cpassert(.NOT.
ASSOCIATED(section))
537 CALL section_create(section, __location__, name=
"CONSTRAIN_EXPONENTS", &
538 description=
"specicifies constraints for the exponents to be fitted."// &
539 " Only a single constraint can be applied to an exponent", &
543 description=
"Defines the exponent to be constraint. The two integers indicate "// &
544 "the set number and i'th exponent. The value -1 can be used to mark all sets/exponents in a set.", &
545 repeats=.false., usage=
"USE_EXP SET IEXP", type_of_var=
integer_t, n_var=2)
550 description=
"Defines the boundaries to which the optimization is restricted."// &
551 " First value is the lower bound, second value is the upper bound.", &
552 repeats=.false., usage=
"BOUNDARIES LOWER UPPER", type_of_var=
real_t, n_var=2)
556 CALL keyword_create(keyword, __location__, name=
"MAX_VAR_FRACTION", &
557 description=
"Defines the maximum fractionr by which the exponent is allowed to vary."// &
558 " e.g. 0.5 allows the exp to vary by 0.5*exp in both directions.", &
559 repeats=.false., usage=
"MAX_VAR_FRACTION REAL", type_of_var=
real_t, n_var=1)
563 END SUBROUTINE create_constrain_exp_section
569 SUBROUTINE create_training_section(section)
575 cpassert(.NOT.
ASSOCIATED(section))
576 CALL section_create(section, __location__, name=
"TRAINING_FILES", &
577 description=
"specicifies the location in which the files necessary for"// &
578 " fitting procedure are located. Each Training set needs a repetition of this section.", &
582 description=
"the directory in which the files are placed", &
583 usage=
"DIRECTORY /my/path", &
588 CALL keyword_create(keyword, __location__, name=
"INPUT_FILE_NAME", &
589 description=
"the filename of the input file used to run the original calculation", &
590 usage=
"INPUT_FILE_NAME my_input.inp", &
591 default_lc_val=
"input.inp")
595 END SUBROUTINE create_training_section
601 SUBROUTINE create_powell_section(section)
607 cpassert(.NOT.
ASSOCIATED(section))
609 description=
"sets the parameters for optimizition, output frequency and restarts", &
613 description=
"Final accuracy requested in optimization (RHOEND)", &
614 usage=
"ACCURACY 0.00001", &
615 default_r_val=1.e-5_dp)
620 description=
"Initial step size for search algorithm (RHOBEG)", &
621 usage=
"STEP_SIZE 0.005", &
622 default_r_val=0.1_dp)
627 description=
"Maximum number of function evaluations", &
628 usage=
"MAX_FUN 1000", &
633 END SUBROUTINE create_powell_section
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Defines the basic variable types.
integer, parameter, public dp
Utilities for string manipulations.