Line data Source code
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 : ! **************************************************************************************************
14 : MODULE input_cp2k_properties_dft
15 : USE bibliography, ONLY: Futera2017, &
16 : Hanasaki2025, &
17 : Hernandez2025, &
18 : Iannuzzi2005, &
19 : Kondov2007, &
20 : KuhneHeskeProdan2020, &
21 : Luber2014, &
22 : Putrino2000, &
23 : Putrino2002, &
24 : Sebastiani2001, &
25 : Weber2009, &
26 : VazdaCruz2021
27 : USE cp_output_handling, ONLY: add_last_numeric, &
28 : cp_print_key_section_create, &
29 : debug_print_level, &
30 : high_print_level, &
31 : low_print_level, &
32 : medium_print_level, &
33 : silent_print_level
34 : USE cp_units, ONLY: cp_unit_to_cp2k
35 : USE input_constants, ONLY: &
36 : current_gauge_atom, current_gauge_r, current_gauge_r_and_step_func, &
37 : current_orb_center_atom, current_orb_center_box, current_orb_center_common, &
38 : current_orb_center_wannier, do_et_ddapc, do_full_density, do_no_et, do_spin_density, &
39 : evGW0, G0W0, &
40 : gto_cartesian, gto_spherical, int_ldos_none, int_ldos_x, int_ldos_y, int_ldos_z, oe_gllb, &
41 : oe_lb, oe_none, oe_saop, oe_shift, ot_precond_full_all, ot_precond_full_kinetic, &
42 : ot_precond_full_single, ot_precond_full_single_inverse, ot_precond_none, &
43 : ot_precond_s_inverse, scan_x, scan_xy, scan_xyz, scan_xz, scan_y, scan_yz, scan_z, &
44 : tddfpt_dipole_berry, tddfpt_dipole_length, tddfpt_dipole_scf_moment, &
45 : tddfpt_dipole_velocity, tddfpt_dipole_velocity_old, tddfpt_kernel_full, tddfpt_kernel_none, &
46 : tddfpt_kernel_stda, no_sf_tddfpt, tddfpt_sf_col, tddfpt_sf_noncol, use_mom_ref_coac, &
47 : use_mom_ref_com, use_mom_ref_user, use_mom_ref_zero
48 : USE input_cp2k_atprop, ONLY: create_atprop_section
49 : USE input_cp2k_dft, ONLY: create_interp_section, &
50 : create_mgrid_section
51 : USE input_cp2k_qs, ONLY: create_ddapc_restraint_section, &
52 : create_lrigpw_section
53 : USE input_cp2k_kpoints, ONLY: create_kpoint_set_section
54 : USE input_cp2k_loc, ONLY: create_localize_section
55 : USE input_cp2k_resp, ONLY: create_resp_section
56 : USE input_cp2k_xc, ONLY: create_xc_section
57 : USE input_keyword_types, ONLY: keyword_create, &
58 : keyword_release, &
59 : keyword_type
60 : USE input_section_types, ONLY: section_add_keyword, &
61 : section_add_subsection, &
62 : section_create, &
63 : section_release, &
64 : section_type
65 : USE input_val_types, ONLY: char_t, &
66 : integer_t, &
67 : lchar_t, &
68 : logical_t, &
69 : real_t
70 : USE input_cp2k_xas, ONLY: create_xas_tdp_section
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 :
81 : PUBLIC :: create_properties_section
82 :
83 : CONTAINS
84 :
85 : ! **************************************************************************************************
86 : !> \brief Create the PROPERTIES section
87 : !> \param section the section to create
88 : !> \author teo
89 : ! **************************************************************************************************
90 10850 : 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 10850 : 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 10850 : n_keywords=0, n_subsections=6, repeats=.FALSE.)
100 :
101 10850 : NULLIFY (subsection, keyword)
102 :
103 10850 : CALL create_linres_section(subsection, create_subsections=.TRUE.)
104 10850 : CALL section_add_subsection(section, subsection)
105 10850 : CALL section_release(subsection)
106 :
107 10850 : CALL create_et_coupling_section(subsection)
108 10850 : CALL section_add_subsection(section, subsection)
109 10850 : CALL section_release(subsection)
110 :
111 10850 : CALL create_resp_section(subsection)
112 10850 : CALL section_add_subsection(section, subsection)
113 10850 : CALL section_release(subsection)
114 :
115 10850 : CALL create_atprop_section(subsection)
116 10850 : CALL section_add_subsection(section, subsection)
117 10850 : 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 10850 : 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 10850 : default_i_val=do_full_density)
130 10850 : CALL section_add_keyword(subsection, keyword)
131 10850 : CALL keyword_release(keyword)
132 10850 : CALL section_add_subsection(section, subsection)
133 10850 : CALL section_release(subsection)
134 :
135 10850 : CALL create_tddfpt2_section(subsection)
136 10850 : CALL section_add_subsection(section, subsection)
137 10850 : CALL section_release(subsection)
138 :
139 10850 : CALL create_rixs_section(subsection)
140 10850 : CALL section_add_subsection(section, subsection)
141 10850 : CALL section_release(subsection)
142 :
143 10850 : CALL create_kubo_transport_section(subsection)
144 10850 : CALL section_add_subsection(section, subsection)
145 10850 : CALL section_release(subsection)
146 :
147 10850 : CALL create_bandstructure_section(subsection)
148 10850 : CALL section_add_subsection(section, subsection)
149 10850 : CALL section_release(subsection)
150 :
151 10850 : CALL create_tipscan_section(subsection)
152 10850 : CALL section_add_subsection(section, subsection)
153 10850 : CALL section_release(subsection)
154 :
155 10850 : END SUBROUTINE create_properties_section
156 :
157 : ! **************************************************************************************************
158 : !> \brief creates the input structure used to activate finite-volume Kubo transport
159 : ! **************************************************************************************************
160 :
161 10850 : SUBROUTINE create_kubo_transport_section(section)
162 : TYPE(section_type), POINTER :: section
163 : TYPE(keyword_type), POINTER :: keyword
164 :
165 10850 : CPASSERT(.NOT. ASSOCIATED(section))
166 :
167 10850 : 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 21700 : 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 10850 : lone_keyword_l_val=.TRUE.)
181 10850 : CALL section_add_keyword(section, keyword)
182 10850 : 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 10850 : n_var=1, type_of_var=char_t, default_c_val="DIAGONALIZATION")
190 10850 : CALL section_add_keyword(section, keyword)
191 10850 : 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 10850 : n_var=1, type_of_var=real_t, unit_str="K")
198 10850 : CALL section_add_keyword(section, keyword)
199 10850 : 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 10850 : n_var=1, type_of_var=real_t, unit_str="K")
207 10850 : CALL section_add_keyword(section, keyword)
208 10850 : 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 10850 : unit_str="hartree")
216 10850 : CALL section_add_keyword(section, keyword)
217 10850 : 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 10850 : n_var=1, type_of_var=real_t, unit_str="hartree")
224 10850 : CALL section_add_keyword(section, keyword)
225 10850 : 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 10850 : default_i_val=200, n_var=1, type_of_var=integer_t)
231 10850 : CALL section_add_keyword(section, keyword)
232 10850 : 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 10850 : default_i_val=10000, n_var=1, type_of_var=integer_t)
238 10850 : CALL section_add_keyword(section, keyword)
239 10850 : CALL keyword_release(keyword)
240 :
241 10850 : 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 10850 : 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 10850 : CPASSERT(.NOT. ASSOCIATED(section))
254 :
255 10850 : 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 21700 : 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 10850 : lone_keyword_l_val=.TRUE.)
267 10850 : CALL section_add_keyword(section, keyword)
268 10850 : 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 10850 : n_var=1, type_of_var=integer_t, default_i_val=-1)
275 10850 : CALL section_add_keyword(section, keyword)
276 10850 : 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 10850 : n_var=1, type_of_var=integer_t, default_i_val=-1)
284 10850 : CALL section_add_keyword(section, keyword)
285 10850 : CALL keyword_release(keyword)
286 :
287 10850 : CALL create_tddfpt2_section(subsection)
288 10850 : CALL section_add_subsection(section, subsection)
289 10850 : CALL section_release(subsection)
290 :
291 10850 : CALL create_xas_tdp_section(subsection)
292 10850 : CALL section_add_subsection(section, subsection)
293 10850 : CALL section_release(subsection)
294 :
295 : CALL section_create(subsection, __LOCATION__, "PRINT", "Controls the printing of information "// &
296 10850 : "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 10850 : common_iter_levels=3)
303 10850 : CALL section_add_subsection(subsection, print_key)
304 10850 : CALL section_release(print_key)
305 :
306 10850 : CALL section_add_subsection(section, subsection)
307 10850 : CALL section_release(subsection)
308 :
309 10850 : 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 32550 : 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 32550 : NULLIFY (keyword, print_key)
333 :
334 32550 : IF (PRESENT(default_set_tdlr)) THEN
335 21700 : def_egap = 0.02_dp
336 21700 : def_eps = 1.0e-10_dp
337 21700 : def_eps_filter = 1.0e-15_dp
338 21700 : def_max_iter = 100
339 21700 : def_precond = ot_precond_full_single_inverse
340 21700 : desc = "Controls the parameters of the LINRES force calculations for excited states."
341 : ELSE
342 10850 : def_egap = 0.2_dp
343 10850 : def_eps = 1.e-6_dp
344 10850 : def_eps_filter = 0.0_dp
345 10850 : def_max_iter = 50
346 10850 : def_precond = ot_precond_none
347 10850 : desc = "The linear response is used to calculate one of the following properties: nmr, epr, raman, ..."
348 : END IF
349 :
350 32550 : CPASSERT(.NOT. ASSOCIATED(section))
351 : CALL section_create(section, __LOCATION__, name="linres", &
352 : description=desc, n_keywords=5, n_subsections=2, repeats=.FALSE., &
353 65100 : citations=[Putrino2000])
354 :
355 : CALL keyword_create(keyword, __LOCATION__, name="EPS", &
356 : description="target accuracy for the convergence of the conjugate gradient.", &
357 32550 : usage="EPS 1.e-6", default_r_val=def_eps)
358 32550 : CALL section_add_keyword(section, keyword)
359 32550 : CALL keyword_release(keyword)
360 :
361 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
362 : description="Filter threshold for response density matrix.", &
363 32550 : usage="EPS_FILTER 1.e-8", default_r_val=def_eps_filter)
364 32550 : CALL section_add_keyword(section, keyword)
365 32550 : 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 32550 : usage="MAX_ITER 200", default_i_val=def_max_iter)
370 32550 : CALL section_add_keyword(section, keyword)
371 32550 : 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 32550 : usage="RESTART_EVERY 200", default_i_val=50)
376 32550 : CALL section_add_keyword(section, keyword)
377 32550 : 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"), &
400 : enum_i_vals=[ot_precond_full_all, ot_precond_full_single_inverse, ot_precond_full_single, &
401 32550 : ot_precond_full_kinetic, ot_precond_s_inverse, ot_precond_none])
402 32550 : CALL section_add_keyword(section, keyword)
403 32550 : 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 32550 : default_r_val=def_egap)
409 32550 : CALL section_add_keyword(section, keyword)
410 32550 : 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 32550 : usage="EVERY_N_STEP 50", default_i_val=1)
415 32550 : CALL section_add_keyword(section, keyword)
416 32550 : 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 32550 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
422 32550 : CALL section_add_keyword(section, keyword)
423 32550 : 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 65100 : type_of_var=lchar_t)
431 32550 : CALL section_add_keyword(section, keyword)
432 32550 : CALL keyword_release(keyword)
433 :
434 32550 : IF (create_subsections) THEN
435 10850 : NULLIFY (subsection)
436 :
437 10850 : CALL create_localize_section(subsection)
438 10850 : CALL section_add_subsection(section, subsection)
439 10850 : CALL section_release(subsection)
440 :
441 10850 : CALL create_current_section(subsection)
442 10850 : CALL section_add_subsection(section, subsection)
443 10850 : CALL section_release(subsection)
444 :
445 10850 : CALL create_nmr_section(subsection)
446 10850 : CALL section_add_subsection(section, subsection)
447 10850 : CALL section_release(subsection)
448 :
449 10850 : CALL create_spin_spin_section(subsection)
450 10850 : CALL section_add_subsection(section, subsection)
451 10850 : CALL section_release(subsection)
452 :
453 10850 : CALL create_epr_section(subsection)
454 10850 : CALL section_add_subsection(section, subsection)
455 10850 : CALL section_release(subsection)
456 :
457 10850 : CALL create_polarizability_section(subsection)
458 10850 : CALL section_add_subsection(section, subsection)
459 10850 : CALL section_release(subsection)
460 :
461 10850 : CALL create_dcdr_section(subsection)
462 10850 : CALL section_add_subsection(section, subsection)
463 10850 : CALL section_release(subsection)
464 :
465 10850 : CALL create_vcd_section(subsection)
466 10850 : CALL section_add_subsection(section, subsection)
467 10850 : CALL section_release(subsection)
468 :
469 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
470 : description="printing of information during the linear response calculation", &
471 10850 : repeats=.FALSE.)
472 :
473 : CALL cp_print_key_section_create( &
474 : print_key, __LOCATION__, "program_run_info", &
475 : description="Controls the printing of basic iteration information during the LINRES calculation", &
476 10850 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
477 10850 : CALL section_add_subsection(subsection, print_key)
478 10850 : 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 10850 : add_last=add_last_numeric, each_iter_values=[3], filename="")
488 10850 : CALL section_add_subsection(subsection, print_key)
489 10850 : CALL section_release(print_key)
490 :
491 10850 : CALL section_add_subsection(section, subsection)
492 10850 : CALL section_release(subsection)
493 :
494 : END IF
495 :
496 32550 : 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 10850 : 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 10850 : failure = .FALSE.
513 10850 : NULLIFY (keyword, print_key, subsection)
514 :
515 10850 : 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 10850 : 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 10850 : lone_keyword_l_val=.TRUE.)
529 10850 : CALL section_add_keyword(section, keyword)
530 10850 : 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 10850 : n_var=-1, type_of_var=integer_t)
536 10850 : CALL section_add_keyword(section, keyword)
537 10850 : 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 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
544 10850 : CALL section_add_keyword(section, keyword)
545 10850 : 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."), &
556 : enum_i_vals=[current_orb_center_wannier, current_orb_center_common, &
557 10850 : current_orb_center_atom, current_orb_center_box])
558 10850 : CALL section_add_keyword(section, keyword)
559 10850 : 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, &
569 : use_mom_ref_coac, &
570 : use_mom_ref_user, &
571 : use_mom_ref_zero], &
572 10850 : default_i_val=use_mom_ref_zero)
573 10850 : CALL section_add_keyword(section, keyword)
574 10850 : 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 10850 : repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
580 10850 : CALL section_add_keyword(section, keyword)
581 10850 : 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 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
587 10850 : CALL section_add_keyword(section, keyword)
588 10850 : 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 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
596 10850 : CALL section_add_keyword(section, keyword)
597 10850 : 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 10850 : usage="APT_FD_DE 1.0E-4")
606 10850 : CALL section_add_keyword(section, keyword)
607 10850 : 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 10850 : enum_i_vals=[1])
620 10850 : CALL section_add_keyword(section, keyword)
621 10850 : CALL keyword_release(keyword)
622 :
623 10850 : NULLIFY (subsection)
624 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
625 : description="print results of the magnetic dipole moment calculation", &
626 10850 : 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 10850 : print_level=low_print_level, add_last=add_last_numeric, filename="")
631 10850 : CALL section_add_subsection(subsection, print_key)
632 10850 : CALL section_release(print_key)
633 :
634 10850 : CALL section_add_subsection(section, subsection)
635 10850 : CALL section_release(subsection)
636 :
637 10850 : NULLIFY (subsection)
638 10850 : CALL create_interp_section(subsection)
639 10850 : CALL section_add_subsection(section, subsection)
640 10850 : CALL section_release(subsection)
641 :
642 : END IF
643 :
644 10850 : 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 10850 : 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 10850 : NULLIFY (keyword, print_key, subsection)
660 :
661 10850 : CPASSERT(.NOT. ASSOCIATED(section))
662 :
663 : CALL section_create(section, __LOCATION__, name="VCD", &
664 : description="Carry out a VCD calculation.", &
665 10850 : 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 10850 : lone_keyword_l_val=.TRUE.)
672 10850 : CALL section_add_keyword(section, keyword)
673 10850 : 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 10850 : n_var=-1, type_of_var=integer_t)
679 10850 : CALL section_add_keyword(section, keyword)
680 10850 : 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 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
687 10850 : CALL section_add_keyword(section, keyword)
688 10850 : 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 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
694 10850 : CALL section_add_keyword(section, keyword)
695 10850 : 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."), &
706 : enum_i_vals=[current_orb_center_wannier, current_orb_center_common, &
707 10850 : current_orb_center_atom, current_orb_center_box])
708 10850 : CALL section_add_keyword(section, keyword)
709 10850 : 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, &
720 : use_mom_ref_coac, &
721 : use_mom_ref_user, &
722 : use_mom_ref_zero], &
723 10850 : default_i_val=use_mom_ref_zero)
724 10850 : CALL section_add_keyword(section, keyword)
725 10850 : 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 10850 : repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
731 10850 : CALL section_add_keyword(section, keyword)
732 10850 : 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, &
743 : use_mom_ref_coac, &
744 : use_mom_ref_user, &
745 : use_mom_ref_zero], &
746 10850 : default_i_val=use_mom_ref_zero)
747 10850 : CALL section_add_keyword(section, keyword)
748 10850 : 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 10850 : repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
754 10850 : CALL section_add_keyword(section, keyword)
755 10850 : CALL keyword_release(keyword)
756 :
757 10850 : NULLIFY (subsection)
758 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
759 : description="print results of the magnetic dipole moment calculation", &
760 10850 : 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 10850 : print_level=low_print_level, add_last=add_last_numeric, filename="")
765 10850 : CALL section_add_subsection(subsection, print_key)
766 10850 : CALL section_release(print_key)
767 :
768 10850 : CALL section_add_subsection(section, subsection)
769 10850 : CALL section_release(subsection)
770 :
771 10850 : NULLIFY (subsection)
772 10850 : CALL create_interp_section(subsection)
773 10850 : CALL section_add_subsection(section, subsection)
774 10850 : CALL section_release(subsection)
775 :
776 10850 : 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 10850 : 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 10850 : NULLIFY (keyword, print_key, subsection)
792 :
793 10850 : 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 32550 : 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 10850 : lone_keyword_l_val=.TRUE.)
804 10850 : CALL section_add_keyword(section, keyword)
805 10850 : 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."), &
815 10850 : enum_i_vals=[current_gauge_r, current_gauge_r_and_step_func, current_gauge_atom])
816 10850 : CALL section_add_keyword(section, keyword)
817 10850 : 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 10850 : unit_str="angstrom")
825 10850 : CALL section_add_keyword(section, keyword)
826 10850 : 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 10850 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
832 10850 : CALL section_add_keyword(section, keyword)
833 10850 : 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."), &
844 : enum_i_vals=[current_orb_center_wannier, current_orb_center_common, &
845 10850 : current_orb_center_atom, current_orb_center_box])
846 10850 : CALL section_add_keyword(section, keyword)
847 10850 : 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 10850 : unit_str="angstrom")
853 10850 : CALL section_add_keyword(section, keyword)
854 10850 : 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 10850 : n_var=3, default_i_vals=[4, 4, 4], type_of_var=integer_t)
859 10850 : CALL section_add_keyword(section, keyword)
860 10850 : 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 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
866 10850 : CALL section_add_keyword(section, keyword)
867 10850 : 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 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
874 10850 : CALL section_add_keyword(section, keyword)
875 10850 : 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 10850 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
882 10850 : CALL section_add_keyword(section, keyword)
883 10850 : 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 10850 : unit_str="angstrom")
892 10850 : CALL section_add_keyword(section, keyword)
893 10850 : 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 10850 : lone_keyword_l_val=.TRUE.)
900 10850 : CALL section_add_keyword(section, keyword)
901 10850 : CALL keyword_release(keyword)
902 :
903 10850 : NULLIFY (subsection)
904 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
905 : description="print results of induced current density calculation", &
906 10850 : 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 10850 : 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 10850 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
916 10850 : CALL section_add_keyword(print_key, keyword)
917 10850 : CALL keyword_release(keyword)
918 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
919 : description="append the cube files when they already exist", &
920 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
921 10850 : CALL section_add_keyword(print_key, keyword)
922 10850 : CALL keyword_release(keyword)
923 :
924 10850 : CALL section_add_subsection(subsection, print_key)
925 10850 : 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 10850 : 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 10850 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
935 10850 : CALL section_add_keyword(print_key, keyword)
936 10850 : 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 21700 : n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
943 10850 : CALL section_add_keyword(print_key, keyword)
944 10850 : 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 10850 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
952 10850 : CALL section_add_keyword(print_key, keyword)
953 10850 : CALL keyword_release(keyword)
954 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
955 : description="append the cube files when they already exist", &
956 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
957 10850 : CALL section_add_keyword(print_key, keyword)
958 10850 : CALL keyword_release(keyword)
959 :
960 10850 : CALL section_add_subsection(subsection, print_key)
961 10850 : CALL section_release(print_key)
962 :
963 10850 : CALL section_add_subsection(section, subsection)
964 10850 : CALL section_release(subsection)
965 :
966 10850 : NULLIFY (subsection)
967 10850 : CALL create_interp_section(subsection)
968 10850 : CALL section_add_subsection(section, subsection)
969 10850 : CALL section_release(subsection)
970 :
971 10850 : 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 10850 : 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 10850 : NULLIFY (keyword, print_key, subsection)
988 :
989 10850 : 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 21700 : 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 10850 : lone_keyword_l_val=.TRUE.)
1000 10850 : CALL section_add_keyword(section, keyword)
1001 10850 : 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 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1007 10850 : CALL section_add_keyword(section, keyword)
1008 10850 : 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 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1014 10850 : CALL section_add_keyword(section, keyword)
1015 10850 : 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 10850 : default_lc_val="nics_file")
1021 10850 : CALL section_add_keyword(section, keyword)
1022 10850 : 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 10850 : lone_keyword_l_val=.TRUE.)
1028 10850 : CALL section_add_keyword(section, keyword)
1029 10850 : 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 10850 : unit_str="angstrom")
1038 10850 : CALL section_add_keyword(section, keyword)
1039 10850 : CALL keyword_release(keyword)
1040 :
1041 10850 : NULLIFY (subsection)
1042 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1043 : description="print results of nmr calculation", &
1044 10850 : 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 10850 : 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 10850 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1054 10850 : CALL section_add_keyword(print_key, keyword)
1055 10850 : 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 21700 : n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
1062 10850 : CALL section_add_keyword(print_key, keyword)
1063 10850 : 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 10850 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
1071 10850 : CALL section_add_keyword(print_key, keyword)
1072 10850 : CALL keyword_release(keyword)
1073 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1074 : description="append the cube files when they already exist", &
1075 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1076 10850 : CALL section_add_keyword(print_key, keyword)
1077 10850 : CALL keyword_release(keyword)
1078 :
1079 10850 : CALL section_add_subsection(subsection, print_key)
1080 10850 : 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 10850 : print_level=high_print_level, add_last=add_last_numeric, filename="")
1085 10850 : CALL section_add_subsection(subsection, print_key)
1086 10850 : 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 10850 : 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 21700 : n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
1097 10850 : CALL section_add_keyword(print_key, keyword)
1098 10850 : 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 10850 : type_of_var=integer_t, repeats=.TRUE.)
1104 10850 : CALL section_add_keyword(print_key, keyword)
1105 10850 : CALL keyword_release(keyword)
1106 :
1107 10850 : CALL section_add_subsection(subsection, print_key)
1108 10850 : CALL section_release(print_key)
1109 :
1110 10850 : CALL section_add_subsection(section, subsection)
1111 10850 : CALL section_release(subsection)
1112 :
1113 10850 : NULLIFY (subsection)
1114 10850 : CALL create_interp_section(subsection)
1115 10850 : CALL section_add_subsection(section, subsection)
1116 10850 : CALL section_release(subsection)
1117 :
1118 10850 : 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 10850 : 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 10850 : NULLIFY (keyword, print_key, subsection)
1134 :
1135 10850 : CPASSERT(.NOT. ASSOCIATED(section))
1136 : CALL section_create(section, __LOCATION__, name="spinspin", &
1137 : description="Compute indirect spin-spin coupling constants.", &
1138 10850 : 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 10850 : lone_keyword_l_val=.TRUE.)
1145 10850 : CALL section_add_keyword(section, keyword)
1146 10850 : 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 10850 : lone_keyword_l_val=.TRUE.)
1152 10850 : CALL section_add_keyword(section, keyword)
1153 10850 : 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 10850 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
1159 10850 : CALL section_add_keyword(section, keyword)
1160 10850 : 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 10850 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1166 10850 : CALL section_add_keyword(section, keyword)
1167 10850 : 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 10850 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1173 10850 : CALL section_add_keyword(section, keyword)
1174 10850 : 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 10850 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1180 10850 : CALL section_add_keyword(section, keyword)
1181 10850 : 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 10850 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1187 10850 : CALL section_add_keyword(section, keyword)
1188 10850 : CALL keyword_release(keyword)
1189 :
1190 10850 : NULLIFY (subsection)
1191 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1192 : description="print results of the indirect spin-spin calculation", &
1193 10850 : 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 10850 : 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 10850 : type_of_var=integer_t, repeats=.TRUE.)
1203 10850 : CALL section_add_keyword(print_key, keyword)
1204 10850 : CALL keyword_release(keyword)
1205 :
1206 10850 : CALL section_add_subsection(subsection, print_key)
1207 10850 : CALL section_release(print_key)
1208 :
1209 10850 : CALL section_add_subsection(section, subsection)
1210 10850 : CALL section_release(subsection)
1211 :
1212 10850 : NULLIFY (subsection)
1213 10850 : CALL create_interp_section(subsection)
1214 10850 : CALL section_add_subsection(section, subsection)
1215 10850 : CALL section_release(subsection)
1216 :
1217 10850 : 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 10850 : 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 10850 : NULLIFY (keyword, print_key, subsection, subsubsection)
1234 :
1235 10850 : 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 21700 : 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 10850 : lone_keyword_l_val=.TRUE.)
1246 10850 : CALL section_add_keyword(section, keyword)
1247 10850 : 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 10850 : lone_keyword_l_val=.TRUE.)
1253 10850 : CALL section_add_keyword(section, keyword)
1254 10850 : CALL keyword_release(keyword)
1255 :
1256 10850 : NULLIFY (subsection)
1257 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1258 : description="print results of epr calculation", &
1259 10850 : 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 10850 : 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 10850 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1269 10850 : CALL section_add_keyword(print_key, keyword)
1270 10850 : CALL keyword_release(keyword)
1271 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1272 : description="append the cube files when they already exist", &
1273 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1274 10850 : CALL section_add_keyword(print_key, keyword)
1275 10850 : CALL keyword_release(keyword)
1276 :
1277 10850 : CALL section_add_subsection(subsection, print_key)
1278 10850 : 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 10850 : print_level=high_print_level, add_last=add_last_numeric, filename="")
1283 10850 : CALL create_xc_section(subsubsection)
1284 10850 : CALL section_add_subsection(print_key, subsubsection)
1285 10850 : 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 10850 : usage="GAPW_MAX_ALPHA real", default_r_val=5.0_dp)
1290 10850 : CALL section_add_keyword(print_key, keyword)
1291 10850 : 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 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1297 10850 : CALL section_add_keyword(print_key, keyword)
1298 10850 : CALL keyword_release(keyword)
1299 :
1300 10850 : CALL section_add_subsection(subsection, print_key)
1301 10850 : 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 10850 : 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 10850 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1311 10850 : CALL section_add_keyword(print_key, keyword)
1312 10850 : 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 21700 : n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
1319 10850 : CALL section_add_keyword(print_key, keyword)
1320 10850 : 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 10850 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
1328 10850 : CALL section_add_keyword(print_key, keyword)
1329 10850 : CALL keyword_release(keyword)
1330 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1331 : description="append the cube files when they already exist", &
1332 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1333 10850 : CALL section_add_keyword(print_key, keyword)
1334 10850 : CALL keyword_release(keyword)
1335 :
1336 10850 : CALL section_add_subsection(subsection, print_key)
1337 10850 : CALL section_release(print_key)
1338 :
1339 10850 : CALL section_add_subsection(section, subsection)
1340 10850 : CALL section_release(subsection)
1341 :
1342 10850 : NULLIFY (subsection)
1343 10850 : CALL create_interp_section(subsection)
1344 10850 : CALL section_add_subsection(section, subsection)
1345 10850 : CALL section_release(subsection)
1346 :
1347 10850 : 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 10850 : 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 10850 : NULLIFY (keyword, print_key, subsection)
1364 :
1365 10850 : 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 21700 : 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 10850 : lone_keyword_l_val=.TRUE.)
1376 10850 : CALL section_add_keyword(section, keyword)
1377 10850 : 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 21700 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1384 10850 : CALL section_add_keyword(section, keyword)
1385 10850 : 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 10850 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1391 10850 : CALL section_add_keyword(section, keyword)
1392 10850 : CALL keyword_release(keyword)
1393 :
1394 10850 : NULLIFY (subsection)
1395 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1396 : description="print results of the polarizability calculation", &
1397 10850 : repeats=.FALSE.)
1398 :
1399 : CALL cp_print_key_section_create(print_key, __LOCATION__, "POLAR_MATRIX", &
1400 : description="Controls the printing of the polarizabilities", &
1401 10850 : print_level=low_print_level, add_last=add_last_numeric, filename="")
1402 :
1403 10850 : CALL section_add_subsection(subsection, print_key)
1404 10850 : CALL section_release(print_key)
1405 10850 : CALL section_add_subsection(section, subsection)
1406 10850 : CALL section_release(subsection)
1407 :
1408 10850 : NULLIFY (subsection)
1409 10850 : CALL create_interp_section(subsection)
1410 10850 : CALL section_add_subsection(section, subsection)
1411 10850 : CALL section_release(subsection)
1412 :
1413 10850 : END SUBROUTINE create_polarizability_section
1414 :
1415 : ! **************************************************************************************************
1416 : !> \brief creates the section for electron transfer coupling
1417 : !> \param section ...
1418 : !> \author fschiff
1419 : ! **************************************************************************************************
1420 10850 : 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 10850 : NULLIFY (keyword)
1427 10850 : 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 32550 : n_keywords=1, n_subsections=4, repeats=.FALSE., citations=[Kondov2007, Futera2017])
1431 :
1432 10850 : NULLIFY (subsection)
1433 10850 : CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_A")
1434 10850 : CALL section_add_subsection(section, subsection)
1435 10850 : CALL section_release(subsection)
1436 :
1437 10850 : NULLIFY (subsection)
1438 10850 : CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_B")
1439 10850 : CALL section_add_subsection(section, subsection)
1440 10850 : CALL section_release(subsection)
1441 :
1442 10850 : NULLIFY (subsection)
1443 10850 : CALL create_projection(subsection, "PROJECTION")
1444 10850 : CALL section_add_subsection(section, subsection)
1445 10850 : 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 10850 : default_i_val=do_no_et)
1454 10850 : CALL section_add_keyword(section, keyword)
1455 10850 : CALL keyword_release(keyword)
1456 :
1457 10850 : 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 10850 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
1461 10850 : CALL section_add_subsection(section, print_key)
1462 10850 : CALL section_release(print_key)
1463 :
1464 10850 : 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 10850 : 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 0 : CPASSERT(.NOT. ASSOCIATED(section))
1486 :
1487 : ! Initialization
1488 10850 : NULLIFY (keyword)
1489 10850 : NULLIFY (print_key)
1490 10850 : NULLIFY (section_block)
1491 10850 : 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 10850 : 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 10850 : print_level=low_print_level, filename="__STD_OUT__")
1502 10850 : CALL section_add_subsection(section, print_key)
1503 10850 : 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 10850 : n_keywords=2, n_subsections=1, repeats=.TRUE.)
1509 10850 : 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 10850 : n_var=-1, type_of_var=integer_t, repeats=.FALSE.)
1516 10850 : CALL section_add_keyword(section_block, keyword)
1517 10850 : 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 10850 : usage="NELECTRON {integer}", default_i_val=0)
1523 10850 : CALL section_add_keyword(section_block, keyword)
1524 10850 : 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 10850 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
1530 10850 : 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 10850 : type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
1537 10850 : CALL section_add_keyword(section_print, keyword)
1538 10850 : 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 10850 : type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
1545 10850 : CALL section_add_keyword(section_print, keyword)
1546 10850 : 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 10850 : 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 10850 : default_i_vals=[2, 2, 2], type_of_var=integer_t)
1558 10850 : CALL section_add_keyword(print_key, keyword)
1559 10850 : 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 10850 : type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
1566 10850 : CALL section_add_keyword(print_key, keyword)
1567 10850 : 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 10850 : usage="NLUMO {integer}", default_i_val=1)
1573 10850 : CALL section_add_keyword(print_key, keyword)
1574 10850 : 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 10850 : usage="NHOMO {integer}", default_i_val=1)
1580 10850 : CALL section_add_keyword(print_key, keyword)
1581 10850 : CALL keyword_release(keyword)
1582 :
1583 10850 : CALL section_add_subsection(section_print, print_key)
1584 10850 : CALL section_release(print_key)
1585 :
1586 : ! S#1 - S#1 - Clean
1587 10850 : CALL section_release(section_print)
1588 :
1589 : ! S#1 - Clean
1590 10850 : 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 10850 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
1596 10850 : 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 10850 : 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 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1606 10850 : CALL section_add_keyword(print_key, keyword)
1607 10850 : CALL keyword_release(keyword)
1608 :
1609 10850 : CALL section_add_subsection(section_print, print_key)
1610 10850 : CALL section_release(print_key)
1611 :
1612 10850 : CALL section_release(section_print)
1613 :
1614 10850 : 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 21700 : 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 21700 : 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., &
1634 86800 : citations=[Iannuzzi2005, Hanasaki2025, Hernandez2025])
1635 :
1636 21700 : 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 21700 : lone_keyword_l_val=.TRUE.)
1643 21700 : CALL section_add_keyword(section, keyword)
1644 21700 : 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 21700 : default_i_val=1)
1651 21700 : CALL section_add_keyword(section, keyword)
1652 21700 : 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 21700 : default_i_val=50)
1658 21700 : CALL section_add_keyword(section, keyword)
1659 21700 : 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 21700 : default_i_val=5000)
1666 21700 : CALL section_add_keyword(section, keyword)
1667 21700 : 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 21700 : default_i_val=-1)
1674 21700 : CALL section_add_keyword(section, keyword)
1675 21700 : 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 21700 : default_i_val=0)
1682 21700 : CALL section_add_keyword(section, keyword)
1683 21700 : 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"), &
1690 : enum_i_vals=[tddfpt_kernel_full, tddfpt_kernel_stda, tddfpt_kernel_none], &
1691 21700 : default_i_val=tddfpt_kernel_full)
1692 21700 : CALL section_add_keyword(section, keyword)
1693 21700 : 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"), &
1700 : enum_i_vals=[no_sf_tddfpt, tddfpt_sf_col, tddfpt_sf_noncol], &
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 43400 : default_i_val=no_sf_tddfpt, citations=[Hernandez2025])
1708 21700 : CALL section_add_keyword(section, keyword)
1709 21700 : 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 21700 : default_i_val=oe_none)
1721 21700 : CALL section_add_keyword(section, keyword)
1722 21700 : 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 21700 : default_r_val=0.0_dp)
1732 21700 : CALL section_add_keyword(section, keyword)
1733 21700 : 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 21700 : default_r_val=0.0_dp)
1742 21700 : CALL section_add_keyword(section, keyword)
1743 21700 : 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 21700 : default_r_val=1.0e-5_dp)
1750 21700 : CALL section_add_keyword(section, keyword)
1751 21700 : 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 21700 : default_r_val=5.0e-2_dp)
1757 21700 : CALL section_add_keyword(section, keyword)
1758 21700 : 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 21700 : default_r_val=1.0e-4_dp)
1767 21700 : CALL section_add_keyword(section, keyword)
1768 21700 : 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 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1775 21700 : CALL section_add_keyword(section, keyword)
1776 21700 : 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 21700 : default_l_val=.FALSE.)
1782 21700 : CALL section_add_keyword(section, keyword)
1783 21700 : 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 21700 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1790 21700 : CALL section_add_keyword(section, keyword)
1791 21700 : 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 21700 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1798 21700 : CALL section_add_keyword(section, keyword)
1799 21700 : 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 21700 : default_l_val=.FALSE.)
1805 21700 : CALL section_add_keyword(section, keyword)
1806 21700 : 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 65100 : type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=["X", "X"])
1818 21700 : CALL section_add_keyword(section, keyword)
1819 21700 : 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 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1825 21700 : CALL section_add_keyword(section, keyword)
1826 21700 : 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 21700 : default_l_val=.FALSE.)
1833 21700 : CALL section_add_keyword(section, keyword)
1834 21700 : 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 21700 : default_l_val=.FALSE.)
1840 21700 : CALL section_add_keyword(section, keyword)
1841 21700 : CALL keyword_release(keyword)
1842 :
1843 : ! Strings
1844 : CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
1845 : variants=["RESTART_FILE_NAME"], &
1846 : description="Name of the wave function restart file, may include a path."// &
1847 : " If no file is specified, the default is to open the file as generated by"// &
1848 : " the wave function restart print key.", &
1849 : usage="WFN_RESTART_FILE_NAME <FILENAME>", &
1850 43400 : type_of_var=lchar_t)
1851 21700 : CALL section_add_keyword(section, keyword)
1852 21700 : CALL keyword_release(keyword)
1853 :
1854 : ! DIPOLE subsection
1855 : CALL section_create(subsection, __LOCATION__, name="DIPOLE_MOMENTS", &
1856 : description="Parameters to compute oscillator strengths in the dipole approximation.", &
1857 21700 : n_keywords=3, n_subsections=0, repeats=.FALSE.)
1858 :
1859 : CALL keyword_create(keyword, __LOCATION__, name="DIPOLE_FORM", &
1860 : description="Form of dipole transition integrals.", &
1861 : enum_c_vals=s2a("BERRY", "LENGTH", "VELOCITY", "VELOCITY_OLD", &
1862 : "SCF_MOMENT"), &
1863 : enum_desc=s2a("Based on Berry phase formula (valid for fully periodic molecular systems only)", &
1864 : "Length form ⟨ i | r | j ⟩ (valid for non-periodic molecular systems only)", &
1865 : "Velocity form ⟨ i | d/dr | j ⟩", &
1866 : "Old velocity form ⟨ i | d/dr | j ⟩", &
1867 : "SCF molecular-orbital moment form for k-point TDDFPT"), &
1868 : enum_i_vals=[tddfpt_dipole_berry, tddfpt_dipole_length, &
1869 : tddfpt_dipole_velocity, tddfpt_dipole_velocity_old, &
1870 : tddfpt_dipole_scf_moment], &
1871 21700 : default_i_val=tddfpt_dipole_velocity)
1872 21700 : CALL section_add_keyword(subsection, keyword)
1873 21700 : CALL keyword_release(keyword)
1874 :
1875 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
1876 : description="Reference point to calculate electric "// &
1877 : "dipole moments using the dipole integrals in the length form.", &
1878 : enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1879 : enum_desc=s2a("Use Center of Mass", &
1880 : "Use Center of Atomic Charges", &
1881 : "Use User-defined Point", &
1882 : "Use Origin of Coordinate System"), &
1883 : enum_i_vals=[use_mom_ref_com, &
1884 : use_mom_ref_coac, &
1885 : use_mom_ref_user, &
1886 : use_mom_ref_zero], &
1887 21700 : default_i_val=use_mom_ref_com)
1888 21700 : CALL section_add_keyword(subsection, keyword)
1889 21700 : CALL keyword_release(keyword)
1890 :
1891 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
1892 : description="User-defined reference point.", &
1893 : usage="REFERENCE_POINT x y z", &
1894 21700 : repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
1895 21700 : CALL section_add_keyword(subsection, keyword)
1896 21700 : CALL keyword_release(keyword)
1897 :
1898 21700 : CALL section_add_subsection(section, subsection)
1899 21700 : CALL section_release(subsection)
1900 :
1901 : ! SOC functional
1902 :
1903 : CALL section_create(subsection, __LOCATION__, name="SOC", &
1904 : description="Is jet to be implemented", &
1905 21700 : n_keywords=2, n_subsections=0, repeats=.FALSE.)
1906 :
1907 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
1908 : variants=s2a("EPS_FILTER_MATRIX"), &
1909 : description="The threshold used for sparse matrix operations", &
1910 : usage="EPS_FILTER {real}", &
1911 : type_of_var=real_t, &
1912 21700 : default_r_val=1.0E-10_dp)
1913 21700 : CALL section_add_keyword(subsection, keyword)
1914 21700 : CALL keyword_release(keyword)
1915 :
1916 : CALL keyword_create(keyword, __LOCATION__, name="GRID", &
1917 : variants=["ATOMIC_GRID"], &
1918 : description="Specification of the atomic angular and radial grids for "// &
1919 : "a atomic kind. This keyword must be repeated for all kinds! "// &
1920 : "Usage: GRID < LEBEDEV_GRID > < RADIAL_GRID >", &
1921 : usage="GRID {string} {integer} {integer}", &
1922 43400 : n_var=3, type_of_var=char_t, repeats=.TRUE.)
1923 21700 : CALL section_add_keyword(subsection, keyword)
1924 21700 : CALL keyword_release(keyword)
1925 :
1926 21700 : CALL section_add_subsection(section, subsection)
1927 21700 : CALL section_release(subsection)
1928 :
1929 : ! kernel XC functional
1930 21700 : CALL create_xc_section(subsection)
1931 21700 : CALL section_add_subsection(section, subsection)
1932 21700 : CALL section_release(subsection)
1933 :
1934 : ! MGRID subsection
1935 21700 : CALL create_mgrid_section(subsection, create_subsections=.FALSE.)
1936 21700 : CALL section_add_subsection(section, subsection)
1937 21700 : CALL section_release(subsection)
1938 :
1939 : ! sTDA subsection
1940 21700 : CALL create_stda_section(subsection)
1941 21700 : CALL section_add_subsection(section, subsection)
1942 21700 : CALL section_release(subsection)
1943 :
1944 : ! RSE subsection
1945 21700 : CALL create_res_section(subsection)
1946 21700 : CALL section_add_subsection(section, subsection)
1947 21700 : CALL section_release(subsection)
1948 :
1949 : CALL keyword_create(keyword, __LOCATION__, name="DO_BSE", &
1950 : description="Choosing BSE kernel.", &
1951 21700 : usage="DO_BSE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1952 21700 : CALL section_add_keyword(section, keyword)
1953 21700 : CALL keyword_release(keyword)
1954 :
1955 : CALL keyword_create(keyword, __LOCATION__, name="DO_BSE_W_ONLY", &
1956 : description="Debug option for BSE kernel.", &
1957 21700 : usage="DO_BSE_W_ONLY", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1958 21700 : CALL section_add_keyword(section, keyword)
1959 21700 : CALL keyword_release(keyword)
1960 :
1961 : CALL keyword_create(keyword, __LOCATION__, name="DO_BSE_GW_ONLY", &
1962 : description="Debug option for BSE kernel.", &
1963 21700 : usage="DO_BSE_GW_ONLY", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1964 21700 : CALL section_add_keyword(section, keyword)
1965 21700 : CALL keyword_release(keyword)
1966 :
1967 : ! LRI subsection
1968 21700 : CALL create_lrigpw_section(subsection)
1969 21700 : CALL section_add_subsection(section, subsection)
1970 21700 : CALL section_release(subsection)
1971 :
1972 : ! LINRES section
1973 21700 : CALL create_linres_section(subsection, create_subsections=.FALSE., default_set_tdlr=.TRUE.)
1974 21700 : CALL section_add_subsection(section, subsection)
1975 21700 : CALL section_release(subsection)
1976 :
1977 : ! PRINT subsection
1978 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1979 21700 : description="Printing of information during the TDDFT run.", repeats=.FALSE.)
1980 :
1981 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="PROGRAM_BANNER", &
1982 : description="Controls the printing of the banner for TDDFPT program", &
1983 21700 : print_level=silent_print_level, filename="__STD_OUT__")
1984 21700 : CALL section_add_subsection(subsection, print_key)
1985 21700 : CALL section_release(print_key)
1986 :
1987 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="GUESS_VECTORS", &
1988 : description="Controls the printing of initial guess vectors.", &
1989 21700 : print_level=low_print_level, filename="__STD_OUT__")
1990 21700 : CALL section_add_subsection(subsection, print_key)
1991 21700 : CALL section_release(print_key)
1992 :
1993 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="ITERATION_INFO", &
1994 : description="Controls the printing of basic iteration information "// &
1995 : "during the TDDFT run.", &
1996 21700 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
1997 21700 : CALL section_add_subsection(subsection, print_key)
1998 21700 : CALL section_release(print_key)
1999 :
2000 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="DETAILED_ENERGY", &
2001 : description="Controls the printing of detailed energy information "// &
2002 : "during the TDDFT run.", &
2003 21700 : print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
2004 21700 : CALL section_add_subsection(subsection, print_key)
2005 21700 : CALL section_release(print_key)
2006 :
2007 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="BASIS_SET_FILE", &
2008 : description="Controls the printing of a file with all basis sets used.", &
2009 21700 : print_level=debug_print_level, filename="BASIS_SETS")
2010 21700 : CALL section_add_subsection(subsection, print_key)
2011 21700 : CALL section_release(print_key)
2012 :
2013 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="RESTART", &
2014 : description="Controls the dumping of the MO restart file during TDDFPT. "// &
2015 : "By default keeps a short history of three restarts.", &
2016 : print_level=low_print_level, common_iter_levels=3, &
2017 : each_iter_names=s2a("TDDFT_SCF"), each_iter_values=[10], &
2018 21700 : add_last=add_last_numeric, filename="RESTART")
2019 : CALL keyword_create(keyword, __LOCATION__, name="BACKUP_COPIES", &
2020 : description="Specifies the maximum number of backup copies.", &
2021 : usage="BACKUP_COPIES {int}", &
2022 21700 : default_i_val=1)
2023 21700 : CALL section_add_keyword(print_key, keyword)
2024 21700 : CALL keyword_release(keyword)
2025 21700 : CALL section_add_subsection(subsection, print_key)
2026 21700 : CALL section_release(print_key)
2027 :
2028 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="NTO_ANALYSIS", &
2029 : description="Perform a natural transition orbital analysis.", &
2030 21700 : print_level=medium_print_level)
2031 : CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
2032 : description="Threshold for sum of NTO eigenvalues considered", &
2033 : usage="Threshold 0.95", &
2034 : n_var=1, &
2035 : type_of_var=real_t, &
2036 21700 : default_r_val=0.975_dp)
2037 21700 : CALL section_add_keyword(print_key, keyword)
2038 21700 : CALL keyword_release(keyword)
2039 : CALL keyword_create(keyword, __LOCATION__, name="INTENSITY_THRESHOLD", &
2040 : description="Threshold for oscillator strength to screen states.", &
2041 : usage="Intensity_threshold 0.01", &
2042 : n_var=1, &
2043 : type_of_var=real_t, &
2044 21700 : default_r_val=0.0_dp)
2045 21700 : CALL section_add_keyword(print_key, keyword)
2046 21700 : CALL keyword_release(keyword)
2047 : CALL keyword_create(keyword, __LOCATION__, name="STATE_LIST", &
2048 : description="Specifies a list of states for the NTO calculations.", &
2049 : usage="STATE_LIST {integer} {integer} .. {integer}", &
2050 21700 : n_var=-1, type_of_var=integer_t)
2051 21700 : CALL section_add_keyword(print_key, keyword)
2052 21700 : CALL keyword_release(keyword)
2053 : CALL keyword_create(keyword, __LOCATION__, name="CUBE_FILES", &
2054 : description="Print NTOs on Cube Files", &
2055 : usage="CUBE_FILES {logical}", repeats=.FALSE., n_var=1, &
2056 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
2057 21700 : CALL section_add_keyword(print_key, keyword)
2058 21700 : CALL keyword_release(keyword)
2059 : CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
2060 : description="The stride (X,Y,Z) used to write the cube file "// &
2061 : "(larger values result in smaller cube files). Provide 3 numbers (for X,Y,Z) or"// &
2062 : " 1 number valid for all components.", &
2063 21700 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
2064 21700 : CALL section_add_keyword(print_key, keyword)
2065 21700 : CALL keyword_release(keyword)
2066 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
2067 : description="append the cube files when they already exist", &
2068 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2069 21700 : CALL section_add_keyword(print_key, keyword)
2070 21700 : CALL keyword_release(keyword)
2071 21700 : CALL section_add_subsection(subsection, print_key)
2072 21700 : CALL section_release(print_key)
2073 :
2074 : CALL cp_print_key_section_create(print_key, __LOCATION__, "MOS_MOLDEN", &
2075 : description="Write the NTO in Molden file format, for visualisation.", &
2076 21700 : print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MOS")
2077 : CALL keyword_create(keyword, __LOCATION__, name="UNIT", &
2078 : description="Unit for coordinates and cell in the MOLDEN file.", &
2079 : usage="UNIT ANGSTROM", &
2080 : enum_c_vals=s2a("BOHR", "ANGSTROM"), &
2081 : enum_desc=s2a("Write in Bohr (AU)", "Write in Angstrom"), &
2082 : enum_i_vals=[1, 2], &
2083 21700 : default_i_val=1)
2084 21700 : CALL section_add_keyword(print_key, keyword)
2085 21700 : CALL keyword_release(keyword)
2086 : CALL keyword_create(keyword, __LOCATION__, name="WRITE_CELL", &
2087 : description="Controls whether the [Cell] block is written to the MOLDEN file.", &
2088 : usage="WRITE_CELL TRUE", &
2089 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2090 21700 : CALL section_add_keyword(print_key, keyword)
2091 21700 : CALL keyword_release(keyword)
2092 : CALL keyword_create(keyword, __LOCATION__, name="WRITE_PSEUDO", &
2093 : description="Controls whether the [Pseudo] block is written to the MOLDEN file.", &
2094 : usage="WRITE_PSEUDO TRUE", &
2095 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2096 21700 : CALL section_add_keyword(print_key, keyword)
2097 21700 : CALL keyword_release(keyword)
2098 : CALL keyword_create(keyword, __LOCATION__, name="MARK_GHOST", &
2099 : description="Controls whether ghost atoms are marked in the [Atoms] block by "// &
2100 : "setting their atomic number to zero.", &
2101 : usage="MARK_GHOST T", &
2102 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2103 21700 : CALL section_add_keyword(print_key, keyword)
2104 21700 : CALL keyword_release(keyword)
2105 : CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
2106 : description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
2107 : usage="NDIGITS {int}", &
2108 21700 : default_i_val=3)
2109 21700 : CALL section_add_keyword(print_key, keyword)
2110 21700 : CALL keyword_release(keyword)
2111 : CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
2112 : description="Representation of Gaussian-type orbitals", &
2113 : default_i_val=gto_spherical, &
2114 : enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
2115 : enum_desc=s2a( &
2116 : "Cartesian Gaussian orbitals. Use with caution", &
2117 : "Spherical Gaussian orbitals. Incompatible with VMD"), &
2118 21700 : enum_i_vals=[gto_cartesian, gto_spherical])
2119 21700 : CALL section_add_keyword(print_key, keyword)
2120 21700 : CALL keyword_release(keyword)
2121 21700 : CALL section_add_subsection(subsection, print_key)
2122 21700 : CALL section_release(print_key)
2123 :
2124 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="NAMD_PRINT", &
2125 : description="Controls the printout required for NAMD with NEWTONX.", &
2126 21700 : print_level=debug_print_level + 1, filename="CP2K_NEWTONX")
2127 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_VIRTUALS", &
2128 : description="Print occupied AND virtual molecular orbital coefficients", &
2129 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2130 21700 : CALL section_add_keyword(print_key, keyword)
2131 21700 : CALL keyword_release(keyword)
2132 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_PHASES", &
2133 : description="Print phases of occupied and virtuals MOs.", &
2134 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2135 21700 : CALL section_add_keyword(print_key, keyword)
2136 21700 : CALL keyword_release(keyword)
2137 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_WITH_PHASES", &
2138 : description="Scale ES eigenvectors with phases of occupied and virtuals MOs.", &
2139 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2140 21700 : CALL section_add_keyword(print_key, keyword)
2141 21700 : CALL keyword_release(keyword)
2142 21700 : CALL section_add_subsection(subsection, print_key)
2143 21700 : CALL section_release(print_key)
2144 :
2145 : !! SOC PRINT SECTION
2146 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="SOC_PRINT", &
2147 : description="Controls the printout of the tddfpt2_soc modul", &
2148 21700 : print_level=debug_print_level + 1, filename="SOC")
2149 : CALL keyword_create(keyword, __LOCATION__, name="UNIT_eV", &
2150 : description="Will detrement if output in eVolt will be printef.", &
2151 21700 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
2152 21700 : CALL section_add_keyword(print_key, keyword)
2153 21700 : CALL keyword_release(keyword)
2154 : CALL keyword_create(keyword, __LOCATION__, name="UNIT_wn", &
2155 : description="Will detrement if output in wavenumbers will be printed.", &
2156 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2157 21700 : CALL section_add_keyword(print_key, keyword)
2158 21700 : CALL keyword_release(keyword)
2159 : CALL keyword_create(keyword, __LOCATION__, name="SPLITTING", &
2160 : description="Will add the SOC-Splitting as additional output", &
2161 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2162 21700 : CALL section_add_keyword(print_key, keyword)
2163 21700 : CALL keyword_release(keyword)
2164 : CALL keyword_create(keyword, __LOCATION__, name="SOME", &
2165 : description="Will add the SOC-Matrix as additional output in a different file", &
2166 21700 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2167 21700 : CALL section_add_keyword(print_key, keyword)
2168 21700 : CALL keyword_release(keyword)
2169 21700 : CALL section_add_subsection(subsection, print_key)
2170 21700 : CALL section_release(print_key)
2171 :
2172 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="FORCES", &
2173 : description="Controls the calculation and printing of excited state forces. "// &
2174 : "This needs a RUN_TYPE that includes force evaluation, e.g. ENERGY_FORCE", &
2175 21700 : print_level=debug_print_level, filename="TDFORCE")
2176 : CALL keyword_create(keyword, __LOCATION__, name="LIST", &
2177 : description="Specifies a list of states for the force calculations.", &
2178 : usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
2179 21700 : n_var=-1, type_of_var=integer_t)
2180 21700 : CALL section_add_keyword(print_key, keyword)
2181 21700 : CALL keyword_release(keyword)
2182 : CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
2183 : description="Threshold for oszillator strength to screen states.", &
2184 : usage="Threshold 0.01", &
2185 : n_var=1, &
2186 : type_of_var=real_t, &
2187 21700 : default_r_val=0.0_dp)
2188 21700 : CALL section_add_keyword(print_key, keyword)
2189 21700 : CALL keyword_release(keyword)
2190 21700 : CALL section_add_subsection(subsection, print_key)
2191 21700 : CALL section_release(print_key)
2192 :
2193 21700 : CALL section_add_subsection(section, subsection)
2194 21700 : CALL section_release(subsection)
2195 :
2196 21700 : END SUBROUTINE create_tddfpt2_section
2197 :
2198 : ! **************************************************************************************************
2199 : !> \brief creates the stda input section (simplified Tamm Dancoff Approximation)
2200 : !> \param section the section to create
2201 : ! **************************************************************************************************
2202 21700 : SUBROUTINE create_stda_section(section)
2203 : TYPE(section_type), POINTER :: section
2204 :
2205 : TYPE(keyword_type), POINTER :: keyword
2206 :
2207 21700 : CPASSERT(.NOT. ASSOCIATED(section))
2208 : CALL section_create(section, __LOCATION__, name="sTDA", &
2209 : description="parameters needed and setup for sTDA calculations", &
2210 21700 : n_keywords=3, n_subsections=0, repeats=.FALSE.)
2211 21700 : NULLIFY (keyword)
2212 :
2213 : CALL keyword_create(keyword, __LOCATION__, name="FRACTION", &
2214 : variants=["HFX_FRACTION"], &
2215 : description="The fraction of TB Hartree-Fock exchange to use in the Kernel. "// &
2216 : "0.0 implies no HFX part is used in the kernel. ", &
2217 43400 : usage="FRACTION 0.0", default_r_val=0.0_dp)
2218 21700 : CALL section_add_keyword(section, keyword)
2219 21700 : CALL keyword_release(keyword)
2220 :
2221 : ! even if scaling parameter for exchange FRACTION (see above) is zero, the semi-empirical electron repulsion
2222 : ! operator for exchange is not, so that a keyword is required to switch off sTDA exchange (if wanted)
2223 : CALL keyword_create(keyword, __LOCATION__, name="DO_EXCHANGE", &
2224 : description="Explicitly including or switching off sTDA exchange", &
2225 21700 : usage="DO_EXCHANGE", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
2226 21700 : CALL section_add_keyword(section, keyword)
2227 21700 : CALL keyword_release(keyword)
2228 :
2229 : CALL keyword_create(keyword, __LOCATION__, name="DO_EWALD", &
2230 : description="Use Ewald type method for Coulomb interaction", &
2231 21700 : usage="DO_EWALD", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2232 21700 : CALL section_add_keyword(section, keyword)
2233 21700 : CALL keyword_release(keyword)
2234 :
2235 : CALL keyword_create(keyword, __LOCATION__, name="EPS_TD_FILTER", &
2236 : description="Threshold for filtering the transition density matrix", &
2237 21700 : usage="EPS_TD_FILTER epsf", default_r_val=1.e-10_dp)
2238 21700 : CALL section_add_keyword(section, keyword)
2239 21700 : CALL keyword_release(keyword)
2240 :
2241 : CALL keyword_create(keyword, __LOCATION__, name="MATAGA_NISHIMOTO_CEXP", &
2242 : description="Exponent used in Mataga-Nishimoto formula for Coulomb (alpha). "// &
2243 : "Default value is method dependent!", &
2244 21700 : usage="MATAGA_NISHIMOTO_CEXP cexp", default_r_val=-99.0_dp)
2245 21700 : CALL section_add_keyword(section, keyword)
2246 21700 : CALL keyword_release(keyword)
2247 :
2248 : CALL keyword_create(keyword, __LOCATION__, name="MATAGA_NISHIMOTO_XEXP", &
2249 : description="Exponent used in Mataga-Nishimoto formula for Exchange (beta). "// &
2250 : "Default value is method dependent!", &
2251 21700 : usage="MATAGA_NISHIMOTO_XEXP xexp", default_r_val=-99.0_dp)
2252 21700 : CALL section_add_keyword(section, keyword)
2253 21700 : CALL keyword_release(keyword)
2254 :
2255 : CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_CUT", &
2256 : description="Maximum range of short range part of Coulomb interaction.", &
2257 21700 : usage="COULOMB_SR_CUT rcut", default_r_val=20.0_dp)
2258 21700 : CALL section_add_keyword(section, keyword)
2259 21700 : CALL keyword_release(keyword)
2260 :
2261 : CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_EPS", &
2262 : description="Threshold for short range part of Coulomb interaction.", &
2263 21700 : usage="COULOMB_SR_EPS sreps", default_r_val=1.e-03_dp)
2264 21700 : CALL section_add_keyword(section, keyword)
2265 21700 : CALL keyword_release(keyword)
2266 :
2267 21700 : END SUBROUTINE create_stda_section
2268 :
2269 : ! **************************************************************************************************
2270 : !> \brief creates the RES input section (Reduced Excitation Space)
2271 : !> \param section the section to create
2272 : ! **************************************************************************************************
2273 21700 : SUBROUTINE create_res_section(section)
2274 : TYPE(section_type), POINTER :: section
2275 :
2276 : TYPE(keyword_type), POINTER :: keyword
2277 :
2278 21700 : CPASSERT(.NOT. ASSOCIATED(section))
2279 : CALL section_create(section, __LOCATION__, name="REDUCED_EXCITATION_SPACE", &
2280 : description="Sets up a restricted (reduced) excitation space for TDDFT", &
2281 21700 : n_keywords=3, n_subsections=0, repeats=.FALSE.)
2282 :
2283 21700 : NULLIFY (keyword)
2284 : CALL keyword_create(keyword, __LOCATION__, &
2285 : name="_SECTION_PARAMETERS_", &
2286 : description="Controls the activation of RES calculation.", &
2287 : default_l_val=.FALSE., &
2288 21700 : lone_keyword_l_val=.TRUE.)
2289 21700 : CALL section_add_keyword(section, keyword)
2290 21700 : CALL keyword_release(keyword)
2291 :
2292 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
2293 : description="Upper and lower cutoffs [eV] for orbitals to be included for excitations. ", &
2294 : usage="ENERGY_WINDOW -5.0 0.0", default_r_vals=[-1.0E10_dp, 1.0E10_dp], &
2295 21700 : type_of_var=real_t, unit_str="eV")
2296 21700 : CALL section_add_keyword(section, keyword)
2297 21700 : CALL keyword_release(keyword)
2298 :
2299 : CALL keyword_create(keyword, __LOCATION__, name="UPPER_ENERGY_CUTOFF", &
2300 : description="Upper energy cutoff [eV] for orbitals to be included in excitations.", &
2301 : usage="UPPER_ENERGY_CUTOFF -5.0", default_r_val=1.0E10_dp, &
2302 21700 : type_of_var=real_t, unit_str="eV")
2303 21700 : CALL section_add_keyword(section, keyword)
2304 21700 : CALL keyword_release(keyword)
2305 :
2306 : CALL keyword_create(keyword, __LOCATION__, name="LOWER_ENERGY_CUTOFF", &
2307 : description="Lower energy cutoff [eV] for orbitals to be included in excitations.", &
2308 : usage="LOWER_ENERGY_CUTOFF -5.0", default_r_val=-1.0E10_dp, &
2309 21700 : type_of_var=real_t, unit_str="eV")
2310 21700 : CALL section_add_keyword(section, keyword)
2311 21700 : CALL keyword_release(keyword)
2312 :
2313 : CALL keyword_create(keyword, __LOCATION__, name="MOLECULE_LIST", &
2314 : description="Indices of molecules to be excited. "// &
2315 : "This implies the calculation of molecular states through orbital location "// &
2316 : "and subspace diagonalization.", &
2317 : usage="MOLECULE_LIST {integer} {integer} .. {integer} ", &
2318 21700 : n_var=-1, type_of_var=integer_t, repeats=.FALSE.)
2319 21700 : CALL section_add_keyword(section, keyword)
2320 21700 : CALL keyword_release(keyword)
2321 :
2322 21700 : END SUBROUTINE create_res_section
2323 :
2324 : ! **************************************************************************************************
2325 : !> \brief creates an input section for electronic band structure calculations
2326 : !> \param section section to create
2327 : !> \par History
2328 : !> * 07.2023 created [Jan Wilhelm]
2329 : ! **************************************************************************************************
2330 10850 : SUBROUTINE create_bandstructure_section(section)
2331 : TYPE(section_type), POINTER :: section
2332 :
2333 : TYPE(keyword_type), POINTER :: keyword
2334 : TYPE(section_type), POINTER :: subsection
2335 :
2336 10850 : CPASSERT(.NOT. ASSOCIATED(section))
2337 : CALL section_create(section, __LOCATION__, name="BANDSTRUCTURE", &
2338 : description="Parameters needed to set up a calculation for "// &
2339 : "electronic level energies of molecules and the electronic band "// &
2340 : "structure of materials from post-SCF schemes (GW, perturbative "// &
2341 : "spin-orbit coupling). Also, the density of states (DOS), "// &
2342 : "projected density of states (PDOS), local density of states (LDOS), "// &
2343 : "local valence band maximum (LVBM), local conduction band minimum "// &
2344 : "(LCBM) and local band gap can be calculated. Please note that "// &
2345 : "all methods in this section start from a Gamma-only DFT SCF. "// &
2346 : "You need to make sure that the cell chosen in the DFT SCF is "// &
2347 : "converged in the cell size. Band structures are computed "// &
2348 : "for the primitive cell (i.e. the smallest possible unit cell of "// &
2349 : "the input structure which is detected automatically). Moreover, "// &
2350 : "spin-orbit coupling (SOC) on eigenvalues and band structures is "// &
2351 : "available using Hartwigsen-Goedecker-Hutter "// &
2352 : "pseudopotentials.", &
2353 10850 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
2354 :
2355 10850 : NULLIFY (keyword, subsection)
2356 : CALL keyword_create(keyword, __LOCATION__, &
2357 : name="_SECTION_PARAMETERS_", &
2358 : description="Controls the activation of the band structure calculation.", &
2359 : default_l_val=.FALSE., &
2360 10850 : lone_keyword_l_val=.TRUE.)
2361 10850 : CALL section_add_keyword(section, keyword)
2362 10850 : CALL keyword_release(keyword)
2363 :
2364 : ! here we generate a subsection for getting a k-point path for the bandstructure
2365 10850 : CALL create_kpoint_set_section(subsection, "BANDSTRUCTURE_PATH")
2366 10850 : CALL section_add_subsection(section, subsection)
2367 10850 : CALL section_release(subsection)
2368 :
2369 10850 : CALL create_gw_section(subsection)
2370 10850 : CALL section_add_subsection(section, subsection)
2371 10850 : CALL section_release(subsection)
2372 :
2373 10850 : CALL create_soc_section(subsection)
2374 10850 : CALL section_add_subsection(section, subsection)
2375 10850 : CALL section_release(subsection)
2376 :
2377 10850 : CALL create_dos_section(subsection)
2378 10850 : CALL section_add_subsection(section, subsection)
2379 10850 : CALL section_release(subsection)
2380 :
2381 10850 : CALL create_floquet_section(subsection)
2382 10850 : CALL section_add_subsection(section, subsection)
2383 10850 : CALL section_release(subsection)
2384 :
2385 10850 : END SUBROUTINE create_bandstructure_section
2386 :
2387 : ! **************************************************************************************************
2388 : !> \brief creates an input section for a GW calculation for the electronic band structure
2389 : !> \param section section to create
2390 : !> \par History
2391 : !> * 07.2023 created [Jan Wilhelm]
2392 : ! **************************************************************************************************
2393 10850 : SUBROUTINE create_gw_section(section)
2394 : TYPE(section_type), POINTER :: section
2395 :
2396 : TYPE(keyword_type), POINTER :: keyword
2397 : TYPE(section_type), POINTER :: print_key, subsection
2398 :
2399 10850 : CPASSERT(.NOT. ASSOCIATED(section))
2400 : CALL section_create(section, __LOCATION__, name="GW", &
2401 : description="Parameters needed to set up a GW calculation for "// &
2402 : "electronic level energies $\varepsilon_{n\mathbf{k}}^{G_0W_0}$ "// &
2403 : "of molecules and the band structure of materials: "// &
2404 : "$\varepsilon_{n\mathbf{k}}^{G_0W_0}= "// &
2405 : "\varepsilon_{n\mathbf{k}}^\text{DFT}+\Sigma_{n\mathbf{k}} "// &
2406 : "-v^\text{xc}_{n\mathbf{k}}$. "// &
2407 : "For the GW algorithm for molecules, see "// &
2408 : "<https://doi.org/10.1021/acs.jctc.0c01282>. "// &
2409 : "For 2D materials, see <https://doi.org/10.1021/acs.jctc.3c01230>.", &
2410 10850 : n_keywords=1, n_subsections=3, repeats=.FALSE.)
2411 :
2412 10850 : NULLIFY (keyword)
2413 : CALL keyword_create(keyword, __LOCATION__, &
2414 : name="_SECTION_PARAMETERS_", &
2415 : description="Controls the activation of the GW calculation.", &
2416 : default_l_val=.FALSE., &
2417 10850 : lone_keyword_l_val=.TRUE.)
2418 10850 : CALL section_add_keyword(section, keyword)
2419 10850 : CALL keyword_release(keyword)
2420 :
2421 : CALL keyword_create(keyword, __LOCATION__, name="NUM_TIME_FREQ_POINTS", &
2422 : description="Number of discrete points for the imaginary-time "// &
2423 : "grid and the imaginary-frequency grid. The more points, the more "// &
2424 : "precise is the calculation. Typically, 10 points are good "// &
2425 : "for 0.1 eV precision of band structures and molecular energy "// &
2426 : "levels, 20 points for 0.03 eV precision, "// &
2427 : "and 30 points for 0.01 eV precision, see Table I in "// &
2428 : "<https://doi.org/10.1021/acs.jctc.0c01282>. GW computation time "// &
2429 : "increases linearly with `NUM_TIME_FREQ_POINTS`.", &
2430 : usage="NUM_TIME_FREQ_POINTS 30", &
2431 10850 : default_i_val=30)
2432 10850 : CALL section_add_keyword(section, keyword)
2433 10850 : CALL keyword_release(keyword)
2434 :
2435 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
2436 : description="Determines a threshold for the DBCSR based sparse "// &
2437 : "multiplications. Normally, `EPS_FILTER` determines accuracy "// &
2438 : "and timing of low-scaling GW calculations. (Lower filter means "// &
2439 : "higher numerical precision, but higher computational cost.)", &
2440 : usage="EPS_FILTER 1.0E-6", &
2441 10850 : default_r_val=1.0E-8_dp)
2442 10850 : CALL section_add_keyword(section, keyword)
2443 10850 : CALL keyword_release(keyword)
2444 :
2445 : CALL keyword_create(keyword, __LOCATION__, name="REGULARIZATION_MINIMAX", &
2446 : description="Parameter to regularize the Fourier transformation with minimax grids. "// &
2447 : "In case the parameter 0.0 is chosen, no regularization is performed.", &
2448 : usage="REGULARIZATION_MINIMAX 1.0E-4", &
2449 10850 : default_r_val=-1.0_dp)
2450 10850 : CALL section_add_keyword(section, keyword)
2451 10850 : CALL keyword_release(keyword)
2452 :
2453 : CALL keyword_create(keyword, __LOCATION__, name="REGULARIZATION_RI", &
2454 : description="Parameter for RI regularization, setting a negative "// &
2455 : "value triggers the default value. Affects RI basis set convergence "// &
2456 : "but in any case large RI basis will give RI basis set convergence.", &
2457 : usage="REGULARIZATION_RI 1.0E-4", &
2458 10850 : default_r_val=-1.0_dp)
2459 10850 : CALL section_add_keyword(section, keyword)
2460 10850 : CALL keyword_release(keyword)
2461 :
2462 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RI", &
2463 : description="The cutoff radius (in Angstrom) for the truncated "// &
2464 : "Coulomb operator. The larger the cutoff radius, the faster "// &
2465 : "converges the resolution of the identity (RI) with respect to the "// &
2466 : "RI basis set size. Larger cutoff radius means higher computational "// &
2467 : "cost.", &
2468 : usage="CUTOFF_RADIUS_RI 3.0", &
2469 : default_r_val=cp_unit_to_cp2k(value=3.0_dp, unit_str="angstrom"), &
2470 10850 : type_of_var=real_t, unit_str="angstrom")
2471 10850 : CALL section_add_keyword(section, keyword)
2472 10850 : CALL keyword_release(keyword)
2473 :
2474 : CALL keyword_create(keyword, __LOCATION__, name="MEMORY_PER_PROC", &
2475 : description="Specify the available memory per MPI process. Set "// &
2476 : "`MEMORY_PER_PROC` as accurately as possible for good performance. If "// &
2477 : "`MEMORY_PER_PROC` is set lower as the actually available "// &
2478 : "memory per MPI process, the performance will be "// &
2479 : "bad; if `MEMORY_PER_PROC` is set higher as the actually "// &
2480 : "available memory per MPI process, the program might run out of "// &
2481 : "memory. You can calculate `MEMORY_PER_PROC` as follows: "// &
2482 : "Get the memory per node on your machine, mem_per_node "// &
2483 : "(for example, from a supercomputer website, typically between "// &
2484 : "100 GB and 2 TB), get the number of "// &
2485 : "MPI processes per node, n_MPI_proc_per_node"// &
2486 : " (for example from your run-script; if you "// &
2487 : "use slurm, the number behind '--ntasks-per-node' is the number "// &
2488 : "of MPI processes per node). Then calculate "// &
2489 : "`MEMORY_PER_PROC` = mem_per_node / n_MPI_proc_per_node "// &
2490 : "(typically between 2 GB and 50 GB). Unit of keyword: Gigabyte (GB). "// &
2491 : "Note: This keyword is not used for GW calculations with RI-RS, "// &
2492 : "where the available memory is detected automatically.", &
2493 : usage="MEMORY_PER_PROC 16", &
2494 10850 : default_r_val=2.0_dp)
2495 10850 : CALL section_add_keyword(section, keyword)
2496 10850 : CALL keyword_release(keyword)
2497 :
2498 : CALL keyword_create(keyword, __LOCATION__, name="APPROX_KP_EXTRAPOL", &
2499 : description="If true, use only a 4x4 kpoint mesh for frequency "// &
2500 : "points $\omega_j, j \ge 2$ (instead of a 4x4 and 6x6 k-point mesh). "// &
2501 : "The k-point extrapolation of $W_{PQ}(i\omega_j,\mathbf{q})$ "// &
2502 : "is done approximately from $W_{PQ}(i\omega_1,\mathbf{q})$.", &
2503 : usage="APPROX_KP_EXTRAPOL", &
2504 10850 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2505 10850 : CALL section_add_keyword(section, keyword)
2506 10850 : CALL keyword_release(keyword)
2507 :
2508 : CALL keyword_create(keyword, __LOCATION__, name="SIZE_LATTICE_SUM", &
2509 : description="Parameter determines how many neighbor cells $\mathbf{R}$ "// &
2510 : "are used for computing "// &
2511 : "$V_{PQ}(\mathbf{k}) = "// &
2512 : "\sum_{\mathbf{R}} e^{i\mathbf{k}\cdot\mathbf{R}}\,\langle P, "// &
2513 : "\text{cell}{=}\mathbf{0}|1/r|Q,\text{cell}{=}\mathbf{R}\rangle$. "// &
2514 : "Normally, parameter does not need to be touched.", &
2515 : usage="SIZE_LATTICE_SUM 4", &
2516 10850 : default_i_val=3)
2517 10850 : CALL section_add_keyword(section, keyword)
2518 10850 : CALL keyword_release(keyword)
2519 :
2520 : CALL keyword_create( &
2521 : keyword, __LOCATION__, name="KPOINTS_W", &
2522 : description="Monkhorst-Pack k-point mesh of size N_x, N_y, N_z for calculating "// &
2523 : "$W_{PQ}^\mathbf{R}=\int_\text{BZ}\frac{d\mathbf{k}}{\Omega_\text{BZ}}\, "// &
2524 : "e^{-i\mathbf{k}\cdot\mathbf{R}}\,W_{PQ}(\mathbf{k})$. "// &
2525 : "For non-periodic directions α, choose N_α = 1. "// &
2526 : "Automatic choice of the k-point mesh for negative "// &
2527 : "values, i.e. KPOINTS_W -1 -1 -1. "// &
2528 : "K-point extrapolation of W is automatically switched on.", &
2529 : usage="KPOINTS_W N_x N_y N_z", &
2530 10850 : n_var=3, type_of_var=integer_t, default_i_vals=[-1, -1, -1])
2531 10850 : CALL section_add_keyword(section, keyword)
2532 10850 : CALL keyword_release(keyword)
2533 :
2534 : CALL keyword_create(keyword, __LOCATION__, name="HEDIN_SHIFT", &
2535 : description="If true, use Hedin's shift in G0W0, evGW and evGW0. "// &
2536 : "Details see in Li et al. JCTC 18, 7570 "// &
2537 : "(2022), Figure 1. G0W0 with Hedin's shift should give "// &
2538 : "similar GW eigenvalues as evGW0; at a lower "// &
2539 : "computational cost.", &
2540 : usage="HEDIN_SHIFT", &
2541 : default_l_val=.FALSE., &
2542 10850 : lone_keyword_l_val=.TRUE.)
2543 10850 : CALL section_add_keyword(section, keyword)
2544 10850 : CALL keyword_release(keyword)
2545 :
2546 : CALL keyword_create(keyword, __LOCATION__, name="FREQ_MAX_FIT", &
2547 : description="For analytic continuation, a fit on Σ(iω) is performed. "// &
2548 : "This fit is then evaluated at a real frequency, Σ(ω), which is used "// &
2549 : "in the quasiparticle equation "// &
2550 : "$\varepsilon_{n\mathbf{k}}^{G_0W_0}= "// &
2551 : "\varepsilon_{n\mathbf{k}}^\text{DFT}+\Sigma_{n\mathbf{k}} "// &
2552 : "-v^\text{xc}_{n\mathbf{k}}$. The keyword FREQ_MAX_FIT "// &
2553 : "determines fitting range for the self-energy Σ(iω) on "// &
2554 : "imaginary axis: i*[0, ω_max] for empty orbitals/bands, i*[-ω_max,0] "// &
2555 : "for occ orbitals. A smaller ω_max might lead to better numerical "// &
2556 : "stability (i.e., if you observe clearly wrong GW eigenvalues/bands "// &
2557 : "around HOMO/LUMO, decreasing ω_max might fix this issue). "// &
2558 : "A small benchmark of ω_max is contained in Fig. 5 of "// &
2559 : "J. Wilhelm et al., JCTC 12, 3623-3635 (2016). "// &
2560 : "Note that we used ω_max = 1 Ha = 27.211 eV in the benchmark "// &
2561 : "M. Azizi et al., PRB 109, 245101 (2024).", &
2562 : unit_str="eV", &
2563 : usage="FREQ_MAX_FIT 20.0", &
2564 10850 : default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"))
2565 10850 : CALL section_add_keyword(section, keyword)
2566 10850 : CALL keyword_release(keyword)
2567 :
2568 10850 : NULLIFY (subsection, print_key)
2569 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
2570 : description="Printing of GW restarts.", &
2571 10850 : n_keywords=2, n_subsections=1, repeats=.FALSE.)
2572 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
2573 : description="Controls the printing of restart files "// &
2574 : "for χ, W, Σ.", &
2575 : filename="", print_level=low_print_level, &
2576 10850 : common_iter_levels=3)
2577 10850 : CALL section_add_subsection(subsection, print_key)
2578 10850 : CALL section_release(print_key)
2579 :
2580 10850 : CALL section_add_subsection(section, subsection)
2581 10850 : CALL section_release(subsection)
2582 :
2583 10850 : NULLIFY (subsection)
2584 10850 : CALL create_ri_rs_section(subsection)
2585 10850 : CALL section_add_subsection(section, subsection)
2586 10850 : CALL section_release(subsection)
2587 :
2588 10850 : NULLIFY (subsection)
2589 10850 : CALL create_evgw0_section(subsection)
2590 10850 : CALL section_add_subsection(section, subsection)
2591 10850 : CALL section_release(subsection)
2592 :
2593 10850 : END SUBROUTINE create_gw_section
2594 :
2595 : ! **************************************************************************************************
2596 : !> \brief creates the input section collecting all parameters of the real-space resolution of
2597 : !> the identity (RI-RS) used in GW
2598 : !> \param section section to create
2599 : ! **************************************************************************************************
2600 10850 : SUBROUTINE create_ri_rs_section(section)
2601 : TYPE(section_type), POINTER :: section
2602 :
2603 : TYPE(keyword_type), POINTER :: keyword
2604 : TYPE(section_type), POINTER :: subsection
2605 :
2606 10850 : CPASSERT(.NOT. ASSOCIATED(section))
2607 : CALL section_create(section, __LOCATION__, name="RI_RS", &
2608 : description="Real-Space Resolution of Identity (RI-RS) method. This "// &
2609 : "approximation replaces the conventional 3-center RI integrals "// &
2610 : "$(\mu\nu|P)$ by a factorized representation on an atom-centered "// &
2611 : "real-space grid with points $\mathbf{r}_\ell$: "// &
2612 : "$(\mu\nu|P) \approx \sum_\ell \varphi_\mu(\mathbf{r}_\ell) "// &
2613 : "\varphi_\nu(\mathbf{r}_\ell) Z_{\ell P}$. "// &
2614 : "The coefficients $Z_{\ell P}$ combine the numerical integration "// &
2615 : "weights and the Coulomb potential of the auxiliary basis function "// &
2616 : "$P$ evaluated at grid point $\mathbf{r}_\ell$. To reduce the "// &
2617 : "computational cost, only grid points within the sphere $B^P$ around "// &
2618 : "atom $P$ are included, i.e. the points with "// &
2619 : "$|\mathbf{r}_\ell - \mathbf{R}_P| < R_c + r_P$. "// &
2620 : "Here, $r_P$ is the effective radius of the most diffuse RI "// &
2621 : "auxiliary Gaussian on atom $P$, at which the basis function "// &
2622 : "magnitude falls below a threshold $\delta$ "// &
2623 : "(currently controlled through EPS_FILTER). "// &
2624 : "This locality approximation yields a sparse representation of the "// &
2625 : "3-center integrals and enables reduced computational cost. "// &
2626 : "See details in https://doi.org/10.1063/1.5090605.", &
2627 10850 : n_keywords=11, n_subsections=1, repeats=.FALSE.)
2628 :
2629 10850 : NULLIFY (keyword)
2630 : CALL keyword_create(keyword, __LOCATION__, &
2631 : name="_SECTION_PARAMETERS_", &
2632 : description="Controls the activation of RI-RS in the GW calculation. "// &
2633 : "An empty section, &RI_RS ... &END RI_RS, switches RI-RS on with "// &
2634 : "default parameters.", &
2635 : usage="&RI_RS .TRUE.", &
2636 : default_l_val=.FALSE., &
2637 10850 : lone_keyword_l_val=.TRUE.)
2638 10850 : CALL section_add_keyword(section, keyword)
2639 10850 : CALL keyword_release(keyword)
2640 :
2641 : CALL keyword_create(keyword, __LOCATION__, name="TIKHONOV", &
2642 : description="Regularization parameter $\alpha$ used to stabilize "// &
2643 : "the inversion of the grid-overlap matrix "// &
2644 : "$D$ in the RI-RS method. "// &
2645 : "See Equation (9) in https://doi.org/10.1063/1.5090605.", &
2646 : usage="TIKHONOV 1.0E-8", &
2647 10850 : default_r_val=1.0E-08_dp)
2648 10850 : CALL section_add_keyword(section, keyword)
2649 10850 : CALL keyword_release(keyword)
2650 :
2651 : CALL keyword_create(keyword, __LOCATION__, name="GRID_SELECT", &
2652 : description="Selection of the atom-centered grid type used "// &
2653 : "in RI-RS optimized by Duchemin and Blase. "// &
2654 : "(1) def2-TZVPP: Available for elements up to the fourth row "// &
2655 : "of the periodic table (see https://doi.org/10.1021/acs.jctc.1c00101). "// &
2656 : "(2) cc-pVTZ: Available for H, C, N, and O atoms "// &
2657 : "(see https://doi.org/10.1063/1.5090605). "// &
2658 : "(3) User-provided grids: per-element grid files supplied by the "// &
2659 : "user, read as ri_rs_grid/<Element><suffix> in the same format as "// &
2660 : "the built-in sets; the suffix is _rirs.ion by default and can be "// &
2661 : "changed with GRID_FILE_SUFFIX.", &
2662 : usage="GRID_SELECT 1", &
2663 10850 : default_i_val=1)
2664 10850 : CALL section_add_keyword(section, keyword)
2665 10850 : CALL keyword_release(keyword)
2666 :
2667 : CALL keyword_create(keyword, __LOCATION__, name="GRID_FILE_SUFFIX", &
2668 : description="Overrides the per-element grid file suffix used by "// &
2669 : "GRID_SELECT 3; grid files are read as ri_rs_grid/<Element><suffix>.", &
2670 : usage="GRID_FILE_SUFFIX _my-grids.ion", &
2671 10850 : default_lc_val="")
2672 10850 : CALL section_add_keyword(section, keyword)
2673 10850 : CALL keyword_release(keyword)
2674 :
2675 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RL_RI", &
2676 : description="Real-space cutoff radius (in Angstrom) for evaluating "// &
2677 : "the RI-RS integration domain $B^P$. Overrides the default "// &
2678 : "$R_c + r_P$, where $R_c$ is the truncated-Coulomb cutoff of the "// &
2679 : "RI metric and $r_P$ the radius of the most diffuse RI auxiliary "// &
2680 : "Gaussian on atom $P$.", &
2681 : usage="CUTOFF_RADIUS_RL_RI 15.0", &
2682 : default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2683 10850 : type_of_var=real_t, unit_str="angstrom")
2684 10850 : CALL section_add_keyword(section, keyword)
2685 10850 : CALL keyword_release(keyword)
2686 :
2687 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RL_AO", &
2688 : description="Real-space cutoff radius (in Angstrom) for evaluating "// &
2689 : "the AO basis functions on the RI-RS grid. Override the default radius "// &
2690 : "derived automatically from the most diffuse AO Gaussian on each atom. ", &
2691 : usage="CUTOFF_RADIUS_RL_AO 8.0", &
2692 : default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2693 10850 : type_of_var=real_t, unit_str="angstrom")
2694 10850 : CALL section_add_keyword(section, keyword)
2695 10850 : CALL keyword_release(keyword)
2696 :
2697 : CALL keyword_create(keyword, __LOCATION__, name="N_PROCS_PER_ATOM_Z_LP", &
2698 : description="Number of MPI ranks that cooperate on one atom's "// &
2699 : "Cholesky factorisation in computation of $Z_{\ell P}$ in RI-RS. "// &
2700 : "Default -1 = AUTO: "// &
2701 : "each atom is solved single-rank (fast BLAS) unless its dense "// &
2702 : "grid-overlap matrix would exceed the available memory per process, "// &
2703 : "in which case it is distributed across a rank subgroup sized "// &
2704 : "automatically (ScaLAPACK). Set to 1 to force single-rank for all "// &
2705 : "atoms, or > 1 to force that fixed subgroup size for all atoms.", &
2706 : usage="N_PROCS_PER_ATOM_Z_LP 2", &
2707 10850 : default_i_val=-1)
2708 10850 : CALL section_add_keyword(section, keyword)
2709 10850 : CALL keyword_release(keyword)
2710 :
2711 : CALL keyword_create(keyword, __LOCATION__, name="N_PANELS", &
2712 : description="Number of grid panels (batches) the real-space grid is "// &
2713 : "split into for the streaming chi/W/Sigma contractions in RI-RS. More "// &
2714 : "panels means lower peak memory per step but more overhead. Default 1 = a "// &
2715 : "single whole-grid panel. On large cells the number of panels is "// &
2716 : "automatically increased beyond the request to keep per-rank DBCSR "// &
2717 : "messages under the 32-bit length limit.", &
2718 : usage="N_PANELS 4", &
2719 10850 : default_i_val=1)
2720 10850 : CALL section_add_keyword(section, keyword)
2721 10850 : CALL keyword_release(keyword)
2722 :
2723 : CALL keyword_create(keyword, __LOCATION__, name="KEEP_SPARSITY_RL", &
2724 : description="If `.TRUE.` (default), the W/V matrices in the "// &
2725 : "grid-basis contractions of RI-RSwill used the sparsity pattern of the "// &
2726 : "corresponding G/D matrices. "// &
2727 : "Set `.FALSE.` to build W/V fully dense.", &
2728 : usage="KEEP_SPARSITY_RL .FALSE.", &
2729 10850 : default_l_val=.TRUE.)
2730 10850 : CALL section_add_keyword(section, keyword)
2731 10850 : CALL keyword_release(keyword)
2732 :
2733 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RL_W", &
2734 : description="Real-space truncation radius (Angstrom) for the grid-basis "// &
2735 : "G operators in the RI-RS GW self-energy. "// &
2736 : "Default -1.0 disables the truncation (exact grid-basis operators).", &
2737 : usage="CUTOFF_RADIUS_RL_W 20.0", &
2738 : default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2739 10850 : type_of_var=real_t, unit_str="angstrom")
2740 10850 : CALL section_add_keyword(section, keyword)
2741 10850 : CALL keyword_release(keyword)
2742 :
2743 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_G_W", &
2744 : description="Atom-pair distance truncation radius (Angstrom) applied to "// &
2745 : "the AO/RI-space operator matrices G, D, V and W themselves in the RI-RS "// &
2746 : "GW contractions: matrix blocks between atoms further apart than this "// &
2747 : "radius are dropped. Physically consistent with CUTOFF_RADIUS_RL_W, "// &
2748 : "which truncates the grid-basis products at the same kind of range. "// &
2749 : "Default -1.0 disables the truncation (exact operators).", &
2750 : usage="CUTOFF_RADIUS_G_W 20.0", &
2751 : default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2752 10850 : type_of_var=real_t, unit_str="angstrom")
2753 10850 : CALL section_add_keyword(section, keyword)
2754 10850 : CALL keyword_release(keyword)
2755 :
2756 10850 : NULLIFY (subsection)
2757 10850 : CALL create_ri_rs_grid_optimization_section(subsection)
2758 10850 : CALL section_add_subsection(section, subsection)
2759 10850 : CALL section_release(subsection)
2760 :
2761 10850 : END SUBROUTINE create_ri_rs_section
2762 :
2763 : ! **************************************************************************************************
2764 : !> \brief Creates the GW RI-RS in-memory grid optimizer section.
2765 : !> \param section ...
2766 : ! **************************************************************************************************
2767 10850 : SUBROUTINE create_ri_rs_grid_optimization_section(section)
2768 : TYPE(section_type), POINTER :: section
2769 :
2770 : TYPE(keyword_type), POINTER :: keyword
2771 10850 : NULLIFY (keyword)
2772 10850 : CPASSERT(.NOT. ASSOCIATED(section))
2773 : CALL section_create( &
2774 : section, __LOCATION__, name="GRID_OPTIMIZATION", repeats=.FALSE., &
2775 : description="Optimizes RI-RS grids using small local atomic environments. For every atom "// &
2776 : "in the structure, a cluster is formed from all atoms whose distance from the centre atom "// &
2777 : "is smaller than CUTOFF_ATOMIC_CLUSTER. All three-centre integrals within each cluster are "// &
2778 : "computed analytically and serve as exact reference values. The grid points are optimized "// &
2779 : "such that the corresponding RI-RS three-centre integrals reproduce these references. "// &
2780 : "For a cluster $C_I$, the normalized squared RI-RS error is "// &
2781 : "$E_I = \frac{1}{N_I} \sum_{P\mu\nu \in C_I} \left|(\mu\nu|P) - "// &
2782 : "\sum_{\mathbf{r}_{A\ell} \in C_I} \varphi_\mu(\mathbf{r}_{A\ell}) "// &
2783 : "\varphi_\nu(\mathbf{r}_{A\ell}) Z_{A\ell P}\right|^2$. The total objective is "// &
2784 : "the average over all local clusters, "// &
2785 : "$E_\mathrm{loc} = \frac{1}{N_\mathrm{at}} "// &
2786 : "\sum_{I=1}^{N_\mathrm{at}} E_I$. Starting from pre-tabulated atom-specific grids, "// &
2787 : "the optimization adapts the grid to the chemical environment and composition of the "// &
2788 : "structure and can permit substantially smaller grids. Compact grids often work well for "// &
2789 : "small basis sets, but the point count specified with GRID_SIZE or N_POINT_PERCENTAGE "// &
2790 10850 : "should be tuned and converged for the chosen basis sets and chemical system.")
2791 :
2792 : CALL keyword_create( &
2793 : keyword, __LOCATION__, name="GRID_SIZE", &
2794 : description="Specifies how many grid points are used per atom for a given element. "// &
2795 : "Repeat this keyword once for every element in the structure.", &
2796 10850 : usage="GRID_SIZE Si 100", type_of_var=char_t, repeats=.TRUE., n_var=2)
2797 10850 : CALL section_add_keyword(section, keyword)
2798 10850 : CALL keyword_release(keyword)
2799 :
2800 : CALL keyword_create( &
2801 : keyword, __LOCATION__, name="N_POINT_PERCENTAGE", &
2802 : description="The element grids are read from the .ion files selected by GRID_SELECT; "// &
2803 : "GRID_FILE_SUFFIX determines user-provided filenames. From these initial grids, only "// &
2804 : "N_POINT_PERCENTAGE % of each element's grid points are taken in the actual GW calculation.", &
2805 10850 : usage="N_POINT_PERCENTAGE 20", type_of_var=real_t, default_r_val=-1.0_dp)
2806 10850 : CALL section_add_keyword(section, keyword)
2807 10850 : CALL keyword_release(keyword)
2808 :
2809 : CALL keyword_create( &
2810 : keyword, __LOCATION__, name="CUTOFF_ATOMIC_CLUSTER", &
2811 : description="Radius of the atom-centred cluster used to construct the local three-centre "// &
2812 : "integral fitting objective. Atoms within this distance of the centre atom are included.", &
2813 : usage="CUTOFF_ATOMIC_CLUSTER [angstrom] 3.0", type_of_var=real_t, &
2814 : default_r_val=cp_unit_to_cp2k(value=3.0_dp, unit_str="angstrom"), &
2815 10850 : unit_str="angstrom")
2816 10850 : CALL section_add_keyword(section, keyword)
2817 10850 : CALL keyword_release(keyword)
2818 :
2819 : CALL keyword_create( &
2820 : keyword, __LOCATION__, name="MAX_ITER", &
2821 : description="Maximum number of objective-and-gradient evaluations in the single "// &
2822 : "cooperative Cartesian grid optimization.", &
2823 10850 : usage="MAX_ITER 100", default_i_val=100)
2824 10850 : CALL section_add_keyword(section, keyword)
2825 10850 : CALL keyword_release(keyword)
2826 :
2827 10850 : END SUBROUTINE create_ri_rs_grid_optimization_section
2828 :
2829 : ! **************************************************************************************************
2830 : !> \brief creates the input section for eigenvalue self-consistent GW0 (evGW0)
2831 : !> \param section section to create
2832 : ! **************************************************************************************************
2833 10850 : SUBROUTINE create_evgw0_section(section)
2834 : TYPE(section_type), POINTER :: section
2835 :
2836 : TYPE(keyword_type), POINTER :: keyword
2837 :
2838 10850 : CPASSERT(.NOT. ASSOCIATED(section))
2839 : CALL section_create(section, __LOCATION__, name="EVGW0", &
2840 : description="Eigenvalue self-consistent GW0. The quasiparticle "// &
2841 : "energies replace the Kohn-Sham eigenvalues in the Green's function "// &
2842 : "and the cycle is repeated, while the screened Coulomb interaction "// &
2843 : "$W$ stays at its RPA@DFT value. Only the correlation self-energy "// &
2844 : "and the quasiparticle equation are recomputed per cycle; $W$, the "// &
2845 : "exchange self-energy and the RI-RS grid quantities are computed "// &
2846 : "once. This implementation requires RI-RS. Without this section a "// &
2847 : "single-shot G0W0 calculation is performed.", &
2848 10850 : n_keywords=3, n_subsections=0, repeats=.FALSE.)
2849 :
2850 10850 : NULLIFY (keyword)
2851 : CALL keyword_create(keyword, __LOCATION__, &
2852 : name="_SECTION_PARAMETERS_", &
2853 : description="Controls the activation of evGW0. An empty section, "// &
2854 : "&EVGW0 ... &END EVGW0, switches evGW0 on with default parameters.", &
2855 : usage="&EVGW0 .TRUE.", &
2856 : default_l_val=.FALSE., &
2857 10850 : lone_keyword_l_val=.TRUE.)
2858 10850 : CALL section_add_keyword(section, keyword)
2859 10850 : CALL keyword_release(keyword)
2860 :
2861 : CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
2862 : description="Maximum number of evGW0 cycles.", &
2863 : usage="MAX_ITER 20", &
2864 10850 : default_i_val=20)
2865 10850 : CALL section_add_keyword(section, keyword)
2866 10850 : CALL keyword_release(keyword)
2867 :
2868 : CALL keyword_create(keyword, __LOCATION__, name="EPS_ITER", &
2869 : description="Target accuracy of the eigenvalue self-consistency. "// &
2870 : "The cycle stops once the quasiparticle HOMO, the quasiparticle "// &
2871 : "LUMO and the HOMO-LUMO gap all change by less than this value "// &
2872 : "between two successive cycles. Unit: Hartree.", &
2873 : usage="EPS_ITER 0.00005", &
2874 10850 : default_r_val=5.0E-5_dp)
2875 10850 : CALL section_add_keyword(section, keyword)
2876 10850 : CALL keyword_release(keyword)
2877 :
2878 10850 : END SUBROUTINE create_evgw0_section
2879 :
2880 : ! **************************************************************************************************
2881 : !> \brief creates an input section for calculation SOC for the electronic band structure
2882 : !> \param section section to create
2883 : !> \par History
2884 : !> * 09.2023 created [Jan Wilhelm]
2885 : ! **************************************************************************************************
2886 10850 : SUBROUTINE create_soc_section(section)
2887 : TYPE(section_type), POINTER :: section
2888 :
2889 : TYPE(keyword_type), POINTER :: keyword
2890 :
2891 10850 : CPASSERT(.NOT. ASSOCIATED(section))
2892 : CALL section_create(section, __LOCATION__, name="SOC", &
2893 : description="Switch on or off spin-orbit coupling. Use SOC "// &
2894 : "parameters from non-local pseudopotentials as given in "// &
2895 : "Hartwigsen, Goedecker, Hutter, Eq.(18), (19), "// &
2896 : "<https://doi.org/10.1103/PhysRevB.58.3641>, "// &
2897 : "$V_{\mu\nu}^{\mathrm{SOC}, (\alpha)} = "// &
2898 : "(\hbar/2) \langle \phi_\mu | \sum_l \Delta "// &
2899 : "V_l^\mathrm{SO}(\mathbf{r},\mathbf{r}') "// &
2900 : "L^{(\alpha)} | \phi_\nu \rangle, "// &
2901 : "\alpha = x, y, z$.", &
2902 10850 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
2903 :
2904 10850 : NULLIFY (keyword)
2905 : CALL keyword_create(keyword, __LOCATION__, &
2906 : name="_SECTION_PARAMETERS_", &
2907 : description="Controls the activation of the SOC calculation.", &
2908 : default_l_val=.FALSE., &
2909 10850 : lone_keyword_l_val=.TRUE.)
2910 10850 : CALL section_add_keyword(section, keyword)
2911 10850 : CALL keyword_release(keyword)
2912 :
2913 : CALL keyword_create(keyword, __LOCATION__, name="SOC_WINDOW_OCC", &
2914 : description="Apply SOC only for states with eigenvalues below VBM "// &
2915 : "in the interval $[\varepsilon_\mathrm{VBM}-E_\mathrm{window\_occ}, \ "// &
2916 : "\varepsilon_\mathrm{VBM}]$. "// &
2917 : "to use for large systems to prevent numerical instabilities.", &
2918 : usage="SOC_WINDOW_OCC 5.0", &
2919 : default_r_val=-1.0_dp, &
2920 10850 : unit_str="eV")
2921 10850 : CALL section_add_keyword(section, keyword)
2922 10850 : CALL keyword_release(keyword)
2923 :
2924 : CALL keyword_create(keyword, __LOCATION__, name="SOC_WINDOW_VIRT", &
2925 : description="Apply SOC only for states with eigenvalues above CBM "// &
2926 : "in the interval $[\varepsilon_\mathrm{CBM},\ "// &
2927 : "\varepsilon_\mathrm{CBM}+E_\mathrm{window\_virt}]$, "// &
2928 : "to use for large systems to prevent numerical instabilities.", &
2929 : usage="SOC_WINDOW_VIRT 5.0", &
2930 : default_r_val=-1.0_dp, &
2931 10850 : unit_str="eV")
2932 10850 : CALL section_add_keyword(section, keyword)
2933 10850 : CALL keyword_release(keyword)
2934 :
2935 : CALL keyword_create(keyword, __LOCATION__, name="SOC_WINDOW_SMEARING", &
2936 : description="Width of the Fermi-like smoothing at the SOC energy-window edge. "// &
2937 : "Default reproduces the value of 1 eV. "// &
2938 : "only effective when at least one SOC window is active.", &
2939 : usage="SOC_WINDOW_SMEARING 1.0", &
2940 : default_r_val=cp_unit_to_cp2k(value=1.0_dp, unit_str="eV"), &
2941 10850 : unit_str="eV")
2942 10850 : CALL section_add_keyword(section, keyword)
2943 10850 : CALL keyword_release(keyword)
2944 :
2945 10850 : END SUBROUTINE create_soc_section
2946 :
2947 : ! **************************************************************************************************
2948 : !> \brief input section for computing the density of states and the projected density of states
2949 : !> \param section section to create
2950 : !> \par History
2951 : !> * 09.2023 created [Jan Wilhelm]
2952 : ! **************************************************************************************************
2953 10850 : SUBROUTINE create_dos_section(section)
2954 : TYPE(section_type), POINTER :: section
2955 :
2956 : TYPE(keyword_type), POINTER :: keyword
2957 : TYPE(section_type), POINTER :: subsection
2958 :
2959 10850 : CPASSERT(.NOT. ASSOCIATED(section))
2960 : CALL section_create(section, __LOCATION__, name="DOS", &
2961 : description="Parameters needed to calculate the density of states "// &
2962 : "(DOS) and the projected density of states (PDOS).", &
2963 10850 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
2964 :
2965 10850 : NULLIFY (keyword)
2966 : CALL keyword_create(keyword, __LOCATION__, &
2967 : name="_SECTION_PARAMETERS_", &
2968 : description="Controls the activation of the DOS calculation.", &
2969 : default_l_val=.FALSE., &
2970 10850 : lone_keyword_l_val=.TRUE.)
2971 10850 : CALL section_add_keyword(section, keyword)
2972 10850 : CALL keyword_release(keyword)
2973 :
2974 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
2975 : description="Print DOS and PDOS in the energy window "// &
2976 : "$[\varepsilon_\mathrm{VBM}-E_\mathrm{window}/2, "// &
2977 : "\varepsilon_\mathrm{CBM}+E_\mathrm{window}/2]$,"// &
2978 : " where VBM is the valence "// &
2979 : "band maximum (or highest occupied molecular orbital, HOMO, for "// &
2980 : "molecules) and CBM the conduction band minimum (or lowest "// &
2981 : "unoccupied molecular orbital, LUMO, for molecules).", &
2982 : usage="ENERGY_WINDOW 5.0", &
2983 : default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"), &
2984 10850 : unit_str="eV")
2985 10850 : CALL section_add_keyword(section, keyword)
2986 10850 : CALL keyword_release(keyword)
2987 :
2988 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_STEP", &
2989 : description="Resolution of the energy E when computing the $\rho(E)$.", &
2990 : usage="ENERGY_STEP 0.01", &
2991 : default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
2992 10850 : unit_str="eV")
2993 10850 : CALL section_add_keyword(section, keyword)
2994 10850 : CALL keyword_release(keyword)
2995 :
2996 : CALL keyword_create(keyword, __LOCATION__, name="BROADENING", &
2997 : description="Broadening α in Gaussians used in the DOS; "// &
2998 : "$\rho(E) = \sum_n \exp(((E-\varepsilon_n)/\alpha)^2)/("// &
2999 : " \sqrt{2\pi} \alpha)$.", &
3000 : usage="BROADENING 0.01", &
3001 : default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
3002 10850 : unit_str="eV")
3003 10850 : CALL section_add_keyword(section, keyword)
3004 10850 : CALL keyword_release(keyword)
3005 :
3006 : CALL keyword_create( &
3007 : keyword, __LOCATION__, name="KPOINTS", &
3008 : description="Monkhorst-Pack k-point mesh of size N_x, N_y, N_z for calculating "// &
3009 : "the density of states (DOS). In GW, the KPOINT_DOS mesh is thus used as k-point "// &
3010 : "mesh for the self-energy. For non-periodic directions α, choose N_α = 1. "// &
3011 : "Automatic choice of the k-point mesh for negative "// &
3012 : "values, i.e. KPOINTS_DOS -1 -1 -1 (automatic choice: N_α = 1 in non-periodic "// &
3013 : "direction, 8 k-points in periodic direction). If you like to compute a "// &
3014 : "band structure along a k-path, you can specify the k-path in "// &
3015 : "&KPOINT_SET.", &
3016 : usage="KPOINTS N_x N_y N_z", &
3017 10850 : n_var=3, type_of_var=integer_t, default_i_vals=[-1, -1, -1])
3018 10850 : CALL section_add_keyword(section, keyword)
3019 10850 : CALL keyword_release(keyword)
3020 :
3021 10850 : NULLIFY (subsection)
3022 10850 : CALL create_ldos_section(subsection)
3023 10850 : CALL section_add_subsection(section, subsection)
3024 10850 : CALL section_release(subsection)
3025 :
3026 10850 : END SUBROUTINE create_dos_section
3027 :
3028 : ! **************************************************************************************************
3029 : !> \brief ...
3030 : !> \param section ...
3031 : ! **************************************************************************************************
3032 10850 : SUBROUTINE create_ldos_section(section)
3033 : TYPE(section_type), POINTER :: section
3034 :
3035 : TYPE(keyword_type), POINTER :: keyword
3036 :
3037 10850 : CPASSERT(.NOT. ASSOCIATED(section))
3038 : CALL section_create(section, __LOCATION__, name="LDOS", &
3039 : description="Parameters needed to calculate the local density "// &
3040 : "of states (LDOS). "// &
3041 : "The LDOS is computed as $\rho(\mathbf{r},E) = "// &
3042 : "\sum\limits_{n,\mathbf{k}}"// &
3043 : " |\psi_{n\mathbf{k}}(r)|^2\, w_\mathbf{k}\, g(E-\varepsilon_{n\mathbf{k}})$ "// &
3044 : "using the Gaussian weight function "// &
3045 : "$g(x) = \exp(x^2/\alpha^2)/(\sqrt{2\pi}\alpha)$, $\alpha$ is the broadening "// &
3046 : "from the &DOS section, and the k-point weight "// &
3047 : "$w_\mathbf{k}$. The k-mesh is taken from the &DOS section.", &
3048 10850 : n_keywords=2, repeats=.FALSE.)
3049 :
3050 10850 : NULLIFY (keyword)
3051 : CALL keyword_create(keyword, __LOCATION__, &
3052 : name="_SECTION_PARAMETERS_", &
3053 : description="Activates the local VBM CBM gap calculation.", &
3054 : default_l_val=.FALSE., &
3055 10850 : lone_keyword_l_val=.TRUE.)
3056 10850 : CALL section_add_keyword(section, keyword)
3057 10850 : CALL keyword_release(keyword)
3058 :
3059 : CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION", &
3060 : description="Defines whether the LDOS is integrated along a "// &
3061 : "coordinate. As an example, for INTEGRATION Z, the LDOS "// &
3062 : "$\rho(x,y,E) = \int dz\, \rho(x,y,z,E)$ is computed.", &
3063 : usage="INTEGRATION Z", &
3064 : enum_c_vals=s2a("X", "Y", "Z", "NONE"), &
3065 : enum_i_vals=[int_ldos_x, int_ldos_y, int_ldos_z, int_ldos_none], &
3066 : enum_desc=s2a("Integrate over x coordinate (not yet implemented).", &
3067 : "Integrate over y coordinate (not yet implemented).", &
3068 : "Integrate over z coordinate.", &
3069 : "No integration, print cube file as function "// &
3070 : "of x,y,z (not yet implemented)."), &
3071 10850 : default_i_val=int_ldos_z)
3072 10850 : CALL section_add_keyword(section, keyword)
3073 10850 : CALL keyword_release(keyword)
3074 :
3075 : CALL keyword_create( &
3076 : keyword, __LOCATION__, name="BIN_MESH", &
3077 : description="Mesh of size n x m for binning the space coordinates x and y of "// &
3078 : "the LDOS $\rho(x,y,E)$. If -1, no binning is performed and the "// &
3079 : "fine x, y resolution of the electron density from SCF is used.", &
3080 : usage="BIN_MESH n m", &
3081 10850 : n_var=2, type_of_var=integer_t, default_i_vals=[10, 10])
3082 10850 : CALL section_add_keyword(section, keyword)
3083 10850 : CALL keyword_release(keyword)
3084 :
3085 10850 : END SUBROUTINE create_ldos_section
3086 :
3087 : ! **************************************************************************************************
3088 : !> \brief creates an input section for a tip scan calculation
3089 : !> \param section section to create
3090 : !> \par History
3091 : !> * 04.2021 created [JGH]
3092 : ! **************************************************************************************************
3093 10850 : SUBROUTINE create_tipscan_section(section)
3094 : TYPE(section_type), POINTER :: section
3095 :
3096 : TYPE(keyword_type), POINTER :: keyword
3097 :
3098 10850 : CPASSERT(.NOT. ASSOCIATED(section))
3099 : CALL section_create(section, __LOCATION__, name="TIP_SCAN", &
3100 : description="Parameters needed to set up a Tip Scan. "// &
3101 : "Needs external definition of tip induced field.", &
3102 10850 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
3103 :
3104 10850 : NULLIFY (keyword)
3105 :
3106 : CALL keyword_create(keyword, __LOCATION__, &
3107 : name="_SECTION_PARAMETERS_", &
3108 : description="Controls the activation of the Tip Scan procedure", &
3109 : default_l_val=.FALSE., &
3110 10850 : lone_keyword_l_val=.TRUE.)
3111 10850 : CALL section_add_keyword(section, keyword)
3112 10850 : CALL keyword_release(keyword)
3113 :
3114 : CALL keyword_create(keyword, __LOCATION__, name="SCAN_DIRECTION", &
3115 : description="Defines scan direction and scan type(line, plane).", &
3116 : usage="SCAN_DIRECTION XY", &
3117 : enum_c_vals=s2a("X", "Y", "Z", "XY", "XZ", "YZ", "XYZ"), &
3118 : enum_i_vals=[scan_x, scan_y, scan_z, scan_xy, scan_xz, scan_yz, scan_xyz], &
3119 10850 : default_i_val=scan_xy)
3120 10850 : CALL section_add_keyword(section, keyword)
3121 10850 : CALL keyword_release(keyword)
3122 :
3123 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
3124 : description="The reference point to define the absolute position of the scan. ", &
3125 : usage="REFERENCE_POINT 0.0 0.0 1.0", &
3126 : n_var=3, default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp], type_of_var=real_t, &
3127 10850 : unit_str="angstrom")
3128 10850 : CALL section_add_keyword(section, keyword)
3129 10850 : CALL keyword_release(keyword)
3130 :
3131 : CALL keyword_create(keyword, __LOCATION__, name="SCAN_POINTS", &
3132 : description="Number of points calculated for each scan direction.", &
3133 : usage="SCAN_POINTS 20 20", &
3134 10850 : n_var=-1, type_of_var=integer_t)
3135 10850 : CALL section_add_keyword(section, keyword)
3136 10850 : CALL keyword_release(keyword)
3137 :
3138 : CALL keyword_create(keyword, __LOCATION__, name="SCAN_STEP", &
3139 : description="Step size for each scan direction.", &
3140 : usage="SCAN_STEP 0.01 0.01", &
3141 10850 : n_var=-1, type_of_var=real_t, unit_str="angstrom")
3142 10850 : CALL section_add_keyword(section, keyword)
3143 10850 : CALL keyword_release(keyword)
3144 :
3145 : CALL keyword_create(keyword, __LOCATION__, name="TIP_FILENAME", &
3146 : description="Filename of tip potential defined in cube file format.", &
3147 : usage="TIP_FILENAME <filename>", &
3148 10850 : type_of_var=lchar_t)
3149 10850 : CALL section_add_keyword(section, keyword)
3150 10850 : CALL keyword_release(keyword)
3151 :
3152 10850 : END SUBROUTINE create_tipscan_section
3153 :
3154 : ! **************************************************************************************************
3155 : !> \brief ...
3156 : !> \param section ...
3157 : !> \param section_name ...
3158 : !> \author Shridhar Shanbhag
3159 : ! **************************************************************************************************
3160 10850 : SUBROUTINE create_floquet_section(section)
3161 : TYPE(section_type), POINTER :: section
3162 :
3163 : TYPE(keyword_type), POINTER :: keyword
3164 :
3165 : CALL section_create(section, __LOCATION__, name="FLOQUET", &
3166 : description="Parameters controlling the calculation of the "// &
3167 : "Floquet band structure and Quasi-energies of a system driven "// &
3168 : "by a periodic monochromatic electric field with any arbitrary "// &
3169 : "polarisation state.", &
3170 10850 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
3171 10850 : NULLIFY (keyword)
3172 :
3173 : CALL keyword_create(keyword, __LOCATION__, name="AMPLITUDE", &
3174 : description="Electric field amplitude of the monochromatic light.", &
3175 : usage="AMPLITUDE [Vm-1] 1.0E9", n_var=1, type_of_var=real_t, &
3176 10850 : unit_str="Vm-1", default_r_val=0.0_dp)
3177 10850 : CALL section_add_keyword(section, keyword)
3178 10850 : CALL keyword_release(keyword)
3179 :
3180 : CALL keyword_create(keyword, __LOCATION__, name="FREQUENCY", &
3181 : description="Frequency of the electric field for Floquet calculations "// &
3182 : "expressed in terms of the energy of a photon in eV.", &
3183 : usage="FREQUENCY 1.5", unit_str="eV", n_var=1, type_of_var=real_t, &
3184 10850 : default_r_val=cp_unit_to_cp2k(value=1.0_dp, unit_str="eV"))
3185 10850 : CALL section_add_keyword(section, keyword)
3186 10850 : CALL keyword_release(keyword)
3187 :
3188 : CALL keyword_create(keyword, __LOCATION__, name="POLARISATION", &
3189 : description="Polarisation vector of the input light. The "// &
3190 : "amplitude in each direction is the product of the AMPLITUDE "// &
3191 : "and the POLARISATION vector component. Eg. for light polarized "// &
3192 : "in the x direction, use 1 0 0. For left-circularly polarized "// &
3193 : "light travelling in the +z direction use 1 1 0 and set "// &
3194 : "PHASE_OFFSET 0 0.5 0 for a +π/2 offset", &
3195 : usage="POLARISATION 0.0 0.0 1.0", &
3196 10850 : default_r_vals=[0.0_dp, 0.0_dp, 1.0_dp])
3197 10850 : CALL section_add_keyword(section, keyword)
3198 10850 : CALL keyword_release(keyword)
3199 :
3200 : CALL keyword_create(keyword, __LOCATION__, name="PHASE_OFFSETS", &
3201 : description="Phase offset of the electric field in the "// &
3202 : "x, y, and z directions given in multiples of π. For "// &
3203 : "linearly polarized light, use 0 0 0 and for left-circularly "// &
3204 : "polarized light travelling in the +z direction use "// &
3205 : "PHASE_OFFSET 0.0 0.5 0 ", &
3206 : usage="PHASE_OFFSETS 0.5 0 0", &
3207 10850 : default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp])
3208 10850 : CALL section_add_keyword(section, keyword)
3209 10850 : CALL keyword_release(keyword)
3210 :
3211 : CALL keyword_create(keyword, __LOCATION__, name="MAX_FLOQUET_INDEX", &
3212 : description="Largest absolute Floquet index up to which "// &
3213 : "Floquet Hamiltonian is truncated. Use a larger value to "// &
3214 : "ensure convergence at higher computational cost and a "// &
3215 : "smaller value for faster computation. EPS_FLOQUET checks "// &
3216 : "to ensure that the error due to truncation is small.", &
3217 : usage="MAX_FLOQUET_INDEX 50", &
3218 10850 : default_i_val=50)
3219 10850 : CALL section_add_keyword(section, keyword)
3220 10850 : CALL keyword_release(keyword)
3221 :
3222 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FLOQUET", &
3223 : description="Threshold on the error due to truncation of "// &
3224 : "the Floquet Hamiltonian. Used to verify that MAX_FLOQUET_INDEX "// &
3225 : "is large enough that truncation errors are small. "// &
3226 : "If negative, the check is removed (not recommended).", &
3227 10850 : usage="EPS_FLOQUET 1.e-10", default_r_val=1.0e-10_dp)
3228 10850 : CALL section_add_keyword(section, keyword)
3229 10850 : CALL keyword_release(keyword)
3230 :
3231 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
3232 : description="Half-width of the energy range, in eV, centred "// &
3233 : "on the Fermi level, over which the Floquet spectral "// &
3234 : "function is evaluated.", &
3235 : usage="ENERGY_WINDOW 5.0", &
3236 : default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"), &
3237 10850 : unit_str="eV")
3238 10850 : CALL section_add_keyword(section, keyword)
3239 10850 : CALL keyword_release(keyword)
3240 :
3241 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_STEP", &
3242 : description="Resolution of the energy E used to compute the "// &
3243 : "spectral function within the energy window.", &
3244 : usage="ENERGY_STEP 0.01", &
3245 : default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
3246 10850 : unit_str="eV")
3247 10850 : CALL section_add_keyword(section, keyword)
3248 10850 : CALL keyword_release(keyword)
3249 :
3250 : CALL keyword_create(keyword, __LOCATION__, name="BROADENING", &
3251 : description="Lorentzian broadening applied to the peaks of the "// &
3252 : "Floquet spectral function.", &
3253 : usage="BROADENING 0.02", &
3254 : default_r_val=cp_unit_to_cp2k(value=0.02_dp, unit_str="eV"), &
3255 10850 : unit_str="eV")
3256 10850 : CALL section_add_keyword(section, keyword)
3257 10850 : CALL keyword_release(keyword)
3258 :
3259 : CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
3260 : description="Electronic temperature (in K) of the wide-band fermion "// &
3261 : "bath used to weight the Floquet DOS by Fermi-Dirac occupations, adding "// &
3262 : "an occupied spectral-weight column f(E)*A(E) to the DOS file. If "// &
3263 : "negative (default), that column is not written.", &
3264 10850 : usage="TEMPERATURE 300.0", default_r_val=-1.0_dp)
3265 10850 : CALL section_add_keyword(section, keyword)
3266 10850 : CALL keyword_release(keyword)
3267 :
3268 : CALL keyword_create(keyword, __LOCATION__, name="FLOQUET_DOS_FILE_NAME", &
3269 : description="File name used for the Floquet spectral function.", &
3270 : usage="FLOQUET_DOS_FILE_NAME FLOQUET_DOS", &
3271 10850 : default_lc_val="FLOQUET_DOS")
3272 10850 : CALL section_add_keyword(section, keyword)
3273 10850 : CALL keyword_release(keyword)
3274 :
3275 : CALL keyword_create(keyword, __LOCATION__, name="QUASI_ENERGIES_FILE_NAME", &
3276 : description="File name used for the Floquet quasi-energies.", &
3277 : usage="QUASI_ENERGIES_FILE_NAME QUASI_ENERGIES", &
3278 10850 : default_lc_val="QUASI_ENERGIES")
3279 10850 : CALL section_add_keyword(section, keyword)
3280 10850 : CALL keyword_release(keyword)
3281 :
3282 : CALL keyword_create(keyword, __LOCATION__, name="FLOQUET_BS_FILE_NAME", &
3283 : description="File name used for the Floquet m=0 (central-sector) "// &
3284 : "band structure.", &
3285 : usage="FLOQUET_BS_FILE_NAME FLOQUET_BANDSTRUCTURE", &
3286 10850 : default_lc_val="FLOQUET_BANDSTRUCTURE")
3287 10850 : CALL section_add_keyword(section, keyword)
3288 10850 : CALL keyword_release(keyword)
3289 :
3290 : CALL keyword_create(keyword, __LOCATION__, name="MEM_FILL_FRACTION", &
3291 : description="Fraction of the computation memory that may be filled "// &
3292 : "by Floquet Hamiltonian matrices. Reduce if process gets OOMP killed.", &
3293 10850 : usage="MEM_FILL_FRACTION 0.5", default_r_val=0.8_dp)
3294 10850 : CALL section_add_keyword(section, keyword)
3295 10850 : CALL keyword_release(keyword)
3296 :
3297 10850 : END SUBROUTINE create_floquet_section
3298 :
3299 : END MODULE input_cp2k_properties_dft
|