(git:591cf04)
Loading...
Searching...
No Matches
input_cp2k_properties_dft.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief function that build the dft section of the input
10!> \par History
11!> 01.2013 moved out of input_cp2k_dft [MI]
12!> \author MI
13! **************************************************************************************************
15 USE bibliography, ONLY: futera2017, &
19 kondov2007, &
21 luber2014, &
25 weber2009, &
34 USE cp_units, ONLY: cp_unit_to_cp2k
35 USE input_constants, ONLY: &
39 evgw0, g0w0, &
65 USE input_val_types, ONLY: char_t, &
66 integer_t, &
67 lchar_t, &
68 logical_t, &
69 real_t
71 USE kinds, ONLY: dp
72 USE string_utilities, ONLY: s2a
73#include "./base/base_uses.f90"
74
75 IMPLICIT NONE
76 PRIVATE
77
78 LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
79 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_properties_dft'
80
82
83CONTAINS
84
85! **************************************************************************************************
86!> \brief Create the PROPERTIES section
87!> \param section the section to create
88!> \author teo
89! **************************************************************************************************
90 SUBROUTINE create_properties_section(section)
91 TYPE(section_type), POINTER :: section
92
93 TYPE(keyword_type), POINTER :: keyword
94 TYPE(section_type), POINTER :: subsection
95
96 cpassert(.NOT. ASSOCIATED(section))
97 CALL section_create(section, __location__, name="PROPERTIES", &
98 description="This section is used to set up the PROPERTIES calculation.", &
99 n_keywords=0, n_subsections=6, repeats=.false.)
100
101 NULLIFY (subsection, keyword)
102
103 CALL create_linres_section(subsection, create_subsections=.true.)
104 CALL section_add_subsection(section, subsection)
105 CALL section_release(subsection)
106
107 CALL create_et_coupling_section(subsection)
108 CALL section_add_subsection(section, subsection)
109 CALL section_release(subsection)
110
111 CALL create_resp_section(subsection)
112 CALL section_add_subsection(section, subsection)
113 CALL section_release(subsection)
114
115 CALL create_atprop_section(subsection)
116 CALL section_add_subsection(section, subsection)
117 CALL section_release(subsection)
118
119 CALL cp_print_key_section_create(subsection, __location__, name="FIT_CHARGE", &
120 description="This section is used to print the density derived atomic point charges. "// &
121 "The fit of the charges is controlled through the DENSITY_FITTING section", &
122 print_level=high_print_level, filename="__STD_OUT__")
123 CALL keyword_create(keyword, __location__, name="TYPE_OF_DENSITY", &
124 description="Specifies the type of density used for the fitting", &
125 usage="TYPE_OF_DENSITY (FULL|SPIN)", &
126 enum_c_vals=s2a("FULL", "SPIN"), &
127 enum_i_vals=[do_full_density, do_spin_density], &
128 enum_desc=s2a("Full density", "Spin density"), &
129 default_i_val=do_full_density)
130 CALL section_add_keyword(subsection, keyword)
131 CALL keyword_release(keyword)
132 CALL section_add_subsection(section, subsection)
133 CALL section_release(subsection)
134
135 CALL create_tddfpt2_section(subsection)
136 CALL section_add_subsection(section, subsection)
137 CALL section_release(subsection)
138
139 CALL create_rixs_section(subsection)
140 CALL section_add_subsection(section, subsection)
141 CALL section_release(subsection)
142
143 CALL create_kubo_transport_section(subsection)
144 CALL section_add_subsection(section, subsection)
145 CALL section_release(subsection)
146
147 CALL create_bandstructure_section(subsection)
148 CALL section_add_subsection(section, subsection)
149 CALL section_release(subsection)
150
151 CALL create_tipscan_section(subsection)
152 CALL section_add_subsection(section, subsection)
153 CALL section_release(subsection)
154
155 END SUBROUTINE create_properties_section
156
157! **************************************************************************************************
158!> \brief creates the input structure used to activate finite-volume Kubo transport
159! **************************************************************************************************
160
161 SUBROUTINE create_kubo_transport_section(section)
162 TYPE(section_type), POINTER :: section
163 TYPE(keyword_type), POINTER :: keyword
164
165 cpassert(.NOT. ASSOCIATED(section))
166
167 NULLIFY (keyword)
168
169 CALL section_create(section, __location__, name="KUBO_TRANSPORT", &
170 description="Finite-volume Kubo-Greenwood transport coefficients from the "// &
171 "converged Quickstep Hamiltonian, overlap matrix, and atomic geometry. "// &
172 "For one- and two-dimensional cells, transport is projected onto the "// &
173 "periodic subspace and normalized by the periodic length or area.", &
174 n_keywords=8, n_subsections=0, repeats=.false., &
175 citations=[kuhneheskeprodan2020])
176
177 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
178 description="Controls the activation of the Kubo transport calculation.", &
179 default_l_val=.false., &
180 lone_keyword_l_val=.true.)
181 CALL section_add_keyword(section, keyword)
182 CALL keyword_release(keyword)
183
184 CALL keyword_create(keyword, __location__, name="METHOD", &
185 description="Transport algorithm. DIAGONALIZATION evaluates the finite-volume "// &
186 "Kubo-Greenwood expression from the explicit spectrum. TD and CHEBYSHEV are "// &
187 "reserved for future diagonalization-free implementations.", &
188 usage="METHOD DIAGONALIZATION", &
189 n_var=1, type_of_var=char_t, default_c_val="DIAGONALIZATION")
190 CALL section_add_keyword(section, keyword)
191 CALL keyword_release(keyword)
192
193 CALL keyword_create(keyword, __location__, name="TEMPERATURE", &
194 description="Electronic temperature used in the Fermi operator.", &
195 usage="TEMPERATURE 1.0", &
196 default_r_val=cp_unit_to_cp2k(value=1.0_dp, unit_str="K"), &
197 n_var=1, type_of_var=real_t, unit_str="K")
198 CALL section_add_keyword(section, keyword)
199 CALL keyword_release(keyword)
200
201 CALL keyword_create(keyword, __location__, name="DISSIPATION", &
202 description="Dissipation/broadening parameter in the finite-temperature "// &
203 "Kubo formula.", &
204 usage="DISSIPATION 300.0", &
205 default_r_val=cp_unit_to_cp2k(value=300.0_dp, unit_str="K"), &
206 n_var=1, type_of_var=real_t, unit_str="K")
207 CALL section_add_keyword(section, keyword)
208 CALL keyword_release(keyword)
209
210 CALL keyword_create(keyword, __location__, name="ENERGY_RANGE", &
211 description="Absolute chemical-potential range. The default 0 0 uses the "// &
212 "full eigenvalue range of the finite-volume Hamiltonian.", &
213 usage="ENERGY_RANGE -0.5 0.5", &
214 default_r_vals=[0.0_dp, 0.0_dp], n_var=2, type_of_var=real_t, &
215 unit_str="hartree")
216 CALL section_add_keyword(section, keyword)
217 CALL keyword_release(keyword)
218
219 CALL keyword_create(keyword, __location__, name="NEUTRAL_MU", &
220 description="Optional fixed neutral chemical potential. If omitted, the "// &
221 "neutral point is found from the eigenvalue spectrum and total electron count.", &
222 usage="NEUTRAL_MU 0.245467619658419", &
223 n_var=1, type_of_var=real_t, unit_str="hartree")
224 CALL section_add_keyword(section, keyword)
225 CALL keyword_release(keyword)
226
227 CALL keyword_create(keyword, __location__, name="N_MU", &
228 description="Number of chemical-potential grid points.", &
229 usage="N_MU 200", &
230 default_i_val=200, n_var=1, type_of_var=integer_t)
231 CALL section_add_keyword(section, keyword)
232 CALL keyword_release(keyword)
233
234 CALL keyword_create(keyword, __location__, name="NEUTRAL_GRID", &
235 description="Number of grid points used to locate the neutral chemical potential.", &
236 usage="NEUTRAL_GRID 10000", &
237 default_i_val=10000, n_var=1, type_of_var=integer_t)
238 CALL section_add_keyword(section, keyword)
239 CALL keyword_release(keyword)
240
241 END SUBROUTINE create_kubo_transport_section
242
243! **************************************************************************************************
244!> \brief creates the input structure used to activate
245!> a resonant inelastic xray scattering (RIXS) calculation
246! **************************************************************************************************
247
248 SUBROUTINE create_rixs_section(section)
249 TYPE(section_type), POINTER :: section
250 TYPE(section_type), POINTER :: subsection, print_key
251 TYPE(keyword_type), POINTER :: keyword
252
253 cpassert(.NOT. ASSOCIATED(section))
254
255 NULLIFY (keyword, subsection, print_key)
256
257 CALL section_create(section, __location__, name="RIXS", &
258 description="Resonant Inelastic Xray Scattering using XAS_TDP and TDDFPT.", &
259 n_keywords=1, n_subsections=3, repeats=.false., &
260 citations=[vazdacruz2021])
261
262 CALL keyword_create(keyword, __location__, &
263 name="_SECTION_PARAMETERS_", &
264 description="Controls the activation of the RIXS procedure", &
265 default_l_val=.false., &
266 lone_keyword_l_val=.true.)
267 CALL section_add_keyword(section, keyword)
268 CALL keyword_release(keyword)
269
270 CALL keyword_create(keyword, __location__, name="CORE_STATES", &
271 description="Number of core excited states to be used in the RIXS "// &
272 "calculation. Restricting this number reduces computational cost. "// &
273 "-1 means all available core states will be used.", &
274 n_var=1, type_of_var=integer_t, default_i_val=-1)
275 CALL section_add_keyword(section, keyword)
276 CALL keyword_release(keyword)
277
278 CALL keyword_create(keyword, __location__, name="VALENCE_STATES", &
279 description="Number of valence excited states to be used in the RIXS "// &
280 "calculation. Restricting this number reduces computational cost, but "// &
281 "removes spectral features corresponding to higher excitations. Should be "// &
282 "used with care. -1 means all available valence states will be used.", &
283 n_var=1, type_of_var=integer_t, default_i_val=-1)
284 CALL section_add_keyword(section, keyword)
285 CALL keyword_release(keyword)
286
287 CALL create_tddfpt2_section(subsection)
288 CALL section_add_subsection(section, subsection)
289 CALL section_release(subsection)
290
291 CALL create_xas_tdp_section(subsection)
292 CALL section_add_subsection(section, subsection)
293 CALL section_release(subsection)
294
295 CALL section_create(subsection, __location__, "PRINT", "Controls the printing of information "// &
296 "during RIXS calculations", repeats=.false.)
297
298 CALL cp_print_key_section_create(print_key, __location__, name="SPECTRUM", &
299 description="Controles the printing of the RIXS spectrum "// &
300 "in output files", &
301 print_level=low_print_level, filename="", &
302 common_iter_levels=3)
303 CALL section_add_subsection(subsection, print_key)
304 CALL section_release(print_key)
305
306 CALL section_add_subsection(section, subsection)
307 CALL section_release(subsection)
308
309 END SUBROUTINE create_rixs_section
310
311! **************************************************************************************************
312!> \brief creates the input structure used to activate
313!> a linear response calculation
314!> Available properties : none
315!> \param section the section to create
316!> \param create_subsections indicates whether or not subsections should be created
317!> \param default_set_tdlr default parameters to be used if called from TDDFPT
318!> \author MI
319! **************************************************************************************************
320 SUBROUTINE create_linres_section(section, create_subsections, default_set_tdlr)
321 TYPE(section_type), POINTER :: section
322 LOGICAL, INTENT(in) :: create_subsections
323 LOGICAL, INTENT(IN), OPTIONAL :: default_set_tdlr
324
325 INTEGER :: def_max_iter, def_precond
326 REAL(kind=dp) :: def_egap, def_eps, def_eps_filter
327 TYPE(keyword_type), POINTER :: keyword
328 TYPE(section_type), POINTER :: print_key, subsection
329
330 CHARACTER(len=256) :: desc
331
332 NULLIFY (keyword, print_key)
333
334 IF (PRESENT(default_set_tdlr)) THEN
335 def_egap = 0.02_dp
336 def_eps = 1.0e-10_dp
337 def_eps_filter = 1.0e-15_dp
338 def_max_iter = 100
340 desc = "Controls the parameters of the LINRES force calculations for excited states."
341 ELSE
342 def_egap = 0.2_dp
343 def_eps = 1.e-6_dp
344 def_eps_filter = 0.0_dp
345 def_max_iter = 50
346 def_precond = ot_precond_none
347 desc = "The linear response is used to calculate one of the following properties: nmr, epr, raman, ..."
348 END IF
349
350 cpassert(.NOT. ASSOCIATED(section))
351 CALL section_create(section, __location__, name="linres", &
352 description=desc, n_keywords=5, n_subsections=2, repeats=.false., &
353 citations=[putrino2000])
354
355 CALL keyword_create(keyword, __location__, name="EPS", &
356 description="target accuracy for the convergence of the conjugate gradient.", &
357 usage="EPS 1.e-6", default_r_val=def_eps)
358 CALL section_add_keyword(section, keyword)
359 CALL keyword_release(keyword)
360
361 CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
362 description="Filter threshold for response density matrix.", &
363 usage="EPS_FILTER 1.e-8", default_r_val=def_eps_filter)
364 CALL section_add_keyword(section, keyword)
365 CALL keyword_release(keyword)
366
367 CALL keyword_create(keyword, __location__, name="MAX_ITER", &
368 description="Maximum number of conjugate gradient iteration to be performed for one optimization.", &
369 usage="MAX_ITER 200", default_i_val=def_max_iter)
370 CALL section_add_keyword(section, keyword)
371 CALL keyword_release(keyword)
372
373 CALL keyword_create(keyword, __location__, name="RESTART_EVERY", &
374 description="Restart the conjugate gradient after the specified number of iterations.", &
375 usage="RESTART_EVERY 200", default_i_val=50)
376 CALL section_add_keyword(section, keyword)
377 CALL keyword_release(keyword)
378
379 CALL keyword_create( &
380 keyword, __location__, name="PRECONDITIONER", &
381 description="Type of preconditioner to be used with all minimization schemes. "// &
382 "They differ in effectiveness, cost of construction, cost of application. "// &
383 "Properly preconditioned minimization can be orders of magnitude faster than doing nothing.", &
384 usage="PRECONDITIONER FULL_ALL", &
385 default_i_val=def_precond, &
386 enum_c_vals=s2a("FULL_ALL", "FULL_SINGLE_INVERSE", "FULL_SINGLE", "FULL_KINETIC", "FULL_S_INVERSE", &
387 "NONE"), &
388 enum_desc=s2a("Most effective state selective preconditioner based on diagonalization, "// &
389 "requires the ENERGY_GAP parameter to be an underestimate of the HOMO-LUMO gap. "// &
390 "This preconditioner is recommended for almost all systems, except very large systems where "// &
391 "make_preconditioner would dominate the total computational cost.", &
392 "Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
393 "but cheaper to construct, "// &
394 "might be somewhat less robust. Recommended for large systems.", &
395 "Based on H-eS diagonalisation, not as good as FULL_ALL, but somewhat cheaper to apply. ", &
396 "Cholesky inversion of S and T, fast construction, robust, and relatively good, "// &
397 "use for very large systems.", &
398 "Cholesky inversion of S, not as good as FULL_KINETIC, yet equally expensive.", &
399 "skip preconditioning"), &
402 CALL section_add_keyword(section, keyword)
403 CALL keyword_release(keyword)
404
405 CALL keyword_create(keyword, __location__, name="ENERGY_GAP", &
406 description="Energy gap estimate [a.u.] for preconditioning", &
407 usage="ENERGY_GAP 0.1", &
408 default_r_val=def_egap)
409 CALL section_add_keyword(section, keyword)
410 CALL keyword_release(keyword)
411
412 CALL keyword_create(keyword, __location__, name="EVERY_N_STEP", &
413 description="Perform a linear response calculation every N-th step for MD run", &
414 usage="EVERY_N_STEP 50", default_i_val=1)
415 CALL section_add_keyword(section, keyword)
416 CALL keyword_release(keyword)
417
418 CALL keyword_create(keyword, __location__, name="RESTART", &
419 description="Restart the response calculation if the restart file exists", &
420 usage="RESTART", &
421 default_l_val=.false., lone_keyword_l_val=.true.)
422 CALL section_add_keyword(section, keyword)
423 CALL keyword_release(keyword)
424
425 CALL keyword_create(keyword, __location__, name="WFN_RESTART_FILE_NAME", &
426 variants=["RESTART_FILE_NAME"], &
427 description="Root of the file names where to read the response functions from "// &
428 "which to restart the calculation of the linear response", &
429 usage="WFN_RESTART_FILE_NAME <FILENAME>", &
430 type_of_var=lchar_t)
431 CALL section_add_keyword(section, keyword)
432 CALL keyword_release(keyword)
433
434 IF (create_subsections) THEN
435 NULLIFY (subsection)
436
437 CALL create_localize_section(subsection)
438 CALL section_add_subsection(section, subsection)
439 CALL section_release(subsection)
440
441 CALL create_current_section(subsection)
442 CALL section_add_subsection(section, subsection)
443 CALL section_release(subsection)
444
445 CALL create_nmr_section(subsection)
446 CALL section_add_subsection(section, subsection)
447 CALL section_release(subsection)
448
449 CALL create_spin_spin_section(subsection)
450 CALL section_add_subsection(section, subsection)
451 CALL section_release(subsection)
452
453 CALL create_epr_section(subsection)
454 CALL section_add_subsection(section, subsection)
455 CALL section_release(subsection)
456
457 CALL create_polarizability_section(subsection)
458 CALL section_add_subsection(section, subsection)
459 CALL section_release(subsection)
460
461 CALL create_dcdr_section(subsection)
462 CALL section_add_subsection(section, subsection)
463 CALL section_release(subsection)
464
465 CALL create_vcd_section(subsection)
466 CALL section_add_subsection(section, subsection)
467 CALL section_release(subsection)
468
469 CALL section_create(subsection, __location__, name="PRINT", &
470 description="printing of information during the linear response calculation", &
471 repeats=.false.)
472
474 print_key, __location__, "program_run_info", &
475 description="Controls the printing of basic iteration information during the LINRES calculation", &
476 print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
477 CALL section_add_subsection(subsection, print_key)
478 CALL section_release(print_key)
479
480 CALL cp_print_key_section_create(print_key, __location__, "RESTART", &
481 description="Controls the dumping of restart file of the response wavefunction. "// &
482 "For each set of response functions, i.e. for each perturbation, "// &
483 "one different restart file is dumped. These restart files should be "// &
484 "employed only to restart the same type of LINRES calculation, "// &
485 "i.e. with the same perturbation.", &
486 print_level=low_print_level, common_iter_levels=3, each_iter_names=s2a("ITER"), &
487 add_last=add_last_numeric, each_iter_values=[3], filename="")
488 CALL section_add_subsection(subsection, print_key)
489 CALL section_release(print_key)
490
491 CALL section_add_subsection(section, subsection)
492 CALL section_release(subsection)
493
494 END IF
495
496 END SUBROUTINE create_linres_section
497
498! **************************************************************************************************
499!> \brief creates the input structure used to activate
500!> calculation of position perturbation DFPT
501!> \param section ...
502!> \author Sandra Luber, Edward Ditler
503! **************************************************************************************************
504 SUBROUTINE create_dcdr_section(section)
505
506 TYPE(section_type), POINTER :: section
507
508 LOGICAL :: failure
509 TYPE(keyword_type), POINTER :: keyword
510 TYPE(section_type), POINTER :: print_key, subsection
511
512 failure = .false.
513 NULLIFY (keyword, print_key, subsection)
514
515 cpassert(.NOT. ASSOCIATED(section))
516
517 IF (.NOT. failure) THEN
518 CALL section_create(section, __location__, name="DCDR", &
519 description="Compute analytical gradients the dipole moments.", &
520 n_keywords=50, n_subsections=1, repeats=.false.)
521
522 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
523 description="Controls the activation of the APT calculation. "// &
524 "Analytical derivatives are not available for functionals that depend on "// &
525 "the kinetic energy density; use APT_FD for these functionals.", &
526 usage="&DCDR T", &
527 default_l_val=.false., &
528 lone_keyword_l_val=.true.)
529 CALL section_add_keyword(section, keyword)
530 CALL keyword_release(keyword)
531
532 CALL keyword_create(keyword, __location__, name="LIST_OF_ATOMS", &
533 description="Specifies a list of atoms.", &
534 usage="LIST_OF_ATOMS {integer} {integer} .. {integer}", repeats=.true., &
535 n_var=-1, type_of_var=integer_t)
536 CALL section_add_keyword(section, keyword)
537 CALL keyword_release(keyword)
538
539 CALL keyword_create(keyword, __location__, name="DISTRIBUTED_ORIGIN", &
540 variants=["DO_GAUGE"], &
541 description="Use the distributed origin (DO) gauge?", &
542 usage="DISTRIBUTED_ORIGIN T", &
543 default_l_val=.false., lone_keyword_l_val=.true.)
544 CALL section_add_keyword(section, keyword)
545 CALL keyword_release(keyword)
546
547 CALL keyword_create(keyword, __location__, name="ORBITAL_CENTER", &
548 description="The orbital center.", &
549 usage="ORBITAL_CENTER WANNIER", &
550 default_i_val=current_orb_center_wannier, &
551 enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
552 enum_desc=s2a("Use the Wannier centers.", &
553 "Use a common center (works only for an isolate molecule).", &
554 "Use the atoms as center.", &
555 "Boxing."), &
558 CALL section_add_keyword(section, keyword)
559 CALL keyword_release(keyword)
560
561 CALL keyword_create(keyword, __location__, name="REFERENCE", &
562 description="Gauge origin of the velocity gauge factor.", &
563 enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
564 enum_desc=s2a("Use Center of Mass", &
565 "Use Center of Atomic Charges", &
566 "Use User-defined Point", &
567 "Use Origin of Coordinate System"), &
568 enum_i_vals=[use_mom_ref_com, &
572 default_i_val=use_mom_ref_zero)
573 CALL section_add_keyword(section, keyword)
574 CALL keyword_release(keyword)
575
576 CALL keyword_create(keyword, __location__, name="REFERENCE_POINT", &
577 description="User-defined reference point of the velocity gauge factor.", &
578 usage="REFERENCE_POINT x y z", &
579 repeats=.false., n_var=3, type_of_var=real_t, unit_str='bohr')
580 CALL section_add_keyword(section, keyword)
581 CALL keyword_release(keyword)
582
583 CALL keyword_create(keyword, __location__, name="Z_MATRIX_METHOD", &
584 description="Use Z_matrix method to solve the response equation", &
585 usage="Z_MATRIX_METHOD T", &
586 default_l_val=.false., lone_keyword_l_val=.true.)
587 CALL section_add_keyword(section, keyword)
588 CALL keyword_release(keyword)
589
590 CALL keyword_create(keyword, __location__, name="APT_FD", &
591 description="Use numerical differentiation to compute the APT, "// &
592 "switches off the calculation of dcdr analytical derivatives. "// &
593 "Requires RUN_TYPE = ENERGY_FORCE or MD.", &
594 usage="APT_FD T", &
595 default_l_val=.false., lone_keyword_l_val=.true.)
596 CALL section_add_keyword(section, keyword)
597 CALL keyword_release(keyword)
598
599 CALL keyword_create(keyword, __location__, name="APT_FD_DE", &
600 description="Electric field strength (atomic units) to use for finite differences", &
601 repeats=.false., &
602 n_var=1, &
603 type_of_var=real_t, &
604 default_r_val=0.0003_dp, &
605 usage="APT_FD_DE 1.0E-4")
606 CALL section_add_keyword(section, keyword)
607 CALL keyword_release(keyword)
608
609 CALL keyword_create(keyword, __location__, name="APT_FD_METHOD", &
610 description="Numerical differentiation method", &
611 usage="APT_FD_METHOD FD", &
612 default_i_val=1, &
613 !enum_c_vals=s2a("FD", "2PNT"), &
614 enum_c_vals=s2a("2PNT"), &
615 !enum_desc=s2a("Forward differences.", &
616 ! "Symmetric two-point differences."), &
617 enum_desc=s2a("Symmetric two-point differences."), &
618 !enum_i_vals=(/0, 1/))
619 enum_i_vals=[1])
620 CALL section_add_keyword(section, keyword)
621 CALL keyword_release(keyword)
622
623 NULLIFY (subsection)
624 CALL section_create(subsection, __location__, name="PRINT", &
625 description="print results of the magnetic dipole moment calculation", &
626 repeats=.false.)
627
628 CALL cp_print_key_section_create(print_key, __location__, "APT", &
629 description="Controls the printing of the electric dipole gradient", &
630 print_level=low_print_level, add_last=add_last_numeric, filename="")
631 CALL section_add_subsection(subsection, print_key)
632 CALL section_release(print_key)
633
634 CALL section_add_subsection(section, subsection)
635 CALL section_release(subsection)
636
637 NULLIFY (subsection)
638 CALL create_interp_section(subsection)
639 CALL section_add_subsection(section, subsection)
640 CALL section_release(subsection)
641
642 END IF
643
644 END SUBROUTINE create_dcdr_section
645
646! **************************************************************************************************
647!> \brief creates the input structure used to activate
648!> calculation of VCD spectra using DFPT
649!> \param section ...
650!> \author Sandra Luber, Tomas Zimmermann, Edward Ditler
651! **************************************************************************************************
652 SUBROUTINE create_vcd_section(section)
653
654 TYPE(section_type), POINTER :: section
655
656 TYPE(keyword_type), POINTER :: keyword
657 TYPE(section_type), POINTER :: print_key, subsection
658
659 NULLIFY (keyword, print_key, subsection)
660
661 cpassert(.NOT. ASSOCIATED(section))
662
663 CALL section_create(section, __location__, name="VCD", &
664 description="Carry out a VCD calculation.", &
665 n_keywords=50, n_subsections=1, repeats=.false.)
666
667 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
668 description="controls the activation of the APT/AAT calculation", &
669 usage="&VCD T", &
670 default_l_val=.false., &
671 lone_keyword_l_val=.true.)
672 CALL section_add_keyword(section, keyword)
673 CALL keyword_release(keyword)
674
675 CALL keyword_create(keyword, __location__, name="LIST_OF_ATOMS", &
676 description="Specifies a list of atoms.", &
677 usage="LIST_OF_ATOMS {integer} {integer} .. {integer}", repeats=.true., &
678 n_var=-1, type_of_var=integer_t)
679 CALL section_add_keyword(section, keyword)
680 CALL keyword_release(keyword)
681
682 CALL keyword_create(keyword, __location__, name="DISTRIBUTED_ORIGIN", &
683 variants=["DO_GAUGE"], &
684 description="Use the distributed origin (DO) gauge?", &
685 usage="DISTRIBUTED_ORIGIN T", &
686 default_l_val=.false., lone_keyword_l_val=.true.)
687 CALL section_add_keyword(section, keyword)
688 CALL keyword_release(keyword)
689
690 CALL keyword_create(keyword, __location__, name="ORIGIN_DEPENDENT_MFP", &
691 description="Use the origin dependent MFP operator.", &
692 usage="ORIGIN_DEPENDENT_MFP T", &
693 default_l_val=.false., lone_keyword_l_val=.true.)
694 CALL section_add_keyword(section, keyword)
695 CALL keyword_release(keyword)
696
697 CALL keyword_create(keyword, __location__, name="ORBITAL_CENTER", &
698 description="The orbital center.", &
699 usage="ORBITAL_CENTER WANNIER", &
700 default_i_val=current_orb_center_wannier, &
701 enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
702 enum_desc=s2a("Use the Wannier centers.", &
703 "Use a common center (works only for an isolate molecule).", &
704 "Use the atoms as center.", &
705 "Boxing."), &
708 CALL section_add_keyword(section, keyword)
709 CALL keyword_release(keyword)
710
711 ! The origin of the magnetic dipole operator (r - MAGNETIC_ORIGIN) x momentum
712 CALL keyword_create(keyword, __location__, name="MAGNETIC_ORIGIN", &
713 description="Gauge origin of the magnetic dipole operator.", &
714 enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
715 enum_desc=s2a("Use Center of Mass", &
716 "Use Center of Atomic Charges", &
717 "Use User-defined Point", &
718 "Use Origin of Coordinate System"), &
719 enum_i_vals=[use_mom_ref_com, &
723 default_i_val=use_mom_ref_zero)
724 CALL section_add_keyword(section, keyword)
725 CALL keyword_release(keyword)
726
727 CALL keyword_create(keyword, __location__, name="MAGNETIC_ORIGIN_REFERENCE", &
728 description="User-defined reference point of the magnetic dipole operator.", &
729 usage="MAGNETIC_ORIGIN_REFERENCE x y z", &
730 repeats=.false., n_var=3, type_of_var=real_t, unit_str='bohr')
731 CALL section_add_keyword(section, keyword)
732 CALL keyword_release(keyword)
733
734 ! The origin of the coordinate system
735 CALL keyword_create(keyword, __location__, name="SPATIAL_ORIGIN", &
736 description="Gauge origin of the velocity gauge factor/spatial origin.", &
737 enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
738 enum_desc=s2a("Use Center of Mass", &
739 "Use Center of Atomic Charges", &
740 "Use User-defined Point", &
741 "Use Origin of Coordinate System"), &
742 enum_i_vals=[use_mom_ref_com, &
746 default_i_val=use_mom_ref_zero)
747 CALL section_add_keyword(section, keyword)
748 CALL keyword_release(keyword)
749
750 CALL keyword_create(keyword, __location__, name="SPATIAL_ORIGIN_REFERENCE", &
751 description="User-defined reference point of the velocity gauge factor/spatial origin.", &
752 usage="SPATIAL_ORIGIN_REFERENCE x y z", &
753 repeats=.false., n_var=3, type_of_var=real_t, unit_str='bohr')
754 CALL section_add_keyword(section, keyword)
755 CALL keyword_release(keyword)
756
757 NULLIFY (subsection)
758 CALL section_create(subsection, __location__, name="PRINT", &
759 description="print results of the magnetic dipole moment calculation", &
760 repeats=.false.)
761
762 CALL cp_print_key_section_create(print_key, __location__, "VCD", &
763 description="Controls the printing of the APTs and AATs", &
764 print_level=low_print_level, add_last=add_last_numeric, filename="")
765 CALL section_add_subsection(subsection, print_key)
766 CALL section_release(print_key)
767
768 CALL section_add_subsection(section, subsection)
769 CALL section_release(subsection)
770
771 NULLIFY (subsection)
772 CALL create_interp_section(subsection)
773 CALL section_add_subsection(section, subsection)
774 CALL section_release(subsection)
775
776 END SUBROUTINE create_vcd_section
777
778! **************************************************************************************************
779!> \brief creates the input structure used to activate
780!> calculation of induced current DFPT
781!> Available properties : none
782!> \param section the section to create
783!> \author MI/VW
784! **************************************************************************************************
785 SUBROUTINE create_current_section(section)
786 TYPE(section_type), POINTER :: section
787
788 TYPE(keyword_type), POINTER :: keyword
789 TYPE(section_type), POINTER :: print_key, subsection
790
791 NULLIFY (keyword, print_key, subsection)
792
793 cpassert(.NOT. ASSOCIATED(section))
794 CALL section_create(section, __location__, name="current", &
795 description="The induced current density is calculated by DFPT.", &
796 n_keywords=4, n_subsections=1, repeats=.false., &
797 citations=[sebastiani2001, weber2009])
798
799 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
800 description="controls the activation of the induced current calculation", &
801 usage="&CURRENT T", &
802 default_l_val=.false., &
803 lone_keyword_l_val=.true.)
804 CALL section_add_keyword(section, keyword)
805 CALL keyword_release(keyword)
806
807 CALL keyword_create(keyword, __location__, name="GAUGE", &
808 description="The gauge used to compute the induced current within GAPW.", &
809 usage="GAUGE R", &
810 default_i_val=current_gauge_r_and_step_func, &
811 enum_c_vals=s2a("R", "R_AND_STEP_FUNCTION", "ATOM"), &
812 enum_desc=s2a("Position gauge (doesnt work well).", &
813 "Position and step function for the soft and the local parts, respectively.", &
814 "Atoms."), &
816 CALL section_add_keyword(section, keyword)
817 CALL keyword_release(keyword)
818
819 CALL keyword_create(keyword, __location__, name="GAUGE_ATOM_RADIUS", &
820 description="Build the gauge=atom using only the atoms within this radius.", &
821 usage="GAUGE_ATOM_RADIUS 10.0", &
822 type_of_var=real_t, &
823 default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
824 unit_str="angstrom")
825 CALL section_add_keyword(section, keyword)
826 CALL keyword_release(keyword)
827
828 CALL keyword_create(keyword, __location__, name="USE_OLD_GAUGE_ATOM", &
829 description="Use the old way to compute the gauge.", &
830 usage="USE_OLD_GAUGE_ATOM T", &
831 default_l_val=.true., lone_keyword_l_val=.true.)
832 CALL section_add_keyword(section, keyword)
833 CALL keyword_release(keyword)
834
835 CALL keyword_create(keyword, __location__, name="ORBITAL_CENTER", &
836 description="The orbital center.", &
837 usage="ORBITAL_CENTER WANNIER", &
838 default_i_val=current_orb_center_wannier, &
839 enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
840 enum_desc=s2a("Use the Wannier centers.", &
841 "Use a common center (works only for an isolate molecule).", &
842 "Use the atoms as center.", &
843 "Boxing."), &
846 CALL section_add_keyword(section, keyword)
847 CALL keyword_release(keyword)
848
849 CALL keyword_create(keyword, __location__, name="COMMON_CENTER", &
850 description="The common center ", usage="COMMON_CENTER 0.0 1.0 0.0", &
851 n_var=3, default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp], type_of_var=real_t, &
852 unit_str="angstrom")
853 CALL section_add_keyword(section, keyword)
854 CALL keyword_release(keyword)
855
856 CALL keyword_create(keyword, __location__, name="NBOX", &
857 description="How many boxes along each directions ", usage="NBOX 6 6 5", &
858 n_var=3, default_i_vals=[4, 4, 4], type_of_var=integer_t)
859 CALL section_add_keyword(section, keyword)
860 CALL keyword_release(keyword)
861
862 CALL keyword_create(keyword, __location__, name="CHI_PBC", &
863 description="Calculate the succeptibility correction to the shift with PBC", &
864 usage="CHI_PBC T", &
865 default_l_val=.false., lone_keyword_l_val=.true.)
866 CALL section_add_keyword(section, keyword)
867 CALL keyword_release(keyword)
868
869 CALL keyword_create(keyword, __location__, name="FORCE_NO_FULL", &
870 description="Avoid the calculation of the state dependent perturbation term, "// &
871 "even if the orbital centers are set at Wannier centers or at Atom centers", &
872 usage="FORCE_NO_FULL T", &
873 default_l_val=.false., lone_keyword_l_val=.true.)
874 CALL section_add_keyword(section, keyword)
875 CALL keyword_release(keyword)
876
877 CALL keyword_create(keyword, __location__, name="SELECTED_STATES_ON_ATOM_LIST", &
878 description="Indexes of the atoms for selecting"// &
879 " the states to be used for the response calculations.", &
880 usage="SELECTED_STATES_ON_ATOM_LIST 1 2 10", &
881 n_var=-1, type_of_var=integer_t, repeats=.true.)
882 CALL section_add_keyword(section, keyword)
883 CALL keyword_release(keyword)
884
885 CALL keyword_create(keyword, __location__, name="SELECTED_STATES_ATOM_RADIUS", &
886 description="Select all the states included in the given radius around each atoms "// &
887 "in SELECTED_STATES_ON_ATOM_LIST.", &
888 usage="SELECTED_STATES_ATOM_RADIUS 2.0", &
889 type_of_var=real_t, &
890 default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
891 unit_str="angstrom")
892 CALL section_add_keyword(section, keyword)
893 CALL keyword_release(keyword)
894
895 CALL keyword_create(keyword, __location__, name="RESTART_CURRENT", &
896 description="Restart the induced current density calculation"// &
897 " from a previous run (not working yet).", &
898 usage="RESTART_CURRENT", default_l_val=.false., &
899 lone_keyword_l_val=.true.)
900 CALL section_add_keyword(section, keyword)
901 CALL keyword_release(keyword)
902
903 NULLIFY (subsection)
904 CALL section_create(subsection, __location__, name="PRINT", &
905 description="print results of induced current density calculation", &
906 repeats=.false.)
907
908 CALL cp_print_key_section_create(print_key, __location__, "CURRENT_CUBES", &
909 description="Controls the printing of the induced current density (not working yet).", &
910 print_level=high_print_level, add_last=add_last_numeric, filename="")
911 CALL keyword_create(keyword, __location__, name="stride", &
912 description="The stride (X,Y,Z) used to write the cube file "// &
913 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
914 " 1 number valid for all components (not working yet).", &
915 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
916 CALL section_add_keyword(print_key, keyword)
917 CALL keyword_release(keyword)
918 CALL keyword_create(keyword, __location__, name="APPEND", &
919 description="append the cube files when they already exist", &
920 default_l_val=.false., lone_keyword_l_val=.true.)
921 CALL section_add_keyword(print_key, keyword)
922 CALL keyword_release(keyword)
923
924 CALL section_add_subsection(subsection, print_key)
925 CALL section_release(print_key)
926
927 CALL cp_print_key_section_create(print_key, __location__, "RESPONSE_FUNCTION_CUBES", &
928 description="Controls the printing of the response functions (not working yet).", &
929 print_level=high_print_level, add_last=add_last_numeric, filename="")
930 CALL keyword_create(keyword, __location__, name="stride", &
931 description="The stride (X,Y,Z) used to write the cube file "// &
932 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
933 " 1 number valid for all components (not working yet).", &
934 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
935 CALL section_add_keyword(print_key, keyword)
936 CALL keyword_release(keyword)
937
938 CALL keyword_create(keyword, __location__, name="CUBES_LU_BOUNDS", &
939 variants=["CUBES_LU"], &
940 description="The lower and upper index of the states to be printed as cube (not working yet).", &
941 usage="CUBES_LU_BOUNDS integer integer", &
942 n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
943 CALL section_add_keyword(print_key, keyword)
944 CALL keyword_release(keyword)
945
946 CALL keyword_create(keyword, __location__, name="CUBES_LIST", &
947 description="Indexes of the states to be printed as cube files "// &
948 "This keyword can be repeated several times "// &
949 "(useful if you have to specify many indexes) (not working yet).", &
950 usage="CUBES_LIST 1 2", &
951 n_var=-1, type_of_var=integer_t, repeats=.true.)
952 CALL section_add_keyword(print_key, keyword)
953 CALL keyword_release(keyword)
954 CALL keyword_create(keyword, __location__, name="APPEND", &
955 description="append the cube files when they already exist", &
956 default_l_val=.false., lone_keyword_l_val=.true.)
957 CALL section_add_keyword(print_key, keyword)
958 CALL keyword_release(keyword)
959
960 CALL section_add_subsection(subsection, print_key)
961 CALL section_release(print_key)
962
963 CALL section_add_subsection(section, subsection)
964 CALL section_release(subsection)
965
966 NULLIFY (subsection)
967 CALL create_interp_section(subsection)
968 CALL section_add_subsection(section, subsection)
969 CALL section_release(subsection)
970
971 END SUBROUTINE create_current_section
972
973! **************************************************************************************************
974!> \brief creates the input structure used to activate
975!> calculation of NMR chemical shift using
976!> the induced current obtained from DFPT
977!> Available properties : none
978!> \param section the section to create
979!> \author MI/VW
980! **************************************************************************************************
981 SUBROUTINE create_nmr_section(section)
982 TYPE(section_type), POINTER :: section
983
984 TYPE(keyword_type), POINTER :: keyword
985 TYPE(section_type), POINTER :: print_key, subsection
986
987 NULLIFY (keyword, print_key, subsection)
988
989 cpassert(.NOT. ASSOCIATED(section))
990 CALL section_create(section, __location__, name="nmr", &
991 description="The chemical shift is calculated by DFPT.", &
992 n_keywords=5, n_subsections=1, repeats=.false., &
993 citations=[weber2009])
994
995 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
996 description="controls the activation of the nmr calculation", &
997 usage="&NMR T", &
998 default_l_val=.false., &
999 lone_keyword_l_val=.true.)
1000 CALL section_add_keyword(section, keyword)
1001 CALL keyword_release(keyword)
1002
1003 CALL keyword_create(keyword, __location__, name="INTERPOLATE_SHIFT", &
1004 description="Calculate the soft part of the chemical shift by interpolation ", &
1005 usage="INTERPOLATE_SHIFT T", &
1006 default_l_val=.false., lone_keyword_l_val=.true.)
1007 CALL section_add_keyword(section, keyword)
1008 CALL keyword_release(keyword)
1009
1010 CALL keyword_create(keyword, __location__, name="NICS", &
1011 description="Calculate the chemical shift in a set of points"// &
1012 " given from an external file", usage="NICS", &
1013 default_l_val=.false., lone_keyword_l_val=.true.)
1014 CALL section_add_keyword(section, keyword)
1015 CALL keyword_release(keyword)
1016
1017 CALL keyword_create(keyword, __location__, name="NICS_FILE_NAME", &
1018 description="Name of the file with the NICS points coordinates", &
1019 usage="NICS_FILE_NAME nics_file", &
1020 default_lc_val="nics_file")
1021 CALL section_add_keyword(section, keyword)
1022 CALL keyword_release(keyword)
1023
1024 CALL keyword_create(keyword, __location__, name="RESTART_NMR", &
1025 description="Restart the NMR calculation from a previous run (NOT WORKING YET)", &
1026 usage="RESTART_NMR", default_l_val=.false., &
1027 lone_keyword_l_val=.true.)
1028 CALL section_add_keyword(section, keyword)
1029 CALL keyword_release(keyword)
1030
1031 CALL keyword_create(keyword, __location__, name="SHIFT_GAPW_RADIUS", &
1032 description="While computing the local part of the shift (GAPW), "// &
1033 "the integration is restricted to nuclei that are within this radius.", &
1034 usage="SHIFT_GAPW_RADIUS 20.0", &
1035 type_of_var=real_t, &
1036 default_r_val=cp_unit_to_cp2k(value=60.0_dp, unit_str="angstrom"), &
1037 unit_str="angstrom")
1038 CALL section_add_keyword(section, keyword)
1039 CALL keyword_release(keyword)
1040
1041 NULLIFY (subsection)
1042 CALL section_create(subsection, __location__, name="PRINT", &
1043 description="print results of nmr calculation", &
1044 repeats=.false.)
1045
1046 CALL cp_print_key_section_create(print_key, __location__, "RESPONSE_FUNCTION_CUBES", &
1047 description="Controls the printing of the response functions ", &
1048 print_level=high_print_level, add_last=add_last_numeric, filename="")
1049 CALL keyword_create(keyword, __location__, name="stride", &
1050 description="The stride (X,Y,Z) used to write the cube file "// &
1051 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1052 " 1 number valid for all components.", &
1053 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1054 CALL section_add_keyword(print_key, keyword)
1055 CALL keyword_release(keyword)
1056
1057 CALL keyword_create(keyword, __location__, name="CUBES_LU_BOUNDS", &
1058 variants=["CUBES_LU"], &
1059 description="The lower and upper index of the states to be printed as cube", &
1060 usage="CUBES_LU_BOUNDS integer integer", &
1061 n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
1062 CALL section_add_keyword(print_key, keyword)
1063 CALL keyword_release(keyword)
1064
1065 CALL keyword_create(keyword, __location__, name="CUBES_LIST", &
1066 description="Indexes of the states to be printed as cube files "// &
1067 "This keyword can be repeated several times "// &
1068 "(useful if you have to specify many indexes).", &
1069 usage="CUBES_LIST 1 2", &
1070 n_var=-1, type_of_var=integer_t, repeats=.true.)
1071 CALL section_add_keyword(print_key, keyword)
1072 CALL keyword_release(keyword)
1073 CALL keyword_create(keyword, __location__, name="APPEND", &
1074 description="append the cube files when they already exist", &
1075 default_l_val=.false., lone_keyword_l_val=.true.)
1076 CALL section_add_keyword(print_key, keyword)
1077 CALL keyword_release(keyword)
1078
1079 CALL section_add_subsection(subsection, print_key)
1080 CALL section_release(print_key)
1081
1082 CALL cp_print_key_section_create(print_key, __location__, "CHI_TENSOR", &
1083 description="Controls the printing of susceptibility", &
1084 print_level=high_print_level, add_last=add_last_numeric, filename="")
1085 CALL section_add_subsection(subsection, print_key)
1086 CALL section_release(print_key)
1087
1088 CALL cp_print_key_section_create(print_key, __location__, "SHIELDING_TENSOR", &
1089 description="Controls the printing of the chemical shift", &
1090 print_level=low_print_level, add_last=add_last_numeric, filename="")
1091
1092 CALL keyword_create(keyword, __location__, name="ATOMS_LU_BOUNDS", &
1093 variants=["ATOMS_LU"], &
1094 description="The lower and upper atomic index for which the tensor is printed", &
1095 usage="ATOMS_LU_BOUNDS integer integer", &
1096 n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
1097 CALL section_add_keyword(print_key, keyword)
1098 CALL keyword_release(keyword)
1099
1100 CALL keyword_create(keyword, __location__, name="ATOMS_LIST", &
1101 description="list of atoms for which the shift is printed into a file ", &
1102 usage="ATOMS_LIST 1 2", n_var=-1, &
1103 type_of_var=integer_t, repeats=.true.)
1104 CALL section_add_keyword(print_key, keyword)
1105 CALL keyword_release(keyword)
1106
1107 CALL section_add_subsection(subsection, print_key)
1108 CALL section_release(print_key)
1109
1110 CALL section_add_subsection(section, subsection)
1111 CALL section_release(subsection)
1112
1113 NULLIFY (subsection)
1114 CALL create_interp_section(subsection)
1115 CALL section_add_subsection(section, subsection)
1116 CALL section_release(subsection)
1117
1118 END SUBROUTINE create_nmr_section
1119
1120! **************************************************************************************************
1121!> \brief creates the input structure used to activate
1122!> calculation of NMR spin-spin coupling (implementation not operating)
1123!> Available properties : none
1124!> \param section the section to create
1125!> \author VW
1126! **************************************************************************************************
1127 SUBROUTINE create_spin_spin_section(section)
1128 TYPE(section_type), POINTER :: section
1129
1130 TYPE(keyword_type), POINTER :: keyword
1131 TYPE(section_type), POINTER :: print_key, subsection
1132
1133 NULLIFY (keyword, print_key, subsection)
1134
1135 cpassert(.NOT. ASSOCIATED(section))
1136 CALL section_create(section, __location__, name="spinspin", &
1137 description="Compute indirect spin-spin coupling constants.", &
1138 n_keywords=5, n_subsections=1, repeats=.false.)
1139
1140 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
1141 description="controls the activation of the nmr calculation", &
1142 usage="&SPINSPIN T", &
1143 default_l_val=.false., &
1144 lone_keyword_l_val=.true.)
1145 CALL section_add_keyword(section, keyword)
1146 CALL keyword_release(keyword)
1147
1148 CALL keyword_create(keyword, __location__, name="RESTART_SPINSPIN", &
1149 description="Restart the spin-spin calculation from a previous run (NOT WORKING YET)", &
1150 usage="RESTART_SPINSPIN", default_l_val=.false., &
1151 lone_keyword_l_val=.true.)
1152 CALL section_add_keyword(section, keyword)
1153 CALL keyword_release(keyword)
1154
1155 CALL keyword_create(keyword, __location__, name="ISSC_ON_ATOM_LIST", &
1156 description="Atoms for which the issc is computed.", &
1157 usage="ISSC_ON_ATOM_LIST 1 2 10", &
1158 n_var=-1, type_of_var=integer_t, repeats=.true.)
1159 CALL section_add_keyword(section, keyword)
1160 CALL keyword_release(keyword)
1161
1162 CALL keyword_create(keyword, __location__, name="DO_FC", &
1163 description="Compute the Fermi contact contribution", &
1164 usage="DO_FC F", &
1165 default_l_val=.true., lone_keyword_l_val=.true.)
1166 CALL section_add_keyword(section, keyword)
1167 CALL keyword_release(keyword)
1168
1169 CALL keyword_create(keyword, __location__, name="DO_SD", &
1170 description="Compute the spin-dipolar contribution", &
1171 usage="DO_SD F", &
1172 default_l_val=.true., lone_keyword_l_val=.true.)
1173 CALL section_add_keyword(section, keyword)
1174 CALL keyword_release(keyword)
1175
1176 CALL keyword_create(keyword, __location__, name="DO_PSO", &
1177 description="Compute the paramagnetic spin-orbit contribution", &
1178 usage="DO_PSO F", &
1179 default_l_val=.true., lone_keyword_l_val=.true.)
1180 CALL section_add_keyword(section, keyword)
1181 CALL keyword_release(keyword)
1182
1183 CALL keyword_create(keyword, __location__, name="DO_DSO", &
1184 description="Compute the diamagnetic spin-orbit contribution (NOT YET IMPLEMENTED)", &
1185 usage="DO_DSO F", &
1186 default_l_val=.true., lone_keyword_l_val=.true.)
1187 CALL section_add_keyword(section, keyword)
1188 CALL keyword_release(keyword)
1189
1190 NULLIFY (subsection)
1191 CALL section_create(subsection, __location__, name="PRINT", &
1192 description="print results of the indirect spin-spin calculation", &
1193 repeats=.false.)
1194
1195 CALL cp_print_key_section_create(print_key, __location__, "K_MATRIX", &
1196 description="Controls the printing of the indirect spin-spin matrix", &
1197 print_level=low_print_level, add_last=add_last_numeric, filename="")
1198
1199 CALL keyword_create(keyword, __location__, name="ATOMS_LIST", &
1200 description="list of atoms for which the indirect spin-spin is printed into a file ", &
1201 usage="ATOMS_LIST 1 2", n_var=-1, &
1202 type_of_var=integer_t, repeats=.true.)
1203 CALL section_add_keyword(print_key, keyword)
1204 CALL keyword_release(keyword)
1205
1206 CALL section_add_subsection(subsection, print_key)
1207 CALL section_release(print_key)
1208
1209 CALL section_add_subsection(section, subsection)
1210 CALL section_release(subsection)
1211
1212 NULLIFY (subsection)
1213 CALL create_interp_section(subsection)
1214 CALL section_add_subsection(section, subsection)
1215 CALL section_release(subsection)
1216
1217 END SUBROUTINE create_spin_spin_section
1218
1219! **************************************************************************************************
1220!> \brief creates the input structure used to activate
1221!> calculation of EPR using
1222!> the induced current obtained from DFPT
1223!> Available properties : none
1224!> \param section the section to create
1225!> \author VW
1226! **************************************************************************************************
1227 SUBROUTINE create_epr_section(section)
1228 TYPE(section_type), POINTER :: section
1229
1230 TYPE(keyword_type), POINTER :: keyword
1231 TYPE(section_type), POINTER :: print_key, subsection, subsubsection
1232
1233 NULLIFY (keyword, print_key, subsection, subsubsection)
1234
1235 cpassert(.NOT. ASSOCIATED(section))
1236 CALL section_create(section, __location__, name="EPR", &
1237 description="The g tensor is calculated by DFPT ", &
1238 n_keywords=5, n_subsections=1, repeats=.false., &
1239 citations=[weber2009])
1240
1241 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
1242 description="controls the activation of the epr calculation", &
1243 usage="&EPR T", &
1244 default_l_val=.false., &
1245 lone_keyword_l_val=.true.)
1246 CALL section_add_keyword(section, keyword)
1247 CALL keyword_release(keyword)
1248
1249 CALL keyword_create(keyword, __location__, name="RESTART_EPR", &
1250 description="Restart the EPR calculation from a previous run (NOT WORKING)", &
1251 usage="RESTART_EPR", default_l_val=.false., &
1252 lone_keyword_l_val=.true.)
1253 CALL section_add_keyword(section, keyword)
1254 CALL keyword_release(keyword)
1255
1256 NULLIFY (subsection)
1257 CALL section_create(subsection, __location__, name="PRINT", &
1258 description="print results of epr calculation", &
1259 repeats=.false.)
1260
1261 CALL cp_print_key_section_create(print_key, __location__, "NABLAVKS_CUBES", &
1262 description="Controls the printing of the components of nabla v_ks ", &
1263 print_level=high_print_level, add_last=add_last_numeric, filename="")
1264 CALL keyword_create(keyword, __location__, name="stride", &
1265 description="The stride (X,Y,Z) used to write the cube file "// &
1266 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1267 " 1 number valid for all components.", &
1268 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1269 CALL section_add_keyword(print_key, keyword)
1270 CALL keyword_release(keyword)
1271 CALL keyword_create(keyword, __location__, name="APPEND", &
1272 description="append the cube files when they already exist", &
1273 default_l_val=.false., lone_keyword_l_val=.true.)
1274 CALL section_add_keyword(print_key, keyword)
1275 CALL keyword_release(keyword)
1276
1277 CALL section_add_subsection(subsection, print_key)
1278 CALL section_release(print_key)
1279
1280 CALL cp_print_key_section_create(print_key, __location__, "G_TENSOR", &
1281 description="Controls the printing of the g tensor", &
1282 print_level=high_print_level, add_last=add_last_numeric, filename="")
1283 CALL create_xc_section(subsubsection)
1284 CALL section_add_subsection(print_key, subsubsection)
1285 CALL section_release(subsubsection)
1286
1287 CALL keyword_create(keyword, __location__, name="GAPW_MAX_ALPHA", &
1288 description="Maximum alpha of GTH potentials allowed on the soft grids ", &
1289 usage="GAPW_MAX_ALPHA real", default_r_val=5.0_dp)
1290 CALL section_add_keyword(print_key, keyword)
1291 CALL keyword_release(keyword)
1292
1293 CALL keyword_create(keyword, __location__, name="SOO_RHO_HARD", &
1294 description="Whether or not to include the atomic parts of the density "// &
1295 "in the SOO part of the g tensor", usage="SOO_RHO_HARD", &
1296 default_l_val=.false., lone_keyword_l_val=.true.)
1297 CALL section_add_keyword(print_key, keyword)
1298 CALL keyword_release(keyword)
1299
1300 CALL section_add_subsection(subsection, print_key)
1301 CALL section_release(print_key)
1302
1303 CALL cp_print_key_section_create(print_key, __location__, "RESPONSE_FUNCTION_CUBES", &
1304 description="Controls the printing of the response functions ", &
1305 print_level=high_print_level, add_last=add_last_numeric, filename="")
1306 CALL keyword_create(keyword, __location__, name="stride", &
1307 description="The stride (X,Y,Z) used to write the cube file "// &
1308 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1309 " 1 number valid for all components.", &
1310 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1311 CALL section_add_keyword(print_key, keyword)
1312 CALL keyword_release(keyword)
1313
1314 CALL keyword_create(keyword, __location__, name="CUBES_LU_BOUNDS", &
1315 variants=["CUBES_LU"], &
1316 description="The lower and upper index of the states to be printed as cube", &
1317 usage="CUBES_LU_BOUNDS integer integer", &
1318 n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
1319 CALL section_add_keyword(print_key, keyword)
1320 CALL keyword_release(keyword)
1321
1322 CALL keyword_create(keyword, __location__, name="CUBES_LIST", &
1323 description="Indexes of the states to be printed as cube files "// &
1324 "This keyword can be repeated several times "// &
1325 "(useful if you have to specify many indexes).", &
1326 usage="CUBES_LIST 1 2", &
1327 n_var=-1, type_of_var=integer_t, repeats=.true.)
1328 CALL section_add_keyword(print_key, keyword)
1329 CALL keyword_release(keyword)
1330 CALL keyword_create(keyword, __location__, name="APPEND", &
1331 description="append the cube files when they already exist", &
1332 default_l_val=.false., lone_keyword_l_val=.true.)
1333 CALL section_add_keyword(print_key, keyword)
1334 CALL keyword_release(keyword)
1335
1336 CALL section_add_subsection(subsection, print_key)
1337 CALL section_release(print_key)
1338
1339 CALL section_add_subsection(section, subsection)
1340 CALL section_release(subsection)
1341
1342 NULLIFY (subsection)
1343 CALL create_interp_section(subsection)
1344 CALL section_add_subsection(section, subsection)
1345 CALL section_release(subsection)
1346
1347 END SUBROUTINE create_epr_section
1348
1349! **************************************************************************************************
1350!> \brief creates the input structure used to activate
1351!> calculation of polarizability tensor DFPT
1352!> Available properties : none
1353!> \param section the section to create
1354!> \author SL
1355! **************************************************************************************************
1356 SUBROUTINE create_polarizability_section(section)
1357
1358 TYPE(section_type), POINTER :: section
1359
1360 TYPE(keyword_type), POINTER :: keyword
1361 TYPE(section_type), POINTER :: print_key, subsection
1362
1363 NULLIFY (keyword, print_key, subsection)
1364
1365 cpassert(.NOT. ASSOCIATED(section))
1366 CALL section_create(section, __location__, name="POLAR", &
1367 description="Compute polarizabilities.", &
1368 n_keywords=5, n_subsections=1, repeats=.false., &
1369 citations=[putrino2002])
1370
1371 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
1372 description="controls the activation of the polarizability calculation", &
1373 usage="&POLAR T", &
1374 default_l_val=.false., &
1375 lone_keyword_l_val=.true.)
1376 CALL section_add_keyword(section, keyword)
1377 CALL keyword_release(keyword)
1378
1379 CALL keyword_create(keyword, __location__, name="DO_RAMAN", &
1380 description="Compute the electric-dipole--electric-dipole polarizability", &
1381 usage="DO_RAMAN F", &
1382 citations=[luber2014], &
1383 default_l_val=.true., lone_keyword_l_val=.true.)
1384 CALL section_add_keyword(section, keyword)
1385 CALL keyword_release(keyword)
1386
1387 CALL keyword_create(keyword, __location__, name="PERIODIC_DIPOLE_OPERATOR", &
1388 description="Type of dipole operator: Berry phase(T) or Local(F)", &
1389 usage="PERIODIC_DIPOLE_OPERATOR T", &
1390 default_l_val=.true., lone_keyword_l_val=.true.)
1391 CALL section_add_keyword(section, keyword)
1392 CALL keyword_release(keyword)
1393
1394 NULLIFY (subsection)
1395 CALL section_create(subsection, __location__, name="PRINT", &
1396 description="print results of the polarizability calculation", &
1397 repeats=.false.)
1398
1399 CALL cp_print_key_section_create(print_key, __location__, "POLAR_MATRIX", &
1400 description="Controls the printing of the polarizabilities", &
1401 print_level=low_print_level, add_last=add_last_numeric, filename="")
1402
1403 CALL section_add_subsection(subsection, print_key)
1404 CALL section_release(print_key)
1405 CALL section_add_subsection(section, subsection)
1406 CALL section_release(subsection)
1407
1408 NULLIFY (subsection)
1409 CALL create_interp_section(subsection)
1410 CALL section_add_subsection(section, subsection)
1411 CALL section_release(subsection)
1412
1413 END SUBROUTINE create_polarizability_section
1414
1415! **************************************************************************************************
1416!> \brief creates the section for electron transfer coupling
1417!> \param section ...
1418!> \author fschiff
1419! **************************************************************************************************
1420 SUBROUTINE create_et_coupling_section(section)
1421 TYPE(section_type), POINTER :: section
1422
1423 TYPE(keyword_type), POINTER :: keyword
1424 TYPE(section_type), POINTER :: print_key, subsection
1425
1426 NULLIFY (keyword)
1427 cpassert(.NOT. ASSOCIATED(section))
1428 CALL section_create(section, __location__, name="ET_COUPLING", &
1429 description="specifies the two constraints/restraints for extracting ET coupling elements", &
1430 n_keywords=1, n_subsections=4, repeats=.false., citations=[kondov2007, futera2017])
1431
1432 NULLIFY (subsection)
1433 CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_A")
1434 CALL section_add_subsection(section, subsection)
1435 CALL section_release(subsection)
1436
1437 NULLIFY (subsection)
1438 CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_B")
1439 CALL section_add_subsection(section, subsection)
1440 CALL section_release(subsection)
1441
1442 NULLIFY (subsection)
1443 CALL create_projection(subsection, "PROJECTION")
1444 CALL section_add_subsection(section, subsection)
1445 CALL section_release(subsection)
1446
1447 CALL keyword_create(keyword, __location__, name="TYPE_OF_CONSTRAINT", &
1448 description="Specifies the type of constraint", &
1449 usage="TYPE_OF_CONSTRAINT DDAPC", &
1450 enum_c_vals=s2a("NONE", "DDAPC"), &
1451 enum_i_vals=[do_no_et, do_et_ddapc], &
1452 enum_desc=s2a("NONE", "DDAPC Constraint"), &
1453 default_i_val=do_no_et)
1454 CALL section_add_keyword(section, keyword)
1455 CALL keyword_release(keyword)
1456
1457 NULLIFY (print_key)
1458 CALL cp_print_key_section_create(print_key, __location__, "PROGRAM_RUN_INFO", &
1459 description="Controls the printing basic info about the method", &
1460 print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
1461 CALL section_add_subsection(section, print_key)
1462 CALL section_release(print_key)
1463
1464 END SUBROUTINE create_et_coupling_section
1465
1466! **************************************************************************************************
1467!> \brief defines input sections for specification of Hilbert space partitioning
1468!> in projection-operator approach of electronic coupling calulation
1469!> \param section pointer to the section data structure
1470!> \param section_name name of the projection section
1471!> \author Z. Futera (02.2017)
1472! **************************************************************************************************
1473 SUBROUTINE create_projection(section, section_name)
1474
1475 ! Routine arguments
1476 TYPE(section_type), POINTER :: section
1477 CHARACTER(len=*), INTENT(in) :: section_name
1478
1479 TYPE(keyword_type), POINTER :: keyword
1480 TYPE(section_type), POINTER :: print_key, section_block, section_print
1481
1482! Routine name for dubug purposes
1483
1484 ! Sanity check
1485 cpassert(.NOT. ASSOCIATED(section))
1486
1487 ! Initialization
1488 NULLIFY (keyword)
1489 NULLIFY (print_key)
1490 NULLIFY (section_block)
1491 NULLIFY (section_print)
1492
1493 ! Input-file section definition
1494 CALL section_create(section, __location__, name=trim(adjustl(section_name)), &
1495 description="Projection-operator approach fo ET coupling calculation", &
1496 n_keywords=0, n_subsections=2, repeats=.false.)
1497
1498 ! Subsection #0: Log printing
1499 CALL cp_print_key_section_create(print_key, __location__, 'PROGRAM_RUN_INFO', &
1500 description="Controls printing of data and informations to log file", &
1501 print_level=low_print_level, filename="__STD_OUT__")
1502 CALL section_add_subsection(section, print_key)
1503 CALL section_release(print_key)
1504
1505 ! Subsection #1: Atomic blocks
1506 CALL section_create(section_block, __location__, name='BLOCK', &
1507 description="Part of the system (donor, acceptor, bridge,...)", &
1508 n_keywords=2, n_subsections=1, repeats=.true.)
1509 CALL section_add_subsection(section, section_block)
1510
1511 ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
1512 CALL keyword_create(keyword, __location__, name='ATOMS', &
1513 description="Array of atom IDs in the system part", &
1514 usage="ATOMS {integer} {integer} .. {integer}", &
1515 n_var=-1, type_of_var=integer_t, repeats=.false.)
1516 CALL section_add_keyword(section_block, keyword)
1517 CALL keyword_release(keyword)
1518
1519 ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
1520 CALL keyword_create(keyword, __location__, name='NELECTRON', &
1521 description="Number of electrons expected in the system part", &
1522 usage="NELECTRON {integer}", default_i_val=0)
1523 CALL section_add_keyword(section_block, keyword)
1524 CALL keyword_release(keyword)
1525
1526 ! S#1 - Subsection #1: Printing setting
1527 CALL section_create(section_print, __location__, name='PRINT', &
1528 description="Possible printing options in ET system part", &
1529 n_keywords=0, n_subsections=0, repeats=.false.)
1530 CALL section_add_subsection(section_block, section_print)
1531
1532 ! S#1 - S#1 - Keyword #1: MO coefficient on specific atom
1533 CALL keyword_create(keyword, __location__, name='MO_COEFF_ATOM', &
1534 description="Print out MO coeffiecients on given atom", &
1535 usage="MO_COEFF_ATOM {integer} {integer} .. {integer}", &
1536 type_of_var=integer_t, n_var=-1, repeats=.true.)
1537 CALL section_add_keyword(section_print, keyword)
1538 CALL keyword_release(keyword)
1539
1540 ! S#1 - S#1 - Keyword #1: MO coefficient of specific state
1541 CALL keyword_create(keyword, __location__, name='MO_COEFF_ATOM_STATE', &
1542 description="Print out MO coeffiecients of specific state", &
1543 usage="MO_COEFF_ATOM_STATE {integer} {integer} .. {integer}", &
1544 type_of_var=integer_t, n_var=-1, repeats=.true.)
1545 CALL section_add_keyword(section_print, keyword)
1546 CALL keyword_release(keyword)
1547
1548 ! S#1 - S#1 - Subsection #1: Saving MOs to CUBE files
1549 CALL cp_print_key_section_create(print_key, __location__, 'MO_CUBES', &
1550 description="Controls saving of MO cube files", &
1551 print_level=high_print_level, filename="")
1552
1553 ! S#1 - S#1 - S#1 - Keyword #1: Stride
1554 CALL keyword_create(keyword, __location__, name='STRIDE', &
1555 description="The stride (X,Y,Z) used to write the cube file", &
1556 usage="STRIDE {integer} {integer} {integer}", n_var=-1, &
1557 default_i_vals=[2, 2, 2], type_of_var=integer_t)
1558 CALL section_add_keyword(print_key, keyword)
1559 CALL keyword_release(keyword)
1560
1561 ! S#1 - S#1 - S#1 - Keyword #2: List of MO IDs
1562 CALL keyword_create(keyword, __location__, name='MO_LIST', &
1563 description="Indices of molecular orbitals to save", &
1564 usage="MO_LIST {integer} {integer} .. {integer}", &
1565 type_of_var=integer_t, n_var=-1, repeats=.true.)
1566 CALL section_add_keyword(print_key, keyword)
1567 CALL keyword_release(keyword)
1568
1569 ! S#1 - S#1 - S#1 - Keyword #2: Number of unoccupied states
1570 CALL keyword_create(keyword, __location__, name='NLUMO', &
1571 description="Number of unoccupied molecular orbitals to save", &
1572 usage="NLUMO {integer}", default_i_val=1)
1573 CALL section_add_keyword(print_key, keyword)
1574 CALL keyword_release(keyword)
1575
1576 ! S#1 - S#1 - S#1 - Keyword #3: Number of occupied states
1577 CALL keyword_create(keyword, __location__, name='NHOMO', &
1578 description="Number of occupied molecular orbitals to save", &
1579 usage="NHOMO {integer}", default_i_val=1)
1580 CALL section_add_keyword(print_key, keyword)
1581 CALL keyword_release(keyword)
1582
1583 CALL section_add_subsection(section_print, print_key)
1584 CALL section_release(print_key)
1585
1586 ! S#1 - S#1 - Clean
1587 CALL section_release(section_print)
1588
1589 ! S#1 - Clean
1590 CALL section_release(section_block)
1591
1592 ! S#1 - Subsection #1: Printing setting
1593 CALL section_create(section_print, __location__, name='PRINT', &
1594 description="Possible printing options in ET", &
1595 n_keywords=0, n_subsections=0, repeats=.false.)
1596 CALL section_add_subsection(section, section_print)
1597
1598 ! Print couplings
1599 CALL cp_print_key_section_create(print_key, __location__, 'COUPLINGS', &
1600 description="Controls printing couplings onto file", &
1601 print_level=low_print_level, filename="")
1602
1603 CALL keyword_create(keyword, __location__, name="APPEND", &
1604 description="append the files when they already exist", &
1605 default_l_val=.false., lone_keyword_l_val=.true.)
1606 CALL section_add_keyword(print_key, keyword)
1607 CALL keyword_release(keyword)
1608
1609 CALL section_add_subsection(section_print, print_key)
1610 CALL section_release(print_key)
1611
1612 CALL section_release(section_print)
1613
1614 END SUBROUTINE create_projection
1615
1616! **************************************************************************************************
1617!> \brief creates an input section for tddfpt calculation
1618!> \param section section to create
1619!> \par History
1620!> * 05.2016 forked from create_tddfpt_section [Sergey Chulkov]
1621!> * 08.2016 moved from module input_cp2k_dft [Sergey Chulkov]
1622! **************************************************************************************************
1623 SUBROUTINE create_tddfpt2_section(section)
1624 TYPE(section_type), POINTER :: section
1625
1626 TYPE(keyword_type), POINTER :: keyword
1627 TYPE(section_type), POINTER :: print_key, subsection
1628
1629 cpassert(.NOT. ASSOCIATED(section))
1630 CALL section_create(section, __location__, name="TDDFPT", &
1631 description="Controls time-dependent density functional perturbation theory "// &
1632 "(TDDFPT) calculations for electronic excitations and related properties.", &
1633 n_keywords=14, n_subsections=4, repeats=.false., &
1635
1636 NULLIFY (keyword, print_key, subsection)
1637
1638 CALL keyword_create(keyword, __location__, &
1639 name="_SECTION_PARAMETERS_", &
1640 description="Activates the TDDFPT procedure.", &
1641 default_l_val=.false., &
1642 lone_keyword_l_val=.true.)
1643 CALL section_add_keyword(section, keyword)
1644 CALL keyword_release(keyword)
1645
1646 ! Integer
1647 CALL keyword_create(keyword, __location__, name="NSTATES", &
1648 description="Number of excited states to converge.", &
1649 n_var=1, type_of_var=integer_t, &
1650 default_i_val=1)
1651 CALL section_add_keyword(section, keyword)
1652 CALL keyword_release(keyword)
1653
1654 CALL keyword_create(keyword, __location__, name="MAX_ITER", &
1655 description="Maximal number of iterations to be performed.", &
1656 n_var=1, type_of_var=integer_t, &
1657 default_i_val=50)
1658 CALL section_add_keyword(section, keyword)
1659 CALL keyword_release(keyword)
1660
1661 CALL keyword_create(keyword, __location__, name="MAX_KV", &
1662 description="Maximal number of Krylov space vectors. "// &
1663 "Davidson iterations will be restarted upon reaching this limit.", &
1664 n_var=1, type_of_var=integer_t, &
1665 default_i_val=5000)
1666 CALL section_add_keyword(section, keyword)
1667 CALL keyword_release(keyword)
1668
1669 CALL keyword_create(keyword, __location__, name="NLUMO", &
1670 description="Number of unoccupied orbitals to consider. "// &
1671 "Default is to use all unoccupied orbitals (-1).", &
1672 n_var=1, type_of_var=integer_t, &
1673 default_i_val=-1)
1674 CALL section_add_keyword(section, keyword)
1675 CALL keyword_release(keyword)
1676
1677 CALL keyword_create(keyword, __location__, name="NPROC_STATE", &
1678 description="Number of MPI processes to be used per excited state. "// &
1679 "Default is to use all MPI processes (0).", &
1680 n_var=1, type_of_var=integer_t, &
1681 default_i_val=0)
1682 CALL section_add_keyword(section, keyword)
1683 CALL keyword_release(keyword)
1684
1685 ! kernel type
1686 CALL keyword_create(keyword, __location__, name="KERNEL", &
1687 description="Options to compute the kernel", &
1688 usage="KERNEL FULL", &
1689 enum_c_vals=s2a("FULL", "sTDA", "NONE"), &
1691 default_i_val=tddfpt_kernel_full)
1692 CALL section_add_keyword(section, keyword)
1693 CALL keyword_release(keyword)
1694
1695 ! spin-flip TDDFPT options
1696 CALL keyword_create(keyword, __location__, name="SPINFLIP", &
1697 description="Selects the type of spin-flip TDDFPT kernel", &
1698 usage="SPINFLIP NONCOLLINEAR", &
1699 enum_c_vals=s2a("NONE", "COLLINEAR", "NONCOLLINEAR"), &
1701 enum_desc=s2a("Only molecular orbital energy differences are considered", &
1702 "MO energy diferences and Fock exchange contributions are "// &
1703 "considered", &
1704 "MO energy differences, Fock exchange and "// &
1705 "Noncollinear local exchange-correlation "// &
1706 "kernel are considered"), &
1707 default_i_val=no_sf_tddfpt, citations=[hernandez2025])
1708 CALL section_add_keyword(section, keyword)
1709 CALL keyword_release(keyword)
1710
1711 CALL keyword_create(keyword, __location__, name="OE_CORR", &
1712 description="Orbital energy correction potential.", &
1713 enum_c_vals=s2a("NONE", "LB94", "GLLB", "SAOP", "SHIFT"), &
1714 enum_i_vals=[oe_none, oe_lb, oe_gllb, oe_saop, oe_shift], &
1715 enum_desc=s2a("No orbital correction scheme is used", &
1716 "van Leeuwen and Baerends. PRA, 49:2421, 1994", &
1717 "Gritsenko, van Leeuwen, van Lenthe, Baerends. PRA, 51:1944, 1995", &
1718 "Gritsenko, Schipper, Baerends. Chem. Phys. Lett., 302:199, 1999", &
1719 "Constant shift of virtual and/or open-shell orbitals"), &
1720 default_i_val=oe_none)
1721 CALL section_add_keyword(section, keyword)
1722 CALL keyword_release(keyword)
1723
1724 ! SHIFTS
1725 CALL keyword_create(keyword, __location__, name="EV_SHIFT", &
1726 variants=s2a("VIRTUAL_SHIFT"), &
1727 description="Constant shift of virtual state eigenvalues.", &
1728 usage="EV_SHIFT 0.500", &
1729 n_var=1, type_of_var=real_t, &
1730 unit_str="eV", &
1731 default_r_val=0.0_dp)
1732 CALL section_add_keyword(section, keyword)
1733 CALL keyword_release(keyword)
1734 !
1735 CALL keyword_create(keyword, __location__, name="EOS_SHIFT", &
1736 variants=s2a("OPEN_SHELL_SHIFT"), &
1737 description="Constant shift of open shell eigenvalues.", &
1738 usage="EOS_SHIFT 0.200", &
1739 n_var=1, type_of_var=real_t, &
1740 unit_str="eV", &
1741 default_r_val=0.0_dp)
1742 CALL section_add_keyword(section, keyword)
1743 CALL keyword_release(keyword)
1744
1745 ! Real
1746 CALL keyword_create(keyword, __location__, name="CONVERGENCE", &
1747 description="Target accuracy for excited state energies.", &
1748 n_var=1, type_of_var=real_t, unit_str="hartree", &
1749 default_r_val=1.0e-5_dp)
1750 CALL section_add_keyword(section, keyword)
1751 CALL keyword_release(keyword)
1752
1753 CALL keyword_create(keyword, __location__, name="MIN_AMPLITUDE", &
1754 description="The smallest excitation amplitude to print.", &
1755 n_var=1, type_of_var=real_t, &
1756 default_r_val=5.0e-2_dp)
1757 CALL section_add_keyword(section, keyword)
1758 CALL keyword_release(keyword)
1759
1760 CALL keyword_create(keyword, __location__, name="ORTHOGONAL_EPS", &
1761 description="The largest possible overlap between the ground state and "// &
1762 "orthogonalised excited state wave-functions. Davidson iterations "// &
1763 "will be restarted when the overlap goes beyond this threshold in "// &
1764 "order to prevent numerical instability.", &
1765 n_var=1, type_of_var=real_t, &
1766 default_r_val=1.0e-4_dp)
1767 CALL section_add_keyword(section, keyword)
1768 CALL keyword_release(keyword)
1769
1770 ! Logical
1771 CALL keyword_create(keyword, __location__, name="RESTART", &
1772 description="Restart the TDDFPT calculation if a restart file exists", &
1773 n_var=1, type_of_var=logical_t, &
1774 default_l_val=.false., lone_keyword_l_val=.true.)
1775 CALL section_add_keyword(section, keyword)
1776 CALL keyword_release(keyword)
1777
1778 CALL keyword_create(keyword, __location__, name="RKS_TRIPLETS", &
1779 description="Compute triplet excited states using spin-unpolarised molecular orbitals.", &
1780 n_var=1, type_of_var=logical_t, &
1781 default_l_val=.false.)
1782 CALL section_add_keyword(section, keyword)
1783 CALL keyword_release(keyword)
1784
1785 CALL keyword_create(keyword, __location__, name="ADMM_KERNEL_XC_CORRECTION", &
1786 description="Use/Ignore ADMM correction xc functional for TD kernel. "// &
1787 "XC correction functional is defined in ground state XC section.", &
1788 n_var=1, type_of_var=logical_t, &
1789 default_l_val=.true., lone_keyword_l_val=.true.)
1790 CALL section_add_keyword(section, keyword)
1791 CALL keyword_release(keyword)
1792
1793 CALL keyword_create(keyword, __location__, name="ADMM_KERNEL_CORRECTION_SYMMETRIC", &
1794 description="ADMM correction functional in kernel is applied symmetrically. "// &
1795 "Original implementation is using a non-symmetric formula.", &
1796 n_var=1, type_of_var=logical_t, &
1797 default_l_val=.true., lone_keyword_l_val=.true.)
1798 CALL section_add_keyword(section, keyword)
1799 CALL keyword_release(keyword)
1800
1801 CALL keyword_create(keyword, __location__, name="DO_LRIGPW", &
1802 description="Local resolution of identity for Coulomb contribution.", &
1803 n_var=1, type_of_var=logical_t, &
1804 default_l_val=.false.)
1805 CALL section_add_keyword(section, keyword)
1806 CALL keyword_release(keyword)
1807
1808 CALL keyword_create(keyword, __location__, name="AUTO_BASIS", &
1809 description="Specify type and size of automatically generated auxiliary "// &
1810 "(RI) basis sets. Exactly two arguments are required for this option. "// &
1811 "The first argument of basis type should be one of the following: "// &
1812 "`P_LRI_AUX`. The second argument of basis size should be one of the "// &
1813 "following: `SMALL`, `MEDIUM`, `LARGE`, or `HUGE`. The default is not "// &
1814 "using any of these basis sets, requested by `AUTO_BASIS X X` (exactly "// &
1815 "as written here).", &
1816 usage="AUTO_BASIS {basis_type} {basis_size}", &
1817 type_of_var=char_t, repeats=.true., n_var=-1, default_c_vals=["X", "X"])
1818 CALL section_add_keyword(section, keyword)
1819 CALL keyword_release(keyword)
1820
1821 CALL keyword_create(keyword, __location__, name="DO_SMEARING", &
1822 description="Implying smeared occupation. ", &
1823 n_var=1, type_of_var=logical_t, &
1824 default_l_val=.false., lone_keyword_l_val=.true.)
1825 CALL section_add_keyword(section, keyword)
1826 CALL keyword_release(keyword)
1827
1828 CALL keyword_create(keyword, __location__, name="EXCITON_DESCRIPTORS", &
1829 description="Compute exciton descriptors. "// &
1830 "Details given in Manual section about Bethe Salpeter equation.", &
1831 n_var=1, type_of_var=logical_t, &
1832 default_l_val=.false.)
1833 CALL section_add_keyword(section, keyword)
1834 CALL keyword_release(keyword)
1835
1836 CALL keyword_create(keyword, __location__, name="DIRECTIONAL_EXCITON_DESCRIPTORS", &
1837 description="Print cartesian components of exciton descriptors.", &
1838 n_var=1, type_of_var=logical_t, &
1839 default_l_val=.false.)
1840 CALL section_add_keyword(section, keyword)
1841 CALL keyword_release(keyword)
1842
1843 CALL keyword_create(keyword, __location__, name="DIRECTIONAL_EXCITON_CROSSCORRELATION", &
1844 description="Print the electron-hole crosscorrelation matrix as part of the "// &
1845 "cartesian components of exciton descriptors. Only active together with "// &
1846 "DIRECTIONAL_EXCITON_DESCRIPTORS.", &
1847 n_var=1, type_of_var=logical_t, &
1848 default_l_val=.true.)
1849 CALL section_add_keyword(section, keyword)
1850 CALL keyword_release(keyword)
1851
1852 ! Strings
1853 CALL keyword_create(keyword, __location__, name="WFN_RESTART_FILE_NAME", &
1854 variants=["RESTART_FILE_NAME"], &
1855 description="Name of the wave function restart file, may include a path."// &
1856 " If no file is specified, the default is to open the file as generated by"// &
1857 " the wave function restart print key.", &
1858 usage="WFN_RESTART_FILE_NAME <FILENAME>", &
1859 type_of_var=lchar_t)
1860 CALL section_add_keyword(section, keyword)
1861 CALL keyword_release(keyword)
1862
1863 ! DIPOLE subsection
1864 CALL section_create(subsection, __location__, name="DIPOLE_MOMENTS", &
1865 description="Parameters to compute oscillator strengths in the dipole approximation.", &
1866 n_keywords=3, n_subsections=0, repeats=.false.)
1867
1868 CALL keyword_create(keyword, __location__, name="DIPOLE_FORM", &
1869 description="Form of dipole transition integrals.", &
1870 enum_c_vals=s2a("BERRY", "LENGTH", "VELOCITY", "VELOCITY_OLD", &
1871 "SCF_MOMENT"), &
1872 enum_desc=s2a("Based on Berry phase formula (valid for fully periodic molecular systems only)", &
1873 "Length form &lang; i | r | j &rang; (valid for non-periodic molecular systems only)", &
1874 "Velocity form &lang; i | d/dr | j &rang;", &
1875 "Old velocity form &lang; i | d/dr | j &rang;", &
1876 "SCF molecular-orbital moment form for k-point TDDFPT"), &
1880 default_i_val=tddfpt_dipole_velocity)
1881 CALL section_add_keyword(subsection, keyword)
1882 CALL keyword_release(keyword)
1883
1884 CALL keyword_create(keyword, __location__, name="REFERENCE", &
1885 description="Reference point to calculate electric "// &
1886 "dipole moments using the dipole integrals in the length form.", &
1887 enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1888 enum_desc=s2a("Use Center of Mass", &
1889 "Use Center of Atomic Charges", &
1890 "Use User-defined Point", &
1891 "Use Origin of Coordinate System"), &
1892 enum_i_vals=[use_mom_ref_com, &
1896 default_i_val=use_mom_ref_com)
1897 CALL section_add_keyword(subsection, keyword)
1898 CALL keyword_release(keyword)
1899
1900 CALL keyword_create(keyword, __location__, name="REFERENCE_POINT", &
1901 description="User-defined reference point.", &
1902 usage="REFERENCE_POINT x y z", &
1903 repeats=.false., n_var=3, type_of_var=real_t, unit_str='bohr')
1904 CALL section_add_keyword(subsection, keyword)
1905 CALL keyword_release(keyword)
1906
1907 CALL section_add_subsection(section, subsection)
1908 CALL section_release(subsection)
1909
1910 ! SOC functional
1911
1912 CALL section_create(subsection, __location__, name="SOC", &
1913 description="Is jet to be implemented", &
1914 n_keywords=2, n_subsections=0, repeats=.false.)
1915
1916 CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
1917 variants=s2a("EPS_FILTER_MATRIX"), &
1918 description="The threshold used for sparse matrix operations", &
1919 usage="EPS_FILTER {real}", &
1920 type_of_var=real_t, &
1921 default_r_val=1.0e-10_dp)
1922 CALL section_add_keyword(subsection, keyword)
1923 CALL keyword_release(keyword)
1924
1925 CALL keyword_create(keyword, __location__, name="GRID", &
1926 variants=["ATOMIC_GRID"], &
1927 description="Specification of the atomic angular and radial grids for "// &
1928 "a atomic kind. This keyword must be repeated for all kinds! "// &
1929 "Usage: GRID < LEBEDEV_GRID > < RADIAL_GRID >", &
1930 usage="GRID {string} {integer} {integer}", &
1931 n_var=3, type_of_var=char_t, repeats=.true.)
1932 CALL section_add_keyword(subsection, keyword)
1933 CALL keyword_release(keyword)
1934
1935 CALL section_add_subsection(section, subsection)
1936 CALL section_release(subsection)
1937
1938 ! kernel XC functional
1939 CALL create_xc_section(subsection)
1940 CALL section_add_subsection(section, subsection)
1941 CALL section_release(subsection)
1942
1943 ! MGRID subsection
1944 CALL create_mgrid_section(subsection, create_subsections=.false.)
1945 CALL section_add_subsection(section, subsection)
1946 CALL section_release(subsection)
1947
1948 ! sTDA subsection
1949 CALL create_stda_section(subsection)
1950 CALL section_add_subsection(section, subsection)
1951 CALL section_release(subsection)
1952
1953 ! RSE subsection
1954 CALL create_res_section(subsection)
1955 CALL section_add_subsection(section, subsection)
1956 CALL section_release(subsection)
1957
1958 CALL keyword_create(keyword, __location__, name="DO_BSE", &
1959 description="Choosing BSE kernel.", &
1960 usage="DO_BSE", default_l_val=.false., lone_keyword_l_val=.true.)
1961 CALL section_add_keyword(section, keyword)
1962 CALL keyword_release(keyword)
1963
1964 CALL keyword_create(keyword, __location__, name="DO_BSE_W_ONLY", &
1965 description="Debug option for BSE kernel.", &
1966 usage="DO_BSE_W_ONLY", default_l_val=.false., lone_keyword_l_val=.true.)
1967 CALL section_add_keyword(section, keyword)
1968 CALL keyword_release(keyword)
1969
1970 CALL keyword_create(keyword, __location__, name="DO_BSE_GW_ONLY", &
1971 description="Debug option for BSE kernel.", &
1972 usage="DO_BSE_GW_ONLY", default_l_val=.false., lone_keyword_l_val=.true.)
1973 CALL section_add_keyword(section, keyword)
1974 CALL keyword_release(keyword)
1975
1976 ! LRI subsection
1977 CALL create_lrigpw_section(subsection)
1978 CALL section_add_subsection(section, subsection)
1979 CALL section_release(subsection)
1980
1981 ! LINRES section
1982 CALL create_linres_section(subsection, create_subsections=.false., default_set_tdlr=.true.)
1983 CALL section_add_subsection(section, subsection)
1984 CALL section_release(subsection)
1985
1986 ! PRINT subsection
1987 CALL section_create(subsection, __location__, name="PRINT", &
1988 description="Printing of information during the TDDFT run.", repeats=.false.)
1989
1990 CALL cp_print_key_section_create(print_key, __location__, name="PROGRAM_BANNER", &
1991 description="Controls the printing of the banner for TDDFPT program", &
1992 print_level=silent_print_level, filename="__STD_OUT__")
1993 CALL section_add_subsection(subsection, print_key)
1994 CALL section_release(print_key)
1995
1996 CALL cp_print_key_section_create(print_key, __location__, name="GUESS_VECTORS", &
1997 description="Controls the printing of initial guess vectors.", &
1998 print_level=low_print_level, filename="__STD_OUT__")
1999 CALL section_add_subsection(subsection, print_key)
2000 CALL section_release(print_key)
2001
2002 CALL cp_print_key_section_create(print_key, __location__, name="ITERATION_INFO", &
2003 description="Controls the printing of basic iteration information "// &
2004 "during the TDDFT run.", &
2005 print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
2006 CALL section_add_subsection(subsection, print_key)
2007 CALL section_release(print_key)
2008
2009 CALL cp_print_key_section_create(print_key, __location__, name="DETAILED_ENERGY", &
2010 description="Controls the printing of detailed energy information "// &
2011 "during the TDDFT run.", &
2012 print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
2013 CALL section_add_subsection(subsection, print_key)
2014 CALL section_release(print_key)
2015
2016 CALL cp_print_key_section_create(print_key, __location__, name="BASIS_SET_FILE", &
2017 description="Controls the printing of a file with all basis sets used.", &
2018 print_level=debug_print_level, filename="BASIS_SETS")
2019 CALL section_add_subsection(subsection, print_key)
2020 CALL section_release(print_key)
2021
2022 CALL cp_print_key_section_create(print_key, __location__, name="RESTART", &
2023 description="Controls the dumping of the MO restart file during TDDFPT. "// &
2024 "By default keeps a short history of three restarts.", &
2025 print_level=low_print_level, common_iter_levels=3, &
2026 each_iter_names=s2a("TDDFT_SCF"), each_iter_values=[10], &
2027 add_last=add_last_numeric, filename="RESTART")
2028 CALL keyword_create(keyword, __location__, name="BACKUP_COPIES", &
2029 description="Specifies the maximum number of backup copies.", &
2030 usage="BACKUP_COPIES {int}", &
2031 default_i_val=1)
2032 CALL section_add_keyword(print_key, keyword)
2033 CALL keyword_release(keyword)
2034 CALL section_add_subsection(subsection, print_key)
2035 CALL section_release(print_key)
2036
2037 CALL cp_print_key_section_create(print_key, __location__, name="NTO_ANALYSIS", &
2038 description="Perform a natural transition orbital analysis.", &
2039 print_level=medium_print_level)
2040 CALL keyword_create(keyword, __location__, name="THRESHOLD", &
2041 description="Threshold for sum of NTO eigenvalues considered", &
2042 usage="Threshold 0.95", &
2043 n_var=1, &
2044 type_of_var=real_t, &
2045 default_r_val=0.975_dp)
2046 CALL section_add_keyword(print_key, keyword)
2047 CALL keyword_release(keyword)
2048 CALL keyword_create(keyword, __location__, name="INTENSITY_THRESHOLD", &
2049 description="Threshold for oscillator strength to screen states.", &
2050 usage="Intensity_threshold 0.01", &
2051 n_var=1, &
2052 type_of_var=real_t, &
2053 default_r_val=0.0_dp)
2054 CALL section_add_keyword(print_key, keyword)
2055 CALL keyword_release(keyword)
2056 CALL keyword_create(keyword, __location__, name="STATE_LIST", &
2057 description="Specifies a list of states for the NTO calculations.", &
2058 usage="STATE_LIST {integer} {integer} .. {integer}", &
2059 n_var=-1, type_of_var=integer_t)
2060 CALL section_add_keyword(print_key, keyword)
2061 CALL keyword_release(keyword)
2062 CALL keyword_create(keyword, __location__, name="CUBE_FILES", &
2063 description="Print NTOs on Cube Files", &
2064 usage="CUBE_FILES {logical}", repeats=.false., n_var=1, &
2065 default_l_val=.false., lone_keyword_l_val=.true., type_of_var=logical_t)
2066 CALL section_add_keyword(print_key, keyword)
2067 CALL keyword_release(keyword)
2068 CALL keyword_create(keyword, __location__, name="STRIDE", &
2069 description="The stride (X,Y,Z) used to write the cube file "// &
2070 "(larger values result in smaller cube files). Provide 3 numbers (for X,Y,Z) or"// &
2071 " 1 number valid for all components.", &
2072 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
2073 CALL section_add_keyword(print_key, keyword)
2074 CALL keyword_release(keyword)
2075 CALL keyword_create(keyword, __location__, name="APPEND", &
2076 description="append the cube files when they already exist", &
2077 default_l_val=.false., lone_keyword_l_val=.true.)
2078 CALL section_add_keyword(print_key, keyword)
2079 CALL keyword_release(keyword)
2080 CALL section_add_subsection(subsection, print_key)
2081 CALL section_release(print_key)
2082
2083 CALL cp_print_key_section_create(print_key, __location__, "MOS_MOLDEN", &
2084 description="Write the NTO in Molden file format, for visualisation.", &
2085 print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MOS")
2086 CALL keyword_create(keyword, __location__, name="UNIT", &
2087 description="Unit for coordinates and cell in the MOLDEN file.", &
2088 usage="UNIT ANGSTROM", &
2089 enum_c_vals=s2a("BOHR", "ANGSTROM"), &
2090 enum_desc=s2a("Write in Bohr (AU)", "Write in Angstrom"), &
2091 enum_i_vals=[1, 2], &
2092 default_i_val=1)
2093 CALL section_add_keyword(print_key, keyword)
2094 CALL keyword_release(keyword)
2095 CALL keyword_create(keyword, __location__, name="WRITE_CELL", &
2096 description="Controls whether the [Cell] block is written to the MOLDEN file.", &
2097 usage="WRITE_CELL TRUE", &
2098 default_l_val=.false., lone_keyword_l_val=.true.)
2099 CALL section_add_keyword(print_key, keyword)
2100 CALL keyword_release(keyword)
2101 CALL keyword_create(keyword, __location__, name="WRITE_PSEUDO", &
2102 description="Controls whether the [Pseudo] block is written to the MOLDEN file.", &
2103 usage="WRITE_PSEUDO TRUE", &
2104 default_l_val=.false., lone_keyword_l_val=.true.)
2105 CALL section_add_keyword(print_key, keyword)
2106 CALL keyword_release(keyword)
2107 CALL keyword_create(keyword, __location__, name="MARK_GHOST", &
2108 description="Controls whether ghost atoms are marked in the [Atoms] block by "// &
2109 "setting their atomic number to zero.", &
2110 usage="MARK_GHOST T", &
2111 default_l_val=.false., lone_keyword_l_val=.true.)
2112 CALL section_add_keyword(print_key, keyword)
2113 CALL keyword_release(keyword)
2114 CALL keyword_create(keyword, __location__, name="NDIGITS", &
2115 description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
2116 usage="NDIGITS {int}", &
2117 default_i_val=3)
2118 CALL section_add_keyword(print_key, keyword)
2119 CALL keyword_release(keyword)
2120 CALL keyword_create(keyword, __location__, name="GTO_KIND", &
2121 description="Representation of Gaussian-type orbitals", &
2122 default_i_val=gto_spherical, &
2123 enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
2124 enum_desc=s2a( &
2125 "Cartesian Gaussian orbitals. Use with caution", &
2126 "Spherical Gaussian orbitals. Incompatible with VMD"), &
2127 enum_i_vals=[gto_cartesian, gto_spherical])
2128 CALL section_add_keyword(print_key, keyword)
2129 CALL keyword_release(keyword)
2130 CALL section_add_subsection(subsection, print_key)
2131 CALL section_release(print_key)
2132
2133 CALL cp_print_key_section_create(print_key, __location__, name="NAMD_PRINT", &
2134 description="Controls the printout required for NAMD with NEWTONX.", &
2135 print_level=debug_print_level + 1, filename="CP2K_NEWTONX")
2136 CALL keyword_create(keyword, __location__, name="PRINT_VIRTUALS", &
2137 description="Print occupied AND virtual molecular orbital coefficients", &
2138 default_l_val=.false., lone_keyword_l_val=.true.)
2139 CALL section_add_keyword(print_key, keyword)
2140 CALL keyword_release(keyword)
2141 CALL keyword_create(keyword, __location__, name="PRINT_PHASES", &
2142 description="Print phases of occupied and virtuals MOs.", &
2143 default_l_val=.false., lone_keyword_l_val=.true.)
2144 CALL section_add_keyword(print_key, keyword)
2145 CALL keyword_release(keyword)
2146 CALL keyword_create(keyword, __location__, name="SCALE_WITH_PHASES", &
2147 description="Scale ES eigenvectors with phases of occupied and virtuals MOs.", &
2148 default_l_val=.false., lone_keyword_l_val=.true.)
2149 CALL section_add_keyword(print_key, keyword)
2150 CALL keyword_release(keyword)
2151 CALL section_add_subsection(subsection, print_key)
2152 CALL section_release(print_key)
2153
2154 !! SOC PRINT SECTION
2155 CALL cp_print_key_section_create(print_key, __location__, name="SOC_PRINT", &
2156 description="Controls the printout of the tddfpt2_soc modul", &
2157 print_level=debug_print_level + 1, filename="SOC")
2158 CALL keyword_create(keyword, __location__, name="UNIT_eV", &
2159 description="Will detrement if output in eVolt will be printef.", &
2160 default_l_val=.true., lone_keyword_l_val=.true.)
2161 CALL section_add_keyword(print_key, keyword)
2162 CALL keyword_release(keyword)
2163 CALL keyword_create(keyword, __location__, name="UNIT_wn", &
2164 description="Will detrement if output in wavenumbers will be printed.", &
2165 default_l_val=.false., lone_keyword_l_val=.true.)
2166 CALL section_add_keyword(print_key, keyword)
2167 CALL keyword_release(keyword)
2168 CALL keyword_create(keyword, __location__, name="SPLITTING", &
2169 description="Will add the SOC-Splitting as additional output", &
2170 default_l_val=.false., lone_keyword_l_val=.true.)
2171 CALL section_add_keyword(print_key, keyword)
2172 CALL keyword_release(keyword)
2173 CALL keyword_create(keyword, __location__, name="SOME", &
2174 description="Will add the SOC-Matrix as additional output in a different file", &
2175 default_l_val=.false., lone_keyword_l_val=.true.)
2176 CALL section_add_keyword(print_key, keyword)
2177 CALL keyword_release(keyword)
2178 CALL section_add_subsection(subsection, print_key)
2179 CALL section_release(print_key)
2180
2181 CALL cp_print_key_section_create(print_key, __location__, name="FORCES", &
2182 description="Controls the calculation and printing of excited state forces. "// &
2183 "This needs a RUN_TYPE that includes force evaluation, e.g. ENERGY_FORCE", &
2184 print_level=debug_print_level, filename="TDFORCE")
2185 CALL keyword_create(keyword, __location__, name="LIST", &
2186 description="Specifies a list of states for the force calculations.", &
2187 usage="LIST {integer} {integer} .. {integer}", repeats=.true., &
2188 n_var=-1, type_of_var=integer_t)
2189 CALL section_add_keyword(print_key, keyword)
2190 CALL keyword_release(keyword)
2191 CALL keyword_create(keyword, __location__, name="THRESHOLD", &
2192 description="Threshold for oszillator strength to screen states.", &
2193 usage="Threshold 0.01", &
2194 n_var=1, &
2195 type_of_var=real_t, &
2196 default_r_val=0.0_dp)
2197 CALL section_add_keyword(print_key, keyword)
2198 CALL keyword_release(keyword)
2199 CALL section_add_subsection(subsection, print_key)
2200 CALL section_release(print_key)
2201
2202 CALL section_add_subsection(section, subsection)
2203 CALL section_release(subsection)
2204
2205 END SUBROUTINE create_tddfpt2_section
2206
2207! **************************************************************************************************
2208!> \brief creates the stda input section (simplified Tamm Dancoff Approximation)
2209!> \param section the section to create
2210! **************************************************************************************************
2211 SUBROUTINE create_stda_section(section)
2212 TYPE(section_type), POINTER :: section
2213
2214 TYPE(keyword_type), POINTER :: keyword
2215
2216 cpassert(.NOT. ASSOCIATED(section))
2217 CALL section_create(section, __location__, name="sTDA", &
2218 description="parameters needed and setup for sTDA calculations", &
2219 n_keywords=3, n_subsections=0, repeats=.false.)
2220 NULLIFY (keyword)
2221
2222 CALL keyword_create(keyword, __location__, name="FRACTION", &
2223 variants=["HFX_FRACTION"], &
2224 description="The fraction of TB Hartree-Fock exchange to use in the Kernel. "// &
2225 "0.0 implies no HFX part is used in the kernel. ", &
2226 usage="FRACTION 0.0", default_r_val=0.0_dp)
2227 CALL section_add_keyword(section, keyword)
2228 CALL keyword_release(keyword)
2229
2230 ! even if scaling parameter for exchange FRACTION (see above) is zero, the semi-empirical electron repulsion
2231 ! operator for exchange is not, so that a keyword is required to switch off sTDA exchange (if wanted)
2232 CALL keyword_create(keyword, __location__, name="DO_EXCHANGE", &
2233 description="Explicitly including or switching off sTDA exchange", &
2234 usage="DO_EXCHANGE", default_l_val=.true., lone_keyword_l_val=.true.)
2235 CALL section_add_keyword(section, keyword)
2236 CALL keyword_release(keyword)
2237
2238 CALL keyword_create(keyword, __location__, name="DO_EWALD", &
2239 description="Use Ewald type method for Coulomb interaction", &
2240 usage="DO_EWALD", default_l_val=.false., lone_keyword_l_val=.true.)
2241 CALL section_add_keyword(section, keyword)
2242 CALL keyword_release(keyword)
2243
2244 CALL keyword_create(keyword, __location__, name="EPS_TD_FILTER", &
2245 description="Threshold for filtering the transition density matrix", &
2246 usage="EPS_TD_FILTER epsf", default_r_val=1.e-10_dp)
2247 CALL section_add_keyword(section, keyword)
2248 CALL keyword_release(keyword)
2249
2250 CALL keyword_create(keyword, __location__, name="MATAGA_NISHIMOTO_CEXP", &
2251 description="Exponent used in Mataga-Nishimoto formula for Coulomb (alpha). "// &
2252 "Default value is method dependent!", &
2253 usage="MATAGA_NISHIMOTO_CEXP cexp", default_r_val=-99.0_dp)
2254 CALL section_add_keyword(section, keyword)
2255 CALL keyword_release(keyword)
2256
2257 CALL keyword_create(keyword, __location__, name="MATAGA_NISHIMOTO_XEXP", &
2258 description="Exponent used in Mataga-Nishimoto formula for Exchange (beta). "// &
2259 "Default value is method dependent!", &
2260 usage="MATAGA_NISHIMOTO_XEXP xexp", default_r_val=-99.0_dp)
2261 CALL section_add_keyword(section, keyword)
2262 CALL keyword_release(keyword)
2263
2264 CALL keyword_create(keyword, __location__, name="COULOMB_SR_CUT", &
2265 description="Maximum range of short range part of Coulomb interaction.", &
2266 usage="COULOMB_SR_CUT rcut", default_r_val=20.0_dp)
2267 CALL section_add_keyword(section, keyword)
2268 CALL keyword_release(keyword)
2269
2270 CALL keyword_create(keyword, __location__, name="COULOMB_SR_EPS", &
2271 description="Threshold for short range part of Coulomb interaction.", &
2272 usage="COULOMB_SR_EPS sreps", default_r_val=1.e-03_dp)
2273 CALL section_add_keyword(section, keyword)
2274 CALL keyword_release(keyword)
2275
2276 END SUBROUTINE create_stda_section
2277
2278! **************************************************************************************************
2279!> \brief creates the RES input section (Reduced Excitation Space)
2280!> \param section the section to create
2281! **************************************************************************************************
2282 SUBROUTINE create_res_section(section)
2283 TYPE(section_type), POINTER :: section
2284
2285 TYPE(keyword_type), POINTER :: keyword
2286
2287 cpassert(.NOT. ASSOCIATED(section))
2288 CALL section_create(section, __location__, name="REDUCED_EXCITATION_SPACE", &
2289 description="Sets up a restricted (reduced) excitation space for TDDFT", &
2290 n_keywords=3, n_subsections=0, repeats=.false.)
2291
2292 NULLIFY (keyword)
2293 CALL keyword_create(keyword, __location__, &
2294 name="_SECTION_PARAMETERS_", &
2295 description="Controls the activation of RES calculation.", &
2296 default_l_val=.false., &
2297 lone_keyword_l_val=.true.)
2298 CALL section_add_keyword(section, keyword)
2299 CALL keyword_release(keyword)
2300
2301 CALL keyword_create(keyword, __location__, name="ENERGY_WINDOW", &
2302 description="Upper and lower cutoffs [eV] for orbitals to be included for excitations. ", &
2303 usage="ENERGY_WINDOW -5.0 0.0", default_r_vals=[-1.0e10_dp, 1.0e10_dp], &
2304 type_of_var=real_t, unit_str="eV")
2305 CALL section_add_keyword(section, keyword)
2306 CALL keyword_release(keyword)
2307
2308 CALL keyword_create(keyword, __location__, name="UPPER_ENERGY_CUTOFF", &
2309 description="Upper energy cutoff [eV] for orbitals to be included in excitations.", &
2310 usage="UPPER_ENERGY_CUTOFF -5.0", default_r_val=1.0e10_dp, &
2311 type_of_var=real_t, unit_str="eV")
2312 CALL section_add_keyword(section, keyword)
2313 CALL keyword_release(keyword)
2314
2315 CALL keyword_create(keyword, __location__, name="LOWER_ENERGY_CUTOFF", &
2316 description="Lower energy cutoff [eV] for orbitals to be included in excitations.", &
2317 usage="LOWER_ENERGY_CUTOFF -5.0", default_r_val=-1.0e10_dp, &
2318 type_of_var=real_t, unit_str="eV")
2319 CALL section_add_keyword(section, keyword)
2320 CALL keyword_release(keyword)
2321
2322 CALL keyword_create(keyword, __location__, name="MOLECULE_LIST", &
2323 description="Indices of molecules to be excited. "// &
2324 "This implies the calculation of molecular states through orbital location "// &
2325 "and subspace diagonalization.", &
2326 usage="MOLECULE_LIST {integer} {integer} .. {integer} ", &
2327 n_var=-1, type_of_var=integer_t, repeats=.false.)
2328 CALL section_add_keyword(section, keyword)
2329 CALL keyword_release(keyword)
2330
2331 END SUBROUTINE create_res_section
2332
2333! **************************************************************************************************
2334!> \brief creates an input section for electronic band structure calculations
2335!> \param section section to create
2336!> \par History
2337!> * 07.2023 created [Jan Wilhelm]
2338! **************************************************************************************************
2339 SUBROUTINE create_bandstructure_section(section)
2340 TYPE(section_type), POINTER :: section
2341
2342 TYPE(keyword_type), POINTER :: keyword
2343 TYPE(section_type), POINTER :: subsection
2344
2345 cpassert(.NOT. ASSOCIATED(section))
2346 CALL section_create(section, __location__, name="BANDSTRUCTURE", &
2347 description="Parameters needed to set up a calculation for "// &
2348 "electronic level energies of molecules and the electronic band "// &
2349 "structure of materials from post-SCF schemes (GW, perturbative "// &
2350 "spin-orbit coupling). Also, the density of states (DOS), "// &
2351 "projected density of states (PDOS), local density of states (LDOS), "// &
2352 "local valence band maximum (LVBM), local conduction band minimum "// &
2353 "(LCBM) and local band gap can be calculated. Please note that "// &
2354 "all methods in this section start from a Gamma-only DFT SCF. "// &
2355 "You need to make sure that the cell chosen in the DFT SCF is "// &
2356 "converged in the cell size. Band structures are computed "// &
2357 "for the primitive cell (i.e. the smallest possible unit cell of "// &
2358 "the input structure which is detected automatically). Moreover, "// &
2359 "spin-orbit coupling (SOC) on eigenvalues and band structures is "// &
2360 "available using Hartwigsen-Goedecker-Hutter "// &
2361 "pseudopotentials.", &
2362 n_keywords=1, n_subsections=1, repeats=.false.)
2363
2364 NULLIFY (keyword, subsection)
2365 CALL keyword_create(keyword, __location__, &
2366 name="_SECTION_PARAMETERS_", &
2367 description="Controls the activation of the band structure calculation.", &
2368 default_l_val=.false., &
2369 lone_keyword_l_val=.true.)
2370 CALL section_add_keyword(section, keyword)
2371 CALL keyword_release(keyword)
2372
2373 ! here we generate a subsection for getting a k-point path for the bandstructure
2374 CALL create_kpoint_set_section(subsection, "BANDSTRUCTURE_PATH")
2375 CALL section_add_subsection(section, subsection)
2376 CALL section_release(subsection)
2377
2378 CALL create_gw_section(subsection)
2379 CALL section_add_subsection(section, subsection)
2380 CALL section_release(subsection)
2381
2382 CALL create_soc_section(subsection)
2383 CALL section_add_subsection(section, subsection)
2384 CALL section_release(subsection)
2385
2386 CALL create_dos_section(subsection)
2387 CALL section_add_subsection(section, subsection)
2388 CALL section_release(subsection)
2389
2390 CALL create_floquet_section(subsection)
2391 CALL section_add_subsection(section, subsection)
2392 CALL section_release(subsection)
2393
2394 END SUBROUTINE create_bandstructure_section
2395
2396! **************************************************************************************************
2397!> \brief creates an input section for a GW calculation for the electronic band structure
2398!> \param section section to create
2399!> \par History
2400!> * 07.2023 created [Jan Wilhelm]
2401! **************************************************************************************************
2402 SUBROUTINE create_gw_section(section)
2403 TYPE(section_type), POINTER :: section
2404
2405 TYPE(keyword_type), POINTER :: keyword
2406 TYPE(section_type), POINTER :: print_key, subsection
2407
2408 cpassert(.NOT. ASSOCIATED(section))
2409 CALL section_create(section, __location__, name="GW", &
2410 description="Parameters needed to set up a GW calculation for "// &
2411 "electronic level energies $\varepsilon_{n\mathbf{k}}^{G_0W_0}$ "// &
2412 "of molecules and the band structure of materials: "// &
2413 "$\varepsilon_{n\mathbf{k}}^{G_0W_0}= "// &
2414 "\varepsilon_{n\mathbf{k}}^\text{DFT}+\Sigma_{n\mathbf{k}} "// &
2415 "-v^\text{xc}_{n\mathbf{k}}$. "// &
2416 "For the GW algorithm for molecules, see "// &
2417 "<https://doi.org/10.1021/acs.jctc.0c01282>. "// &
2418 "For 2D materials, see <https://doi.org/10.1021/acs.jctc.3c01230>.", &
2419 n_keywords=1, n_subsections=4, repeats=.false.)
2420
2421 NULLIFY (keyword)
2422 CALL keyword_create(keyword, __location__, &
2423 name="_SECTION_PARAMETERS_", &
2424 description="Controls the activation of the GW calculation.", &
2425 default_l_val=.false., &
2426 lone_keyword_l_val=.true.)
2427 CALL section_add_keyword(section, keyword)
2428 CALL keyword_release(keyword)
2429
2430 CALL keyword_create(keyword, __location__, name="NUM_TIME_FREQ_POINTS", &
2431 description="Number of discrete points for the imaginary-time "// &
2432 "grid and the imaginary-frequency grid. The more points, the more "// &
2433 "precise is the calculation. Typically, 10 points are good "// &
2434 "for 0.1 eV precision of band structures and molecular energy "// &
2435 "levels, 20 points for 0.03 eV precision, "// &
2436 "and 30 points for 0.01 eV precision, see Table I in "// &
2437 "<https://doi.org/10.1021/acs.jctc.0c01282>. GW computation time "// &
2438 "increases linearly with `NUM_TIME_FREQ_POINTS`.", &
2439 usage="NUM_TIME_FREQ_POINTS 30", &
2440 default_i_val=30)
2441 CALL section_add_keyword(section, keyword)
2442 CALL keyword_release(keyword)
2443
2444 CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
2445 description="Determines a threshold for the DBCSR based sparse "// &
2446 "multiplications. Normally, `EPS_FILTER` determines accuracy "// &
2447 "and timing of low-scaling GW calculations. (Lower filter means "// &
2448 "higher numerical precision, but higher computational cost.)", &
2449 usage="EPS_FILTER 1.0E-6", &
2450 default_r_val=1.0e-8_dp)
2451 CALL section_add_keyword(section, keyword)
2452 CALL keyword_release(keyword)
2453
2454 CALL keyword_create(keyword, __location__, name="REGULARIZATION_MINIMAX", &
2455 description="Parameter to regularize the Fourier transformation with minimax grids. "// &
2456 "In case the parameter 0.0 is chosen, no regularization is performed.", &
2457 usage="REGULARIZATION_MINIMAX 1.0E-4", &
2458 default_r_val=-1.0_dp)
2459 CALL section_add_keyword(section, keyword)
2460 CALL keyword_release(keyword)
2461
2462 CALL keyword_create(keyword, __location__, name="REGULARIZATION_RI", &
2463 description="Regularization applied to the GW RI fitting matrix "// &
2464 "$M_{PQ}$. A negative value selects the context-dependent default: "// &
2465 "zero for molecules and 1.0E-2 for periodic systems.", &
2466 usage="REGULARIZATION_RI 1.0E-4", &
2467 default_r_val=-1.0_dp)
2468 CALL section_add_keyword(section, keyword)
2469 CALL keyword_release(keyword)
2470
2471 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS_RI", &
2472 description="The cutoff radius (in Angstrom) for the truncated "// &
2473 "Coulomb operator. The larger the cutoff radius, the faster "// &
2474 "converges the resolution of the identity (RI) with respect to the "// &
2475 "RI basis set size. Larger cutoff radius means higher computational "// &
2476 "cost.", &
2477 usage="CUTOFF_RADIUS_RI 3.0", &
2478 default_r_val=cp_unit_to_cp2k(value=3.0_dp, unit_str="angstrom"), &
2479 type_of_var=real_t, unit_str="angstrom")
2480 CALL section_add_keyword(section, keyword)
2481 CALL keyword_release(keyword)
2482
2483 CALL keyword_create(keyword, __location__, name="MEMORY_PER_PROC", &
2484 description="Specify the available memory per MPI process (in GB). The "// &
2485 "default value -1 means that the available memory per MPI process is detected "// &
2486 "automatically from the free memory of the node divided by the number "// &
2487 "of MPI processes running on that node; this is the recommended setting. "// &
2488 "Note: This keyword is not used for GW calculations with RI-RS, "// &
2489 "where the available memory is always detected automatically.", &
2490 usage="MEMORY_PER_PROC 16", &
2491 default_r_val=-1.0_dp)
2492 CALL section_add_keyword(section, keyword)
2493 CALL keyword_release(keyword)
2494
2495 CALL keyword_create(keyword, __location__, name="APPROX_KP_EXTRAPOL", &
2496 description="If true, use only a 4x4 kpoint mesh for frequency "// &
2497 "points $\omega_j, j \ge 2$ (instead of a 4x4 and 6x6 k-point mesh). "// &
2498 "The k-point extrapolation of $W_{PQ}(i\omega_j,\mathbf{q})$ "// &
2499 "is done approximately from $W_{PQ}(i\omega_1,\mathbf{q})$.", &
2500 usage="APPROX_KP_EXTRAPOL", &
2501 default_l_val=.false., lone_keyword_l_val=.true.)
2502 CALL section_add_keyword(section, keyword)
2503 CALL keyword_release(keyword)
2504
2505 CALL keyword_create(keyword, __location__, name="SIZE_LATTICE_SUM", &
2506 description="Parameter determines how many neighbor cells $\mathbf{R}$ "// &
2507 "are used for computing "// &
2508 "$V_{PQ}(\mathbf{k}) = "// &
2509 "\sum_{\mathbf{R}} e^{i\mathbf{k}\cdot\mathbf{R}}\,\langle P, "// &
2510 "\text{cell}{=}\mathbf{0}|1/r|Q,\text{cell}{=}\mathbf{R}\rangle$. "// &
2511 "Normally, parameter does not need to be touched.", &
2512 usage="SIZE_LATTICE_SUM 4", &
2513 default_i_val=3)
2514 CALL section_add_keyword(section, keyword)
2515 CALL keyword_release(keyword)
2516
2517 CALL keyword_create( &
2518 keyword, __location__, name="KPOINTS_W", &
2519 description="Monkhorst-Pack k-point mesh of size N_x, N_y, N_z for calculating "// &
2520 "$W_{PQ}^\mathbf{R}=\int_\text{BZ}\frac{d\mathbf{k}}{\Omega_\text{BZ}}\, "// &
2521 "e^{-i\mathbf{k}\cdot\mathbf{R}}\,W_{PQ}(\mathbf{k})$. "// &
2522 "For non-periodic directions α, choose N_α = 1. "// &
2523 "Automatic choice of the k-point mesh for negative "// &
2524 "values, i.e. KPOINTS_W -1 -1 -1. "// &
2525 "K-point extrapolation of W is automatically switched on.", &
2526 usage="KPOINTS_W N_x N_y N_z", &
2527 n_var=3, type_of_var=integer_t, default_i_vals=[-1, -1, -1])
2528 CALL section_add_keyword(section, keyword)
2529 CALL keyword_release(keyword)
2530
2531 CALL keyword_create(keyword, __location__, name="HEDIN_SHIFT", &
2532 description="If true, use Hedin's shift in G0W0, evGW and evGW0. "// &
2533 "Details see in Li et al. JCTC 18, 7570 "// &
2534 "(2022), Figure 1. G0W0 with Hedin's shift should give "// &
2535 "similar GW eigenvalues as evGW0; at a lower "// &
2536 "computational cost.", &
2537 usage="HEDIN_SHIFT", &
2538 default_l_val=.false., &
2539 lone_keyword_l_val=.true.)
2540 CALL section_add_keyword(section, keyword)
2541 CALL keyword_release(keyword)
2542
2543 CALL keyword_create(keyword, __location__, name="FREQ_MAX_FIT", &
2544 description="For analytic continuation, a fit on Σ(iω) is performed. "// &
2545 "This fit is then evaluated at a real frequency, Σ(ω), which is used "// &
2546 "in the quasiparticle equation "// &
2547 "$\varepsilon_{n\mathbf{k}}^{G_0W_0}= "// &
2548 "\varepsilon_{n\mathbf{k}}^\text{DFT}+\Sigma_{n\mathbf{k}} "// &
2549 "-v^\text{xc}_{n\mathbf{k}}$. The keyword FREQ_MAX_FIT "// &
2550 "determines fitting range for the self-energy Σ(iω) on "// &
2551 "imaginary axis: i*[0, ω_max] for empty orbitals/bands, i*[-ω_max,0] "// &
2552 "for occ orbitals. A smaller ω_max might lead to better numerical "// &
2553 "stability (i.e., if you observe clearly wrong GW eigenvalues/bands "// &
2554 "around HOMO/LUMO, decreasing ω_max might fix this issue). "// &
2555 "A small benchmark of ω_max is contained in Fig. 5 of "// &
2556 "J. Wilhelm et al., JCTC 12, 3623-3635 (2016). "// &
2557 "Note that we used ω_max = 1 Ha = 27.211 eV in the benchmark "// &
2558 "M. Azizi et al., PRB 109, 245101 (2024).", &
2559 unit_str="eV", &
2560 usage="FREQ_MAX_FIT 20.0", &
2561 default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"))
2562 CALL section_add_keyword(section, keyword)
2563 CALL keyword_release(keyword)
2564
2565 NULLIFY (subsection, print_key)
2566 CALL section_create(subsection, __location__, name="PRINT", &
2567 description="Printing of GW restarts.", &
2568 n_keywords=2, n_subsections=1, repeats=.false.)
2569 CALL cp_print_key_section_create(print_key, __location__, "RESTART", &
2570 description="Controls the printing of restart files "// &
2571 "for χ, W, Σ.", &
2572 filename="", print_level=low_print_level, &
2573 common_iter_levels=3)
2574 CALL section_add_subsection(subsection, print_key)
2575 CALL section_release(print_key)
2576
2577 CALL section_add_subsection(section, subsection)
2578 CALL section_release(subsection)
2579
2580 NULLIFY (subsection)
2581 CALL create_ri_rs_section(subsection)
2582 CALL section_add_subsection(section, subsection)
2583 CALL section_release(subsection)
2584
2585 NULLIFY (subsection)
2586 CALL create_auto_ri_section(subsection)
2587 CALL section_add_subsection(section, subsection)
2588 CALL section_release(subsection)
2589
2590 NULLIFY (subsection)
2591 CALL create_evgw0_section(subsection)
2592 CALL section_add_subsection(section, subsection)
2593 CALL section_release(subsection)
2594
2595 END SUBROUTINE create_gw_section
2596
2597! **************************************************************************************************
2598!> \brief Creates the automatic RI basis set optimization section.
2599!> \param section AUTO_RI input section
2600! **************************************************************************************************
2601 SUBROUTINE create_auto_ri_section(section)
2602 TYPE(section_type), POINTER :: section
2603
2604 TYPE(keyword_type), POINTER :: keyword
2605
2606 cpassert(.NOT. ASSOCIATED(section))
2607 CALL section_create(section, __location__, name="AUTO_RI", &
2608 description="Optimizes the RI basis for non-periodic RI-RS GW "// &
2609 "calculations. The fitting target combines occupied-empty "// &
2610 "transitions and exchange products. Atom-local (AA) functions are "// &
2611 "selected first. Neighbor-pair (AB) functions are also used to fit "// &
2612 "occupied-empty transitions and exchange products. Currently only "// &
2613 "non-periodic molecules are supported.", &
2614 n_keywords=3, n_subsections=0, repeats=.false.)
2615 NULLIFY (keyword)
2616 CALL keyword_create(keyword, __location__, name="RI_AO_RATIO", &
2617 description="Ratio between the numbers of optimized RI and AO basis "// &
2618 "functions. For example, RI_AO_RATIO 3 requires an RI basis with "// &
2619 "three times as many functions as the AO basis. Compare values such "// &
2620 "as 1, 1.5, 2, 3 and 4 until the GW energies are converged. "// &
2621 "Larger values increase time and memory, but also increase the "// &
2622 "numerical accuracy.", &
2623 default_r_val=2.0_dp, usage="RI_AO_RATIO 2")
2624 CALL section_add_keyword(section, keyword)
2625 CALL keyword_release(keyword)
2626 CALL keyword_create(keyword, __location__, name="OCC_EMPTY_FRONTIER_ORBITAL_WINDOW", &
2627 description="The exchange contribution to the RI optimization "// &
2628 "objective includes GW levels within the energy window "// &
2629 "$[\epsilon_{\mathrm{HOMO}}-w,\epsilon_{\mathrm{LUMO}}+w]$. "// &
2630 "The default of 5 eV is usually sufficient, for example for "// &
2631 "GW-BSE excitations up to 10 eV.", &
2632 default_r_val=cp_unit_to_cp2k(value=5.0_dp, unit_str="eV"), &
2633 unit_str="eV", usage="OCC_EMPTY_FRONTIER_ORBITAL_WINDOW [eV] 5.0")
2634 CALL section_add_keyword(section, keyword)
2635 CALL keyword_release(keyword)
2636 CALL keyword_create(keyword, __location__, name="NEIGHBOR_RADIUS", &
2637 description="The RI basis also contains contractions of Gaussian "// &
2638 "functions centered on different atoms. An atom pair A-B is "// &
2639 "included for these contractions when its distance is smaller than "// &
2640 "NEIGHBOR_RADIUS. Larger radii increase the computational cost. "// &
2641 "Three angstrom is a reasonable value and usually does not need to "// &
2642 "be changed.", &
2643 default_r_val=cp_unit_to_cp2k(value=3.0_dp, unit_str="angstrom"), &
2644 unit_str="angstrom", usage="NEIGHBOR_RADIUS [angstrom] 3.0")
2645 CALL section_add_keyword(section, keyword)
2646 CALL keyword_release(keyword)
2647
2648 END SUBROUTINE create_auto_ri_section
2649
2650! **************************************************************************************************
2651!> \brief creates the input section collecting all parameters of the real-space resolution of
2652!> the identity (RI-RS) used in GW
2653!> \param section section to create
2654! **************************************************************************************************
2655 SUBROUTINE create_ri_rs_section(section)
2656 TYPE(section_type), POINTER :: section
2657
2658 TYPE(keyword_type), POINTER :: keyword
2659 TYPE(section_type), POINTER :: subsection
2660
2661 cpassert(.NOT. ASSOCIATED(section))
2662 CALL section_create(section, __location__, name="RI_RS", &
2663 description="Real-Space Resolution of Identity (RI-RS) method. This "// &
2664 "approximation replaces the conventional 3-center RI integrals "// &
2665 "$(\mu\nu|P)$ by a factorized representation on an atom-centered "// &
2666 "real-space grid with points $\mathbf{r}_\ell$: "// &
2667 "$(\mu\nu|P) \approx \sum_\ell \varphi_\mu(\mathbf{r}_\ell) "// &
2668 "\varphi_\nu(\mathbf{r}_\ell) Z_{\ell P}$. "// &
2669 "The coefficients $Z_{\ell P}$ combine the numerical integration "// &
2670 "weights and the Coulomb potential of the auxiliary basis function "// &
2671 "$P$ evaluated at grid point $\mathbf{r}_\ell$. To reduce the "// &
2672 "computational cost, only grid points within the sphere $B^P$ around "// &
2673 "atom $P$ are included, i.e. the points with "// &
2674 "$|\mathbf{r}_\ell - \mathbf{R}_P| < R_c + r_P$. "// &
2675 "Here, $r_P$ is the effective radius of the most diffuse RI "// &
2676 "auxiliary Gaussian on atom $P$, at which the basis function "// &
2677 "magnitude falls below a threshold $\delta$ "// &
2678 "(currently controlled through EPS_FILTER). "// &
2679 "This locality approximation yields a sparse representation of the "// &
2680 "3-center integrals and enables reduced computational cost. "// &
2681 "See details in https://doi.org/10.1063/1.5090605.", &
2682 n_keywords=11, n_subsections=1, repeats=.false.)
2683
2684 NULLIFY (keyword)
2685 CALL keyword_create(keyword, __location__, &
2686 name="_SECTION_PARAMETERS_", &
2687 description="Controls the activation of RI-RS in the GW calculation. "// &
2688 "An empty section, &RI_RS ... &END RI_RS, switches RI-RS on with "// &
2689 "default parameters.", &
2690 usage="&RI_RS .TRUE.", &
2691 default_l_val=.false., &
2692 lone_keyword_l_val=.true.)
2693 CALL section_add_keyword(section, keyword)
2694 CALL keyword_release(keyword)
2695
2696 CALL keyword_create(keyword, __location__, name="TIKHONOV", &
2697 description="Regularization parameter $\alpha$ used to stabilize "// &
2698 "the inversion of the grid-overlap matrix "// &
2699 "$D$ in the RI-RS method. "// &
2700 "See Equation (9) in https://doi.org/10.1063/1.5090605.", &
2701 usage="TIKHONOV 1.0E-8", &
2702 default_r_val=1.0e-08_dp)
2703 CALL section_add_keyword(section, keyword)
2704 CALL keyword_release(keyword)
2705
2706 CALL keyword_create(keyword, __location__, name="GRID_SELECT", &
2707 description="Selection of the atom-centered grid type used "// &
2708 "in RI-RS optimized by Duchemin and Blase. "// &
2709 "(1) def2-TZVPP: Available for elements up to the fourth row "// &
2710 "of the periodic table (see https://doi.org/10.1021/acs.jctc.1c00101). "// &
2711 "(2) cc-pVTZ: Available for H, C, N, and O atoms "// &
2712 "(see https://doi.org/10.1063/1.5090605). "// &
2713 "(3) User-provided grids: per-element grid files supplied by the "// &
2714 "user, read as ri_rs_grid/<Element><suffix> in the same format as "// &
2715 "the built-in sets; the suffix is _rirs.ion by default and can be "// &
2716 "changed with GRID_FILE_SUFFIX.", &
2717 usage="GRID_SELECT 1", &
2718 default_i_val=1)
2719 CALL section_add_keyword(section, keyword)
2720 CALL keyword_release(keyword)
2721
2722 CALL keyword_create(keyword, __location__, name="GRID_FILE_SUFFIX", &
2723 description="Overrides the per-element grid file suffix used by "// &
2724 "GRID_SELECT 3; grid files are read as ri_rs_grid/<Element><suffix>.", &
2725 usage="GRID_FILE_SUFFIX _my-grids.ion", &
2726 default_lc_val="")
2727 CALL section_add_keyword(section, keyword)
2728 CALL keyword_release(keyword)
2729
2730 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS_RL_RI", &
2731 description="Real-space cutoff radius (in Angstrom) for evaluating "// &
2732 "the RI-RS integration domain $B^P$. Overrides the default "// &
2733 "$R_c + r_P$, where $R_c$ is the truncated-Coulomb cutoff of the "// &
2734 "RI metric and $r_P$ the radius of the most diffuse RI auxiliary "// &
2735 "Gaussian on atom $P$.", &
2736 usage="CUTOFF_RADIUS_RL_RI 15.0", &
2737 default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2738 type_of_var=real_t, unit_str="angstrom")
2739 CALL section_add_keyword(section, keyword)
2740 CALL keyword_release(keyword)
2741
2742 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS_RL_AO", &
2743 description="Real-space cutoff radius (in Angstrom) for evaluating "// &
2744 "the AO basis functions on the RI-RS grid. Override the default radius "// &
2745 "derived automatically from the most diffuse AO Gaussian on each atom. ", &
2746 usage="CUTOFF_RADIUS_RL_AO 8.0", &
2747 default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2748 type_of_var=real_t, unit_str="angstrom")
2749 CALL section_add_keyword(section, keyword)
2750 CALL keyword_release(keyword)
2751
2752 CALL keyword_create(keyword, __location__, name="N_PROCS_PER_ATOM_Z_LP", &
2753 description="Number of MPI ranks that cooperate on one atom's "// &
2754 "Cholesky factorisation in computation of $Z_{\ell P}$ in RI-RS. "// &
2755 "Default -1 = AUTO: "// &
2756 "each atom is solved single-rank (fast BLAS) unless its dense "// &
2757 "grid-overlap matrix would exceed the available memory per process, "// &
2758 "in which case it is distributed across a rank subgroup sized "// &
2759 "automatically (ScaLAPACK). Set to 1 to force single-rank for all "// &
2760 "atoms, or > 1 to force that fixed subgroup size for all atoms.", &
2761 usage="N_PROCS_PER_ATOM_Z_LP 2", &
2762 default_i_val=-1)
2763 CALL section_add_keyword(section, keyword)
2764 CALL keyword_release(keyword)
2765
2766 CALL keyword_create(keyword, __location__, name="N_PANELS", &
2767 description="Number of grid panels (batches) the real-space grid is "// &
2768 "split into for the streaming chi/W/Sigma contractions in RI-RS. More "// &
2769 "panels means lower peak memory per step but more overhead. Default 1 = a "// &
2770 "single whole-grid panel. On large cells the number of panels is "// &
2771 "automatically increased beyond the request to keep per-rank DBCSR "// &
2772 "messages under the 32-bit length limit.", &
2773 usage="N_PANELS 4", &
2774 default_i_val=1)
2775 CALL section_add_keyword(section, keyword)
2776 CALL keyword_release(keyword)
2777
2778 CALL keyword_create(keyword, __location__, name="KEEP_SPARSITY_RL", &
2779 description="If `.TRUE.` (default), the W/V matrices in the "// &
2780 "grid-basis contractions of RI-RSwill used the sparsity pattern of the "// &
2781 "corresponding G/D matrices. "// &
2782 "Set `.FALSE.` to build W/V fully dense.", &
2783 usage="KEEP_SPARSITY_RL .FALSE.", &
2784 default_l_val=.true.)
2785 CALL section_add_keyword(section, keyword)
2786 CALL keyword_release(keyword)
2787
2788 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS_RL_W", &
2789 description="Real-space truncation radius (Angstrom) for the grid-basis "// &
2790 "G operators in the RI-RS GW self-energy. "// &
2791 "Default -1.0 disables the truncation (exact grid-basis operators).", &
2792 usage="CUTOFF_RADIUS_RL_W 20.0", &
2793 default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2794 type_of_var=real_t, unit_str="angstrom")
2795 CALL section_add_keyword(section, keyword)
2796 CALL keyword_release(keyword)
2797
2798 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS_G_W", &
2799 description="Atom-pair distance truncation radius (Angstrom) applied to "// &
2800 "the AO/RI-space operator matrices G, D, V and W themselves in the RI-RS "// &
2801 "GW contractions: matrix blocks between atoms further apart than this "// &
2802 "radius are dropped. Physically consistent with CUTOFF_RADIUS_RL_W, "// &
2803 "which truncates the grid-basis products at the same kind of range. "// &
2804 "Default -1.0 disables the truncation (exact operators).", &
2805 usage="CUTOFF_RADIUS_G_W 20.0", &
2806 default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2807 type_of_var=real_t, unit_str="angstrom")
2808 CALL section_add_keyword(section, keyword)
2809 CALL keyword_release(keyword)
2810
2811 NULLIFY (subsection)
2812 CALL create_ri_rs_grid_optimization_section(subsection)
2813 CALL section_add_subsection(section, subsection)
2814 CALL section_release(subsection)
2815
2816 END SUBROUTINE create_ri_rs_section
2817
2818! **************************************************************************************************
2819!> \brief Creates the GW RI-RS in-memory grid optimizer section.
2820!> \param section ...
2821! **************************************************************************************************
2822 SUBROUTINE create_ri_rs_grid_optimization_section(section)
2823 TYPE(section_type), POINTER :: section
2824
2825 TYPE(keyword_type), POINTER :: keyword
2826 NULLIFY (keyword)
2827 cpassert(.NOT. ASSOCIATED(section))
2828 CALL section_create( &
2829 section, __location__, name="GRID_OPTIMIZATION", repeats=.false., &
2830 description="Optimizes RI-RS grids using small local atomic environments. For every atom "// &
2831 "in the structure, a cluster is formed from all atoms whose distance from the centre atom "// &
2832 "is smaller than CUTOFF_ATOMIC_CLUSTER. All three-centre integrals within each cluster are "// &
2833 "computed analytically and serve as exact reference values. The grid points are optimized "// &
2834 "such that the corresponding RI-RS three-centre integrals reproduce these references. "// &
2835 "For a cluster $C_I$, the normalized squared RI-RS error is "// &
2836 "$E_I = \frac{1}{N_I} \sum_{P\mu\nu \in C_I} \left|(\mu\nu|P) - "// &
2837 "\sum_{\mathbf{r}_{A\ell} \in C_I} \varphi_\mu(\mathbf{r}_{A\ell}) "// &
2838 "\varphi_\nu(\mathbf{r}_{A\ell}) Z_{A\ell P}\right|^2$. The total objective is "// &
2839 "the average over all local clusters, "// &
2840 "$E_\mathrm{loc} = \frac{1}{N_\mathrm{at}} "// &
2841 "\sum_{I=1}^{N_\mathrm{at}} E_I$. Starting from pre-tabulated atom-specific grids, "// &
2842 "the optimization adapts the grid to the chemical environment and composition of the "// &
2843 "structure and can permit substantially smaller grids. Compact grids often work well for "// &
2844 "small basis sets, but the point count specified with GRID_SIZE or N_POINT_PERCENTAGE "// &
2845 "should be tuned and converged for the chosen basis sets and chemical system.")
2846
2847 CALL keyword_create( &
2848 keyword, __location__, name="GRID_SIZE", &
2849 description="Specifies how many grid points are used per atom for a given element. "// &
2850 "Repeat this keyword once for every element in the structure.", &
2851 usage="GRID_SIZE Si 100", type_of_var=char_t, repeats=.true., n_var=2)
2852 CALL section_add_keyword(section, keyword)
2853 CALL keyword_release(keyword)
2854
2855 CALL keyword_create( &
2856 keyword, __location__, name="N_POINT_PERCENTAGE", &
2857 description="The element grids are read from the .ion files selected by GRID_SELECT; "// &
2858 "GRID_FILE_SUFFIX determines user-provided filenames. From these initial grids, only "// &
2859 "N_POINT_PERCENTAGE % of each element's grid points are taken in the actual GW calculation.", &
2860 usage="N_POINT_PERCENTAGE 20", type_of_var=real_t, default_r_val=-1.0_dp)
2861 CALL section_add_keyword(section, keyword)
2862 CALL keyword_release(keyword)
2863
2864 CALL keyword_create( &
2865 keyword, __location__, name="CUTOFF_ATOMIC_CLUSTER", &
2866 description="Radius of the atom-centred cluster used to construct the local three-centre "// &
2867 "integral fitting objective. Atoms within this distance of the centre atom are included.", &
2868 usage="CUTOFF_ATOMIC_CLUSTER [angstrom] 3.0", type_of_var=real_t, &
2869 default_r_val=cp_unit_to_cp2k(value=3.0_dp, unit_str="angstrom"), &
2870 unit_str="angstrom")
2871 CALL section_add_keyword(section, keyword)
2872 CALL keyword_release(keyword)
2873
2874 CALL keyword_create( &
2875 keyword, __location__, name="MAX_ITER", &
2876 description="Maximum number of objective-and-gradient evaluations in the single "// &
2877 "cooperative Cartesian grid optimization.", &
2878 usage="MAX_ITER 100", default_i_val=100)
2879 CALL section_add_keyword(section, keyword)
2880 CALL keyword_release(keyword)
2881
2882 END SUBROUTINE create_ri_rs_grid_optimization_section
2883
2884! **************************************************************************************************
2885!> \brief creates the input section for eigenvalue self-consistent GW0 (evGW0)
2886!> \param section section to create
2887! **************************************************************************************************
2888 SUBROUTINE create_evgw0_section(section)
2889 TYPE(section_type), POINTER :: section
2890
2891 TYPE(keyword_type), POINTER :: keyword
2892
2893 cpassert(.NOT. ASSOCIATED(section))
2894 CALL section_create(section, __location__, name="EVGW0", &
2895 description="Eigenvalue self-consistent GW0. The quasiparticle "// &
2896 "energies replace the Kohn-Sham eigenvalues in the Green's function "// &
2897 "and the cycle is repeated, while the screened Coulomb interaction "// &
2898 "$W$ stays at its RPA@DFT value. Only the correlation self-energy "// &
2899 "and the quasiparticle equation are recomputed per cycle; $W$, the "// &
2900 "exchange self-energy and the RI-RS grid quantities are computed "// &
2901 "once. This implementation requires RI-RS. Without this section a "// &
2902 "single-shot G0W0 calculation is performed.", &
2903 n_keywords=3, n_subsections=0, repeats=.false.)
2904
2905 NULLIFY (keyword)
2906 CALL keyword_create(keyword, __location__, &
2907 name="_SECTION_PARAMETERS_", &
2908 description="Controls the activation of evGW0. An empty section, "// &
2909 "&EVGW0 ... &END EVGW0, switches evGW0 on with default parameters.", &
2910 usage="&EVGW0 .TRUE.", &
2911 default_l_val=.false., &
2912 lone_keyword_l_val=.true.)
2913 CALL section_add_keyword(section, keyword)
2914 CALL keyword_release(keyword)
2915
2916 CALL keyword_create(keyword, __location__, name="MAX_ITER", &
2917 description="Maximum number of evGW0 cycles.", &
2918 usage="MAX_ITER 20", &
2919 default_i_val=20)
2920 CALL section_add_keyword(section, keyword)
2921 CALL keyword_release(keyword)
2922
2923 CALL keyword_create(keyword, __location__, name="EPS_ITER", &
2924 description="Target accuracy of the eigenvalue self-consistency. "// &
2925 "The cycle stops once the quasiparticle HOMO, the quasiparticle "// &
2926 "LUMO and the HOMO-LUMO gap all change by less than this value "// &
2927 "between two successive cycles. Unit: Hartree.", &
2928 usage="EPS_ITER 0.00005", &
2929 default_r_val=5.0e-5_dp)
2930 CALL section_add_keyword(section, keyword)
2931 CALL keyword_release(keyword)
2932
2933 END SUBROUTINE create_evgw0_section
2934
2935! **************************************************************************************************
2936!> \brief creates an input section for calculation SOC for the electronic band structure
2937!> \param section section to create
2938!> \par History
2939!> * 09.2023 created [Jan Wilhelm]
2940! **************************************************************************************************
2941 SUBROUTINE create_soc_section(section)
2942 TYPE(section_type), POINTER :: section
2943
2944 TYPE(keyword_type), POINTER :: keyword
2945
2946 cpassert(.NOT. ASSOCIATED(section))
2947 CALL section_create(section, __location__, name="SOC", &
2948 description="Switch on or off spin-orbit coupling. Use SOC "// &
2949 "parameters from non-local pseudopotentials as given in "// &
2950 "Hartwigsen, Goedecker, Hutter, Eq.(18), (19), "// &
2951 "<https://doi.org/10.1103/PhysRevB.58.3641>, "// &
2952 "$V_{\mu\nu}^{\mathrm{SOC}, (\alpha)} = "// &
2953 "(\hbar/2) \langle \phi_\mu | \sum_l \Delta "// &
2954 "V_l^\mathrm{SO}(\mathbf{r},\mathbf{r}') "// &
2955 "L^{(\alpha)} | \phi_\nu \rangle, "// &
2956 "\alpha = x, y, z$.", &
2957 n_keywords=1, n_subsections=1, repeats=.false.)
2958
2959 NULLIFY (keyword)
2960 CALL keyword_create(keyword, __location__, &
2961 name="_SECTION_PARAMETERS_", &
2962 description="Controls the activation of the SOC calculation.", &
2963 default_l_val=.false., &
2964 lone_keyword_l_val=.true.)
2965 CALL section_add_keyword(section, keyword)
2966 CALL keyword_release(keyword)
2967
2968 CALL keyword_create(keyword, __location__, name="SOC_WINDOW_OCC", &
2969 description="Apply SOC only for states with eigenvalues below VBM "// &
2970 "in the interval $[\varepsilon_\mathrm{VBM}-E_\mathrm{window\_occ}, \ "// &
2971 "\varepsilon_\mathrm{VBM}]$. "// &
2972 "to use for large systems to prevent numerical instabilities.", &
2973 usage="SOC_WINDOW_OCC 5.0", &
2974 default_r_val=-1.0_dp, &
2975 unit_str="eV")
2976 CALL section_add_keyword(section, keyword)
2977 CALL keyword_release(keyword)
2978
2979 CALL keyword_create(keyword, __location__, name="SOC_WINDOW_VIRT", &
2980 description="Apply SOC only for states with eigenvalues above CBM "// &
2981 "in the interval $[\varepsilon_\mathrm{CBM},\ "// &
2982 "\varepsilon_\mathrm{CBM}+E_\mathrm{window\_virt}]$, "// &
2983 "to use for large systems to prevent numerical instabilities.", &
2984 usage="SOC_WINDOW_VIRT 5.0", &
2985 default_r_val=-1.0_dp, &
2986 unit_str="eV")
2987 CALL section_add_keyword(section, keyword)
2988 CALL keyword_release(keyword)
2989
2990 CALL keyword_create(keyword, __location__, name="SOC_WINDOW_SMEARING", &
2991 description="Width of the Fermi-like smoothing at the SOC energy-window edge. "// &
2992 "Default reproduces the value of 1 eV. "// &
2993 "only effective when at least one SOC window is active.", &
2994 usage="SOC_WINDOW_SMEARING 1.0", &
2995 default_r_val=cp_unit_to_cp2k(value=1.0_dp, unit_str="eV"), &
2996 unit_str="eV")
2997 CALL section_add_keyword(section, keyword)
2998 CALL keyword_release(keyword)
2999
3000 END SUBROUTINE create_soc_section
3001
3002! **************************************************************************************************
3003!> \brief input section for computing the density of states and the projected density of states
3004!> \param section section to create
3005!> \par History
3006!> * 09.2023 created [Jan Wilhelm]
3007! **************************************************************************************************
3008 SUBROUTINE create_dos_section(section)
3009 TYPE(section_type), POINTER :: section
3010
3011 TYPE(keyword_type), POINTER :: keyword
3012 TYPE(section_type), POINTER :: subsection
3013
3014 cpassert(.NOT. ASSOCIATED(section))
3015 CALL section_create(section, __location__, name="DOS", &
3016 description="Parameters needed to calculate the density of states "// &
3017 "(DOS) and the projected density of states (PDOS).", &
3018 n_keywords=1, n_subsections=1, repeats=.false.)
3019
3020 NULLIFY (keyword)
3021 CALL keyword_create(keyword, __location__, &
3022 name="_SECTION_PARAMETERS_", &
3023 description="Controls the activation of the DOS calculation.", &
3024 default_l_val=.false., &
3025 lone_keyword_l_val=.true.)
3026 CALL section_add_keyword(section, keyword)
3027 CALL keyword_release(keyword)
3028
3029 CALL keyword_create(keyword, __location__, name="ENERGY_WINDOW", &
3030 description="Print DOS and PDOS in the energy window "// &
3031 "$[\varepsilon_\mathrm{VBM}-E_\mathrm{window}/2, "// &
3032 "\varepsilon_\mathrm{CBM}+E_\mathrm{window}/2]$,"// &
3033 " where VBM is the valence "// &
3034 "band maximum (or highest occupied molecular orbital, HOMO, for "// &
3035 "molecules) and CBM the conduction band minimum (or lowest "// &
3036 "unoccupied molecular orbital, LUMO, for molecules).", &
3037 usage="ENERGY_WINDOW 5.0", &
3038 default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"), &
3039 unit_str="eV")
3040 CALL section_add_keyword(section, keyword)
3041 CALL keyword_release(keyword)
3042
3043 CALL keyword_create(keyword, __location__, name="ENERGY_STEP", &
3044 description="Resolution of the energy E when computing the $\rho(E)$.", &
3045 usage="ENERGY_STEP 0.01", &
3046 default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
3047 unit_str="eV")
3048 CALL section_add_keyword(section, keyword)
3049 CALL keyword_release(keyword)
3050
3051 CALL keyword_create(keyword, __location__, name="BROADENING", &
3052 description="Broadening α in Gaussians used in the DOS; "// &
3053 "$\rho(E) = \sum_n \exp(((E-\varepsilon_n)/\alpha)^2)/("// &
3054 " \sqrt{2\pi} \alpha)$.", &
3055 usage="BROADENING 0.01", &
3056 default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
3057 unit_str="eV")
3058 CALL section_add_keyword(section, keyword)
3059 CALL keyword_release(keyword)
3060
3061 CALL keyword_create( &
3062 keyword, __location__, name="KPOINTS", &
3063 description="Monkhorst-Pack k-point mesh of size N_x, N_y, N_z for calculating "// &
3064 "the density of states (DOS). In GW, the KPOINT_DOS mesh is thus used as k-point "// &
3065 "mesh for the self-energy. For non-periodic directions α, choose N_α = 1. "// &
3066 "Automatic choice of the k-point mesh for negative "// &
3067 "values, i.e. KPOINTS_DOS -1 -1 -1 (automatic choice: N_α = 1 in non-periodic "// &
3068 "direction, 8 k-points in periodic direction). If you like to compute a "// &
3069 "band structure along a k-path, you can specify the k-path in "// &
3070 "&KPOINT_SET.", &
3071 usage="KPOINTS N_x N_y N_z", &
3072 n_var=3, type_of_var=integer_t, default_i_vals=[-1, -1, -1])
3073 CALL section_add_keyword(section, keyword)
3074 CALL keyword_release(keyword)
3075
3076 NULLIFY (subsection)
3077 CALL create_ldos_section(subsection)
3078 CALL section_add_subsection(section, subsection)
3079 CALL section_release(subsection)
3080
3081 END SUBROUTINE create_dos_section
3082
3083! **************************************************************************************************
3084!> \brief ...
3085!> \param section ...
3086! **************************************************************************************************
3087 SUBROUTINE create_ldos_section(section)
3088 TYPE(section_type), POINTER :: section
3089
3090 TYPE(keyword_type), POINTER :: keyword
3091
3092 cpassert(.NOT. ASSOCIATED(section))
3093 CALL section_create(section, __location__, name="LDOS", &
3094 description="Parameters needed to calculate the local density "// &
3095 "of states (LDOS). "// &
3096 "The LDOS is computed as $\rho(\mathbf{r},E) = "// &
3097 "\sum\limits_{n,\mathbf{k}}"// &
3098 " |\psi_{n\mathbf{k}}(r)|^2\, w_\mathbf{k}\, g(E-\varepsilon_{n\mathbf{k}})$ "// &
3099 "using the Gaussian weight function "// &
3100 "$g(x) = \exp(x^2/\alpha^2)/(\sqrt{2\pi}\alpha)$, $\alpha$ is the broadening "// &
3101 "from the &DOS section, and the k-point weight "// &
3102 "$w_\mathbf{k}$. The k-mesh is taken from the &DOS section.", &
3103 n_keywords=2, repeats=.false.)
3104
3105 NULLIFY (keyword)
3106 CALL keyword_create(keyword, __location__, &
3107 name="_SECTION_PARAMETERS_", &
3108 description="Activates the local VBM CBM gap calculation.", &
3109 default_l_val=.false., &
3110 lone_keyword_l_val=.true.)
3111 CALL section_add_keyword(section, keyword)
3112 CALL keyword_release(keyword)
3113
3114 CALL keyword_create(keyword, __location__, name="INTEGRATION", &
3115 description="Defines whether the LDOS is integrated along a "// &
3116 "coordinate. As an example, for INTEGRATION Z, the LDOS "// &
3117 "$\rho(x,y,E) = \int dz\, \rho(x,y,z,E)$ is computed.", &
3118 usage="INTEGRATION Z", &
3119 enum_c_vals=s2a("X", "Y", "Z", "NONE"), &
3120 enum_i_vals=[int_ldos_x, int_ldos_y, int_ldos_z, int_ldos_none], &
3121 enum_desc=s2a("Integrate over x coordinate (not yet implemented).", &
3122 "Integrate over y coordinate (not yet implemented).", &
3123 "Integrate over z coordinate.", &
3124 "No integration, print cube file as function "// &
3125 "of x,y,z (not yet implemented)."), &
3126 default_i_val=int_ldos_z)
3127 CALL section_add_keyword(section, keyword)
3128 CALL keyword_release(keyword)
3129
3130 CALL keyword_create( &
3131 keyword, __location__, name="BIN_MESH", &
3132 description="Mesh of size n x m for binning the space coordinates x and y of "// &
3133 "the LDOS $\rho(x,y,E)$. If -1, no binning is performed and the "// &
3134 "fine x, y resolution of the electron density from SCF is used.", &
3135 usage="BIN_MESH n m", &
3136 n_var=2, type_of_var=integer_t, default_i_vals=[10, 10])
3137 CALL section_add_keyword(section, keyword)
3138 CALL keyword_release(keyword)
3139
3140 END SUBROUTINE create_ldos_section
3141
3142! **************************************************************************************************
3143!> \brief creates an input section for a tip scan calculation
3144!> \param section section to create
3145!> \par History
3146!> * 04.2021 created [JGH]
3147! **************************************************************************************************
3148 SUBROUTINE create_tipscan_section(section)
3149 TYPE(section_type), POINTER :: section
3150
3151 TYPE(keyword_type), POINTER :: keyword
3152
3153 cpassert(.NOT. ASSOCIATED(section))
3154 CALL section_create(section, __location__, name="TIP_SCAN", &
3155 description="Parameters needed to set up a Tip Scan. "// &
3156 "Needs external definition of tip induced field.", &
3157 n_keywords=1, n_subsections=1, repeats=.false.)
3158
3159 NULLIFY (keyword)
3160
3161 CALL keyword_create(keyword, __location__, &
3162 name="_SECTION_PARAMETERS_", &
3163 description="Controls the activation of the Tip Scan procedure", &
3164 default_l_val=.false., &
3165 lone_keyword_l_val=.true.)
3166 CALL section_add_keyword(section, keyword)
3167 CALL keyword_release(keyword)
3168
3169 CALL keyword_create(keyword, __location__, name="SCAN_DIRECTION", &
3170 description="Defines scan direction and scan type(line, plane).", &
3171 usage="SCAN_DIRECTION XY", &
3172 enum_c_vals=s2a("X", "Y", "Z", "XY", "XZ", "YZ", "XYZ"), &
3173 enum_i_vals=[scan_x, scan_y, scan_z, scan_xy, scan_xz, scan_yz, scan_xyz], &
3174 default_i_val=scan_xy)
3175 CALL section_add_keyword(section, keyword)
3176 CALL keyword_release(keyword)
3177
3178 CALL keyword_create(keyword, __location__, name="REFERENCE_POINT", &
3179 description="The reference point to define the absolute position of the scan. ", &
3180 usage="REFERENCE_POINT 0.0 0.0 1.0", &
3181 n_var=3, default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp], type_of_var=real_t, &
3182 unit_str="angstrom")
3183 CALL section_add_keyword(section, keyword)
3184 CALL keyword_release(keyword)
3185
3186 CALL keyword_create(keyword, __location__, name="SCAN_POINTS", &
3187 description="Number of points calculated for each scan direction.", &
3188 usage="SCAN_POINTS 20 20", &
3189 n_var=-1, type_of_var=integer_t)
3190 CALL section_add_keyword(section, keyword)
3191 CALL keyword_release(keyword)
3192
3193 CALL keyword_create(keyword, __location__, name="SCAN_STEP", &
3194 description="Step size for each scan direction.", &
3195 usage="SCAN_STEP 0.01 0.01", &
3196 n_var=-1, type_of_var=real_t, unit_str="angstrom")
3197 CALL section_add_keyword(section, keyword)
3198 CALL keyword_release(keyword)
3199
3200 CALL keyword_create(keyword, __location__, name="TIP_FILENAME", &
3201 description="Filename of tip potential defined in cube file format.", &
3202 usage="TIP_FILENAME <filename>", &
3203 type_of_var=lchar_t)
3204 CALL section_add_keyword(section, keyword)
3205 CALL keyword_release(keyword)
3206
3207 END SUBROUTINE create_tipscan_section
3208
3209! **************************************************************************************************
3210!> \brief ...
3211!> \param section ...
3212!> \param section_name ...
3213!> \author Shridhar Shanbhag
3214! **************************************************************************************************
3215 SUBROUTINE create_floquet_section(section)
3216 TYPE(section_type), POINTER :: section
3217
3218 TYPE(keyword_type), POINTER :: keyword
3219
3220 CALL section_create(section, __location__, name="FLOQUET", &
3221 description="Parameters controlling the calculation of the "// &
3222 "Floquet band structure and Quasi-energies of a system driven "// &
3223 "by a periodic monochromatic electric field with any arbitrary "// &
3224 "polarisation state.", &
3225 n_keywords=1, n_subsections=0, repeats=.false.)
3226 NULLIFY (keyword)
3227
3228 CALL keyword_create(keyword, __location__, name="AMPLITUDE", &
3229 description="Electric field amplitude of the monochromatic light.", &
3230 usage="AMPLITUDE [Vm-1] 1.0E9", n_var=1, type_of_var=real_t, &
3231 unit_str="Vm-1", default_r_val=0.0_dp)
3232 CALL section_add_keyword(section, keyword)
3233 CALL keyword_release(keyword)
3234
3235 CALL keyword_create(keyword, __location__, name="FREQUENCY", &
3236 description="Frequency of the electric field for Floquet calculations "// &
3237 "expressed in terms of the energy of a photon in eV.", &
3238 usage="FREQUENCY 1.5", unit_str="eV", n_var=1, type_of_var=real_t, &
3239 default_r_val=cp_unit_to_cp2k(value=1.0_dp, unit_str="eV"))
3240 CALL section_add_keyword(section, keyword)
3241 CALL keyword_release(keyword)
3242
3243 CALL keyword_create(keyword, __location__, name="POLARISATION", &
3244 description="Polarisation vector of the input light. The "// &
3245 "amplitude in each direction is the product of the AMPLITUDE "// &
3246 "and the POLARISATION vector component. Eg. for light polarized "// &
3247 "in the x direction, use 1 0 0. For left-circularly polarized "// &
3248 "light travelling in the +z direction use 1 1 0 and set "// &
3249 "PHASE_OFFSET 0 0.5 0 for a +Ï€/2 offset", &
3250 usage="POLARISATION 0.0 0.0 1.0", &
3251 default_r_vals=[0.0_dp, 0.0_dp, 1.0_dp])
3252 CALL section_add_keyword(section, keyword)
3253 CALL keyword_release(keyword)
3254
3255 CALL keyword_create(keyword, __location__, name="PHASE_OFFSETS", &
3256 description="Phase offset of the electric field in the "// &
3257 "x, y, and z directions given in multiples of π. For "// &
3258 "linearly polarized light, use 0 0 0 and for left-circularly "// &
3259 "polarized light travelling in the +z direction use "// &
3260 "PHASE_OFFSET 0.0 0.5 0 ", &
3261 usage="PHASE_OFFSETS 0.5 0 0", &
3262 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp])
3263 CALL section_add_keyword(section, keyword)
3264 CALL keyword_release(keyword)
3265
3266 CALL keyword_create(keyword, __location__, name="MAX_FLOQUET_INDEX", &
3267 description="Largest absolute Floquet index up to which "// &
3268 "Floquet Hamiltonian is truncated. Use a larger value to "// &
3269 "ensure convergence at higher computational cost and a "// &
3270 "smaller value for faster computation. EPS_FLOQUET checks "// &
3271 "to ensure that the error due to truncation is small.", &
3272 usage="MAX_FLOQUET_INDEX 50", &
3273 default_i_val=50)
3274 CALL section_add_keyword(section, keyword)
3275 CALL keyword_release(keyword)
3276
3277 CALL keyword_create(keyword, __location__, name="EPS_FLOQUET", &
3278 description="Threshold on the error due to truncation of "// &
3279 "the Floquet Hamiltonian. Used to verify that MAX_FLOQUET_INDEX "// &
3280 "is large enough that truncation errors are small. "// &
3281 "If negative, the check is removed (not recommended).", &
3282 usage="EPS_FLOQUET 1.e-10", default_r_val=1.0e-10_dp)
3283 CALL section_add_keyword(section, keyword)
3284 CALL keyword_release(keyword)
3285
3286 CALL keyword_create(keyword, __location__, name="ENERGY_WINDOW", &
3287 description="Half-width of the energy range, in eV, centred "// &
3288 "on the Fermi level, over which the Floquet spectral "// &
3289 "function is evaluated.", &
3290 usage="ENERGY_WINDOW 5.0", &
3291 default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"), &
3292 unit_str="eV")
3293 CALL section_add_keyword(section, keyword)
3294 CALL keyword_release(keyword)
3295
3296 CALL keyword_create(keyword, __location__, name="ENERGY_STEP", &
3297 description="Resolution of the energy E used to compute the "// &
3298 "spectral function within the energy window.", &
3299 usage="ENERGY_STEP 0.01", &
3300 default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
3301 unit_str="eV")
3302 CALL section_add_keyword(section, keyword)
3303 CALL keyword_release(keyword)
3304
3305 CALL keyword_create(keyword, __location__, name="BROADENING", &
3306 description="Lorentzian broadening applied to the peaks of the "// &
3307 "Floquet spectral function.", &
3308 usage="BROADENING 0.02", &
3309 default_r_val=cp_unit_to_cp2k(value=0.02_dp, unit_str="eV"), &
3310 unit_str="eV")
3311 CALL section_add_keyword(section, keyword)
3312 CALL keyword_release(keyword)
3313
3314 CALL keyword_create(keyword, __location__, name="TEMPERATURE", &
3315 description="Electronic temperature (in K) of the wide-band fermion "// &
3316 "bath used to weight the Floquet DOS by Fermi-Dirac occupations, adding "// &
3317 "an occupied spectral-weight column f(E)*A(E) to the DOS file. If "// &
3318 "negative (default), that column is not written.", &
3319 usage="TEMPERATURE 300.0", default_r_val=-1.0_dp)
3320 CALL section_add_keyword(section, keyword)
3321 CALL keyword_release(keyword)
3322
3323 CALL keyword_create(keyword, __location__, name="FLOQUET_DOS_FILE_NAME", &
3324 description="File name used for the Floquet spectral function.", &
3325 usage="FLOQUET_DOS_FILE_NAME FLOQUET_DOS", &
3326 default_lc_val="FLOQUET_DOS")
3327 CALL section_add_keyword(section, keyword)
3328 CALL keyword_release(keyword)
3329
3330 CALL keyword_create(keyword, __location__, name="QUASI_ENERGIES_FILE_NAME", &
3331 description="File name used for the Floquet quasi-energies.", &
3332 usage="QUASI_ENERGIES_FILE_NAME QUASI_ENERGIES", &
3333 default_lc_val="QUASI_ENERGIES")
3334 CALL section_add_keyword(section, keyword)
3335 CALL keyword_release(keyword)
3336
3337 CALL keyword_create(keyword, __location__, name="FLOQUET_BS_FILE_NAME", &
3338 description="File name used for the Floquet m=0 (central-sector) "// &
3339 "band structure.", &
3340 usage="FLOQUET_BS_FILE_NAME FLOQUET_BANDSTRUCTURE", &
3341 default_lc_val="FLOQUET_BANDSTRUCTURE")
3342 CALL section_add_keyword(section, keyword)
3343 CALL keyword_release(keyword)
3344
3345 CALL keyword_create(keyword, __location__, name="MEM_FILL_FRACTION", &
3346 description="Fraction of the computation memory that may be filled "// &
3347 "by Floquet Hamiltonian matrices. Reduce if process gets OOMP killed.", &
3348 usage="MEM_FILL_FRACTION 0.5", default_r_val=0.8_dp)
3349 CALL section_add_keyword(section, keyword)
3350 CALL keyword_release(keyword)
3351
3352 END SUBROUTINE create_floquet_section
3353
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public putrino2000
integer, save, public weber2009
integer, save, public kuhneheskeprodan2020
integer, save, public kondov2007
integer, save, public luber2014
integer, save, public iannuzzi2005
integer, save, public sebastiani2001
integer, save, public hernandez2025
integer, save, public putrino2002
integer, save, public vazdacruz2021
integer, save, public hanasaki2025
integer, save, public futera2017
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public debug_print_level
integer, parameter, public low_print_level
integer, parameter, public medium_print_level
integer, parameter, public high_print_level
integer, parameter, public add_last_numeric
integer, parameter, public silent_print_level
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str)
creates a print_key section
unit conversion facility
Definition cp_units.F:30
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Definition cp_units.F:1222
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public int_ldos_y
integer, parameter, public use_mom_ref_coac
integer, parameter, public tddfpt_dipole_berry
integer, parameter, public oe_saop
integer, parameter, public do_no_et
integer, parameter, public current_orb_center_wannier
integer, parameter, public scan_x
integer, parameter, public scan_xyz
integer, parameter, public use_mom_ref_user
integer, parameter, public tddfpt_sf_col
integer, parameter, public tddfpt_kernel_none
integer, parameter, public use_mom_ref_com
integer, parameter, public gto_cartesian
integer, parameter, public tddfpt_dipole_scf_moment
integer, parameter, public gto_spherical
integer, parameter, public current_gauge_atom
integer, parameter, public current_gauge_r
integer, parameter, public oe_none
integer, parameter, public ot_precond_full_kinetic
integer, parameter, public current_gauge_r_and_step_func
integer, parameter, public oe_shift
integer, parameter, public int_ldos_x
integer, parameter, public current_orb_center_box
integer, parameter, public tddfpt_dipole_velocity
integer, parameter, public current_orb_center_common
integer, parameter, public ot_precond_full_single
integer, parameter, public scan_xy
integer, parameter, public scan_xz
integer, parameter, public tddfpt_kernel_full
integer, parameter, public ot_precond_none
integer, parameter, public g0w0
integer, parameter, public scan_y
integer, parameter, public int_ldos_z
integer, parameter, public ot_precond_full_single_inverse
integer, parameter, public current_orb_center_atom
integer, parameter, public scan_z
integer, parameter, public tddfpt_sf_noncol
integer, parameter, public do_spin_density
integer, parameter, public evgw0
integer, parameter, public tddfpt_dipole_length
integer, parameter, public use_mom_ref_zero
integer, parameter, public oe_lb
integer, parameter, public tddfpt_kernel_stda
integer, parameter, public int_ldos_none
integer, parameter, public tddfpt_dipole_velocity_old
integer, parameter, public no_sf_tddfpt
integer, parameter, public do_et_ddapc
integer, parameter, public ot_precond_s_inverse
integer, parameter, public do_full_density
integer, parameter, public scan_yz
integer, parameter, public oe_gllb
integer, parameter, public ot_precond_full_all
input section for atomic properties
subroutine, public create_atprop_section(section)
Creates the ATOMIC section.
function that build the dft section of the input
subroutine, public create_mgrid_section(section, create_subsections)
creates the multigrid
subroutine, public create_interp_section(section)
creates the interpolation section
function that build the kpoints section of the input
subroutine, public create_kpoint_set_section(section, section_name)
...
subroutine, public create_localize_section(section)
parameters fo the localization of wavefunctions
function that build the dft section of the input
subroutine, public create_properties_section(section)
Create the PROPERTIES section.
function that build the QS section of the input
subroutine, public create_lrigpw_section(section)
input section for optional parameters for LRIGPW LRI: local resolution of identity
subroutine, public create_ddapc_restraint_section(section, section_name)
...
function that builds the resp section of the input
subroutine, public create_resp_section(section)
Creates the RESP section.
function that build the XAS section of the input
subroutine, public create_xas_tdp_section(section)
makes the input section for core-level spectroscopy simulations using linear response TDDFT
function that build the xc section of the input
subroutine, public create_xc_section(section)
creates the input section for the xc part
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations, deprecation_notice)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
subroutine, public section_add_subsection(section, subsection)
adds a subsection to the given section
recursive subroutine, public section_release(section)
releases the given keyword list (see doc/ReferenceCounting.html)
a wrapper for basic fortran types.
integer, parameter, public real_t
integer, parameter, public lchar_t
integer, parameter, public logical_t
integer, parameter, public char_t
integer, parameter, public integer_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Utilities for string manipulations.
represent a keyword in the input
represent a section of the input file