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