61#include "./base/base_uses.f90"
66 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_mp2'
83 cpassert(.NOT.
ASSOCIATED(section))
84 CALL section_create(section, __location__, name=
"WF_CORRELATION", &
85 description=
"Controls wavefunction-based correlation methods such as MP2, "// &
86 "RI-MP2, RI-SOS-MP2, RI-RPA, and GW inside RI-RPA.", &
87 n_keywords=4, n_subsections=7, repeats=.true., &
92 NULLIFY (keyword, subsection)
95 keyword, __location__, &
97 description=
"Maximum allowed total memory usage during MP2 and related WF_CORRELATION methods [MiB].", &
98 usage=
"MEMORY 1500 ", &
99 default_r_val=1.024e+3_dp)
104 keyword, __location__, &
106 description=
"Gap energy for integration grids in Hartree. Defaults to -1.0 (automatic determination). "// &
107 "Recommended to set if several RPA or SOS-MP2 gradient calculations are requested or to be restarted. "// &
108 "In this way, differences of integration grids across different runs are removed as CP2K "// &
109 "does not include derivatives thereof.", &
111 default_r_val=-1.0_dp)
116 keyword, __location__, &
118 description=
"Energy range (ratio of largest and smallest) energy difference "// &
119 "of unoccupied and occupied orbitals for integration grids. Defaults to 0.0 (automatic determination). "// &
120 "Recommended to set if several RPA or SOS-MP2 gradient calculations are requested or to be restarted. "// &
121 "In this way, differences of integration grids across different runs are removed as CP2K "// &
122 "does not include derivatives thereof.", &
123 usage=
"E_RANGE 10.0", &
124 default_r_val=-1.0_dp)
129 keyword, __location__, &
131 description=
"Scaling factor of the singlet energy component (opposite spin, OS) of the "// &
132 "MP2, RI-MP2 and SOS-MP2 correlation energy. ", &
133 usage=
"SCALE_S 1.0", &
134 default_r_val=1.0_dp)
139 keyword, __location__, &
141 description=
"Scaling factor of the triplet energy component (same spin, SS) of the MP2 "// &
142 "and RI-MP2 correlation energy.", &
143 usage=
"SCALE_T 1.0", &
144 default_r_val=1.0_dp)
149 keyword, __location__, &
151 variants=[
"NUMBER_PROC"], &
152 description=
"Group size used in the computation of GPW and MME integrals and the MP2 correlation energy. "// &
153 "The group size must be a divisor of the total number of MPI ranks. "// &
154 "A smaller group size (for example the number of MPI ranks per node) "// &
155 "accelerates the computation of integrals but a too large group size increases communication costs. "// &
156 "A too small group size may lead to out of memory.", &
157 usage=
"GROUP_SIZE 2", &
163 CALL create_mp2_details_section(subsection)
167 CALL create_ri_mp2(subsection)
171 CALL create_ri_rpa(subsection)
175 CALL create_ri_laplace(subsection)
180 CALL create_low_scaling(subsection)
184 CALL create_ri_section(subsection)
188 CALL create_integrals_section(subsection)
192 CALL create_canonical_gradients(subsection)
198 description=
"Controls the printing basic info about WFC methods", &
209 SUBROUTINE create_mp2_details_section(section)
214 cpassert(.NOT.
ASSOCIATED(section))
216 description=
"Parameters influencing MP2 (non-RI).", &
217 n_keywords=3, n_subsections=0, repeats=.false.)
220 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
221 description=
"Activates MP2 calculations.", &
222 usage=
"&MP2 .TRUE.", &
223 default_l_val=.false., lone_keyword_l_val=.true.)
228 keyword, __location__, &
231 description=
"Selects the implementation used to compute the canonical MP2 energy.", &
232 usage=
"METHOD MP2_GPW", &
233 enum_c_vals=
s2a(
"NONE",
"DIRECT_CANONICAL",
"MP2_GPW"), &
235 enum_desc=
s2a(
"Skip MP2 calculation.", &
236 "Use the direct canonical MP2 approach.", &
237 "Use the GPW approach to MP2 integrals."), &
243 keyword, __location__, &
245 description=
"Influencing the direct canonical MP2 method: Send big "// &
246 "messages between processes (useful for >48 processors).", &
248 default_l_val=.true., &
249 lone_keyword_l_val=.true.)
253 END SUBROUTINE create_mp2_details_section
259 SUBROUTINE create_ri_mp2(section)
264 cpassert(.NOT.
ASSOCIATED(section))
266 description=
"Parameters influencing the RI-MP2 method. RI-MP2 supports gradients.", &
267 n_keywords=3, n_subsections=1, repeats=.false., &
271 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
272 description=
"Activates an RI-MP2 calculation.", &
273 usage=
"&RI_MP2 .TRUE.", &
274 default_l_val=.false., lone_keyword_l_val=.true.)
279 variants=[
"MESSAGE_SIZE"], &
280 description=
"Determines the blocking used for communication in RI-MP2. Larger BLOCK_SIZE "// &
281 "reduces communication but requires more memory. The default (-1) is automatic.", &
282 usage=
"BLOCK_SIZE 2", &
287 CALL keyword_create(keyword, __location__, name=
"NUMBER_INTEGRATION_GROUPS", &
288 description=
"Sets the number of integration groups of the communication scheme in RI-MP2. "// &
289 "Integrals will be replicated such that each integration group has all integrals available. "// &
290 "Must be a divisor of the number of subgroups (see GROUP_SIZE keyword in the WF_CORRELATION "// &
291 "section. Smaller groups reduce the communication costs but increase the memory developments. "// &
292 "If the provided value is non-positive or not a divisor of the number of subgroups, "// &
293 "the number of integration groups is determined automatically (default).", &
294 usage=
"NUMBER_INTEGRATION_GROUPS 2", &
300 keyword, __location__, &
301 name=
"PRINT_DGEMM_INFO", &
302 description=
"Print details about all DGEMM calls.", &
303 lone_keyword_l_val=.true., &
304 default_l_val=.false.)
308 END SUBROUTINE create_ri_mp2
314 SUBROUTINE create_opt_ri_basis(section)
319 cpassert(.NOT.
ASSOCIATED(section))
321 description=
"Parameters influencing the optimization of the RI MP2 basis. "// &
322 "Only exponents of non-contracted auxiliary basis can be optimized. "// &
323 "An initial RI auxiliary basis has to be specified.", &
324 n_keywords=6, n_subsections=0, repeats=.false., &
327 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
328 description=
"Putting the &OPT_RI_BASIS section activates optimization of RI basis.", &
329 usage=
"&OPT_RI_BASIS .TRUE.", &
330 default_l_val=.false., lone_keyword_l_val=.true.)
335 variants=[
"DI_REL"], &
336 description=
"Target accuracy in the relative deviation of the amplitudes calculated with "// &
337 "and without RI approximation, (more details in Chem.Phys.Lett.294(1998)143).", &
338 usage=
"DELTA_I_REL 1.0E-6_dp", &
339 default_r_val=1.0e-6_dp)
345 description=
"Target accuracy in the absolute difference between the RI-MP2 "// &
346 "and the exact MP2 energy, DRI=ABS(E_MP2-E_RI-MP2).", &
347 usage=
"DELTA_RI 1.0E-6_dp", &
348 default_r_val=5.0e-6_dp)
353 variants=[
"EPS_NUM_DERIV"], &
354 description=
"The derivatives of the MP2 energy with respect to the "// &
355 "exponents of the basis are calculated numerically. "// &
356 "The change in the exponent a_i employed for the numerical evaluation "// &
357 "is defined as h_i=EPS_DERIV*a_i.", &
358 usage=
"EPS_DERIV 1.0E-3_dp", &
359 default_r_val=1.0e-3_dp)
364 variants=[
"MAX_NUM_ITER"], &
365 description=
"Specifies the maximum number of steps in the RI basis optimization.", &
366 usage=
"MAX_ITER 100", &
372 description=
"Specifies the number of function, for each angular momentum (s, p, d ...), "// &
373 "employed in the automatically generated initial guess. "// &
374 "This will be effective only if RI_AUX_BASIS_SET in the KIND section is not specified.", &
375 usage=
"NUM_FUNC {number of s func.} {number of p func.} ...", &
376 n_var=-1, default_i_vals=[-1], type_of_var=
integer_t)
381 description=
"Specifies the size of the auxiliary basis set automatically "// &
382 "generated as initial guess. This will be effective only if RI_AUX_BASIS_SET "// &
383 "in the KIND section and NUM_FUNC are not specified.", &
384 usage=
"BASIS_SIZE (MEDIUM|LARGE|VERY_LARGE)", &
385 enum_c_vals=
s2a(
"MEDIUM",
"LARGE",
"VERY_LARGE"), &
386 enum_i_vals=[0, 1, 2], &
391 END SUBROUTINE create_opt_ri_basis
397 SUBROUTINE create_ri_laplace(section)
402 cpassert(.NOT.
ASSOCIATED(section))
404 description=
"Parameters influencing the RI-SOS-MP2-Laplace method", &
405 n_keywords=3, n_subsections=1, repeats=.false., &
409 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
410 description=
"Putting the &RI_SOS_MP2 section activates RI-SOS-MP2 calculation.", &
411 usage=
"&RI_SOS_MP2 .TRUE.", &
412 default_l_val=.false., lone_keyword_l_val=.true.)
417 keyword, __location__, name=
"QUADRATURE_POINTS", &
418 variants=[
"LAPLACE_NUM_QUAD_POINTS"], &
419 description=
"Number of quadrature points for the numerical integration in the RI-SOS-MP2-Laplace method.", &
420 usage=
"QUADRATURE_POINTS 6", &
426 keyword, __location__, name=
"NUM_INTEG_GROUPS", &
427 description=
"Number of groups for the integration in the Laplace method. Each groups processes "// &
428 "the same amount of quadrature points. It must be a divisor of the number of quadrature points and "// &
429 "NUM_INTEG_GROUPS*GROUP_SIZE must be a divisor of the total number of processes. The default (-1) is automatic.", &
430 usage=
"NUM_INTEG_GROUPS 2", &
435 END SUBROUTINE create_ri_laplace
441 SUBROUTINE create_canonical_gradients(section)
447 cpassert(.NOT.
ASSOCIATED(section))
448 CALL section_create(section, __location__, name=
"CANONICAL_GRADIENTS", &
449 description=
"Parameters influencing gradient calculations of canonical RI methods. "// &
450 "Ignored if the IM_TIME section is set.", &
451 n_keywords=3, n_subsections=1, repeats=.false., &
454 NULLIFY (subsection, keyword)
455 CALL create_cphf(subsection)
459 CALL keyword_create(keyword, __location__, name=
"EPS_CANONICAL", &
460 description=
"Threshold under which a given ij or ab pair is considered to be degenerate and "// &
461 "its contribution to the density matrix is calculated directly. "// &
462 "Ignored in case of energy-only calculation.", &
463 usage=
"EPS_CANONICAL 1.0E-8", type_of_var=
real_t, &
464 default_r_val=1.0e-7_dp)
469 keyword, __location__, &
470 name=
"FREE_HFX_BUFFER", &
471 description=
"Free the buffer containing the 4 center integrals used in the Hartree-Fock exchange calculation. "// &
472 "Ignored for energy-only calculations. May fail.", &
473 usage=
"FREE_HFX_BUFFER", &
474 default_l_val=.false., &
475 lone_keyword_l_val=.true.)
480 keyword, __location__, &
481 name=
"DOT_PRODUCT_BLKSIZE", &
482 description=
"Dot products for the calculation of the RPA/SOS-MP2 density matrices "// &
483 "are calculated in batches of the size given by this keyword. Larger block sizes "// &
484 "improve the performance but reduce the numerical accuracy. Recommended block sizes are multiples of the number of "// &
485 "doubles per cache line (usually 8). Ignored with MP2 gradients. Set it to -1 to prevent blocking.", &
491 keyword, __location__, &
492 name=
"MAX_PARALLEL_COMM", &
493 description=
"Sets the maximum number of parallel communication steps of the non-blocking communication scheme. "// &
494 "The number of channels is determined from the available memory. If set to a value smaller than one, "// &
495 "CP2K will use all memory for communication. A value of one enforces the blocking communication scheme "// &
496 "increasing the communication costs.", &
501 END SUBROUTINE create_canonical_gradients
507 SUBROUTINE create_ri_rpa(section)
513 cpassert(.NOT.
ASSOCIATED(section))
515 description=
"Controls RI-RPA and GW calculations.", &
516 n_keywords=8, n_subsections=4, repeats=.false., &
519 NULLIFY (keyword, subsection)
520 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
521 description=
"Activates an RI-RPA calculation.", &
522 usage=
"&RI_RPA .TRUE.", &
523 default_l_val=.false., lone_keyword_l_val=.true.)
528 keyword, __location__, &
529 name=
"SIGMA_FUNCTIONAL", &
530 description=
"Determine parametrization for sigma-functional", &
531 usage=
"SIGMA_FUNCTIONAL PBE_S2", &
532 enum_c_vals=
s2a(
"NONE",
"PBE0_S1",
"PBE0_S2",
"PBE_S1",
"PBE_S2"), &
534 enum_desc=
s2a(
"No sigma functional calculation", &
535 "use parameters based on PBE0 with S1 set.", &
536 "use parameters based on PBE0 with S2 set.", &
537 "use parameters based on PBE with S1 set.", &
538 "use parameters based on PBE with S2 set." &
544 CALL keyword_create(keyword, __location__, name=
"QUADRATURE_POINTS", &
545 variants=[
"RPA_NUM_QUAD_POINTS"], &
546 description=
"Number of quadrature points for the RI-RPA numerical integration.", &
547 usage=
"QUADRATURE_POINTS 60", &
552 CALL keyword_create(keyword, __location__, name=
"NUM_INTEG_GROUPS", &
553 description=
"Number of groups for the integration in the Laplace method. Each groups processes "// &
554 "the same amount of quadrature points. It must be a divisor of the number of quadrature points and "// &
555 "NUM_INTEG_GROUPS*GROUP_SIZE must be a divisor of the total number of processes. "// &
556 "The default (-1) is automatic.", &
557 usage=
"NUM_INTEG_GROUPS 2", &
564 description=
"Matrix multiplication style for the Q matrix.", &
565 usage=
"MM_STYLE GEMM", &
566 enum_c_vals=
s2a(
"GEMM",
"SYRK"), &
568 enum_desc=
s2a(
"Use pdgemm: more flops, maybe faster.", &
569 "Use pdysrk: fewer flops, maybe slower."), &
575 keyword, __location__, &
576 name=
"MINIMAX_QUADRATURE", &
577 variants=[
"MINIMAX"], &
578 description=
"Use the Minimax quadrature scheme for the numerical integration. "// &
579 "It usually needs fewer quadrature points than Clenshaw-Curtis but is limited to 20 points.", &
580 usage=
"MINIMAX_QUADRATURE", &
581 default_l_val=.false., &
582 lone_keyword_l_val=.true.)
587 keyword, __location__, &
590 description=
"Decide whether to add singles correction.", &
592 default_l_val=.false., &
593 lone_keyword_l_val=.true.)
598 keyword, __location__, &
600 description=
"Decide whether to use ADMM in the exact-exchange calculation for RPA and/or GW. "// &
601 "The ADMM XC correction is governed by the AUXILIARY_DENSITY_MATRIX_METHOD section in &DFT. "// &
602 "ADMM can provide significant speedup and memory savings, especially with diffuse basis sets. "// &
603 "For GW band-gap calculations, RI_SIGMA_X can also be used. ", &
605 default_l_val=.false., &
606 lone_keyword_l_val=.true.)
611 keyword, __location__, &
613 description=
"Scales RPA energy contributions (RPA, exchange correction).", &
614 usage=
"SCALE_RPA 1.0", &
615 default_r_val=1.0_dp)
620 keyword, __location__, &
621 name=
"PRINT_DGEMM_INFO", &
622 description=
"Print details about all DGEMM calls.", &
623 lone_keyword_l_val=.true., &
624 default_l_val=.false.)
634 CALL create_ri_g0w0(subsection)
639 CALL create_rpa_exchange(subsection)
643 END SUBROUTINE create_ri_rpa
649 SUBROUTINE create_rpa_exchange(section)
654 cpassert(.NOT.
ASSOCIATED(section))
655 CALL section_create(section, __location__, name=
"EXCHANGE_CORRECTION", &
656 description=
"Parameters influencing exchange corrections to RPA. No gradients available.", &
657 n_keywords=3, n_subsections=1, repeats=.false.)
660 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
661 description=
"Choose the kind of exchange correction.", &
662 usage=
"&EXCHANGE_CORRECTION AXK", &
663 enum_c_vals=
s2a(
"NONE",
"AXK",
"SOSEX"), &
665 enum_desc=
s2a(
"Apply no exchange correction.", &
666 "Apply Approximate eXchange Kernel (AXK) correction.", &
667 "Apply Second Order Screened eXchange (SOSEX) correction."), &
673 keyword, __location__, &
675 description=
"Choose the block size of the contraction step. Larger block sizes improve performance but "// &
676 "require more memory (quadratically!, number of stored elements: $o^2\cdot N_B^2$). "// &
677 "Nonpositive numbers turn off blocking.", &
678 usage=
"BLOCK_SIZE 1", &
684 keyword, __location__, &
685 name=
"USE_HFX_IMPLEMENTATION", &
686 description=
"Use a HF-based implementation with RI_RPA%HF section. Recommended for large systems.", &
687 usage=
"USE_HFX_IMPLEMENTATION T", &
688 default_l_val=.false., lone_keyword_l_val=.true.)
692 END SUBROUTINE create_rpa_exchange
698 SUBROUTINE create_ri_g0w0(section)
704 cpassert(.NOT.
ASSOCIATED(section))
706 description=
"Parameters influencing GW calculations on molecules, "// &
707 "see also 'Electronic band structure from GW', "// &
708 "https://manual.cp2k.org/trunk/methods/properties/bandstructure_gw.html.", &
709 n_keywords=24, n_subsections=1, repeats=.false.)
711 NULLIFY (keyword, subsection)
713 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
714 description=
"Activates GW calculations.", &
715 usage=
"&GW .TRUE.", &
716 default_l_val=.false., lone_keyword_l_val=.true.)
720 CALL keyword_create(keyword, __location__, name=
"SELF_CONSISTENCY", &
721 description=
"Decide the level of self-consistency of eigenvalues "// &
722 "(= quasiparticle energies = single-electron energies) in GW. "// &
723 "Updates of Kohn-Sham orbitals (for example qsGW) are not implemented. "// &
724 "For details which type of eigenvalue self-consistency might be good, "// &
725 "please consult Golze, Dvorak, Rinke, Front. Chem. 2019.", &
726 usage=
"SELF_CONSISTENCY evGW0", &
727 enum_c_vals=
s2a(
"G0W0",
"evGW0",
"evGW"), &
729 enum_desc=
s2a(
"Use DFT eigenvalues; not update.", &
730 "Update DFT eigenvalues in G, not in W.", &
731 "Update DFT eigenvalues in G and W."), &
737 variants=[
"CORR_OCC"], &
738 description=
"Number of occupied MOs whose energies are corrected in GW. "// &
739 "Counting beginning from HOMO, e.g. 3 corrected occ. MOs correspond "// &
740 "to correction of HOMO, HOMO-1 and HOMO-2. Numerical effort and "// &
741 "storage of RI-G0W0 increase linearly with this number. In case you "// &
742 "want to correct all occ. MOs, insert either a negative number or "// &
743 "a number larger than the number of occ. MOs. Invoking CORR_MOS_OCC -2 "// &
744 "together with a BSE cutoff, sets a sufficiently large CORR_MOS_OCC "// &
745 "for the given BSE cutoff deduced from DFT eigenvalues.", &
746 usage=
"CORR_OCC 3", &
751 CALL keyword_create(keyword, __location__, name=
"CORR_MOS_VIRT", &
752 variants=[
"CORR_VIRT"], &
753 description=
"Number of virtual MOs whose energies are corrected by GW. "// &
754 "Counting beginning from LUMO, e.g. 3 corrected occ. MOs correspond "// &
755 "to correction of LUMO, LUMO+1 and LUMO+2. Numerical effort and "// &
756 "storage of RI-G0W0 increase linearly with this number. In case you "// &
757 "want to correct all virt. MOs, insert either a negative number or "// &
758 "a number larger than the number of virt. MOs. Invoking CORR_MOS_VIRT -2 "// &
759 "together with a BSE cutoff, sets a sufficiently large CORR_MOS_VIRT "// &
760 "for the given BSE cutoff deduced from DFT eigenvalues.", &
761 usage=
"CORR_VIRT 3", &
767 description=
"Number of poles for the fitting. Usually, two poles are sufficient. ", &
768 usage=
"NUMB_POLES 2", &
773 CALL keyword_create(keyword, __location__, name=
"OMEGA_MAX_FIT", &
774 description=
"Determines fitting range for the self-energy on the imaginary axis: "// &
775 "[0, OMEGA_MAX_FIT] for virt orbitals, [-OMEGA_MAX_FIT,0] for occ orbitals. "// &
776 "Unit: Hartree. Default: 0.734996 H = 20 eV. ", &
777 usage=
"OMEGA_MAX_FIT 0.5", &
778 default_r_val=0.734996_dp)
782 CALL keyword_create(keyword, __location__, name=
"CROSSING_SEARCH", &
783 description=
"Determines, how the self_energy is evaluated on the real axis.", &
784 usage=
"CROSSING_SEARCH Z_SHOT", &
785 enum_c_vals=
s2a(
"Z_SHOT",
"NEWTON",
"BISECTION"), &
788 enum_desc=
s2a(
"Calculate the derivative of Sigma and out of it Z. Then extrapolate using Z.", &
789 "Make a Newton-Raphson fix point iteration.", &
790 "Make a bisection fix point iteration."), &
795 CALL keyword_create(keyword, __location__, name=
"FERMI_LEVEL_OFFSET", &
796 description=
"Fermi level for occ. orbitals: e_HOMO + FERMI_LEVEL_OFFSET; "// &
797 "Fermi level for virt. orbitals: e_LUMO - FERMI_LEVEL_OFFSET. "// &
798 "In case e_homo + FERMI_LEVEL_OFFSET < e_lumo - FERMI_LEVEL_OFFSET, "// &
799 "we set Fermi level = (e_HOMO+e_LUMO)/2. For cubic-scaling GW, the Fermi level "// &
800 "is always equal to (e_HOMO+e_LUMO)/2 regardless of FERMI_LEVEL_OFFSET.", &
801 usage=
"FERMI_LEVEL_OFFSET 1.0E-2", &
802 default_r_val=2.0e-2_dp)
807 description=
"If true, use Hedin's shift in G0W0, evGW and evGW0 "// &
808 "(aka scGW0). Details see in Li et al. JCTC 18, 7570 "// &
809 "(2022), Figure 1. G0W0 with Hedin's shift should give "// &
810 "similar GW eigenvalues as evGW0; at a lower "// &
811 "computational cost.", &
812 usage=
"HEDIN_SHIFT", &
813 default_l_val=.false., &
814 lone_keyword_l_val=.true.)
819 description=
"Maximum number of iterations for eigenvalue "// &
820 "self-consistency cycle. The computational effort of GW scales "// &
821 "linearly with this number. In case of choosing "// &
822 "GW_SELF_CONSISTENCY EVGW, the code sets EV_GW_ITER 10.", &
823 usage=
"EV_GW_ITER 3", &
829 description=
"Maximum number of iterations for GW0 "// &
830 "self-consistency cycle. The computational effort "// &
831 "of GW is not much affected by the number of scGW0 cycles. "// &
832 "In case of choosing "// &
833 "GW_SELF_CONSISTENCY EVGW0, the code sets SC_GW0_ITER 10.", &
834 usage=
"SC_GW0_ITER 3", &
840 description=
"Target accuracy for the eigenvalue self-consistency. "// &
841 "If the G0W0 HOMO-LUMO gap differs by less than the "// &
842 "target accuracy during the iteration, the eigenvalue "// &
843 "self-consistency cycle stops. Unit: Hartree.", &
844 usage=
"EPS_ITER 0.00005", &
852 description=
"Print exchange self-energy minus exchange correlation potential for Gamma-only "// &
853 "calculation (PRINT). For a GW calculation with k-points we use this output as "// &
854 "exchange self-energy (READ). This is a temporary solution because the hybrid MPI/OMP "// &
855 "parallelization in the HFX by Manuel Guidon conflicts with the parallelization in "// &
856 "low-scaling GW k-points which is most efficient with maximum number of MPI tasks and "// &
857 "minimum number of OMP threads. For HFX by M. Guidon, the density matrix is "// &
858 "fully replicated on every MPI rank which necessitates a high number of OMP threads per MPI "// &
859 "rank for large systems to prevent out of memory. "// &
860 "Such a high number of OMP threads would slow down the GW calculation "// &
861 "severely. Therefore, it was decided to temporarily divide the GW k-point calculation in a "// &
862 "Gamma-only HF calculation with high number of OMP threads to prevent out of memory and "// &
863 "a GW k-point calculation with 1 OMP thread per MPI rank reading the previousHF output.", &
864 usage=
"PRINT_EXX TRUE", &
865 enum_c_vals=
s2a(
"TRUE",
"FALSE",
"READ",
"SKIP_FOR_REGTEST"), &
867 enum_desc=
s2a(
"Please, put TRUE for Gamma only calculation to get the exchange self-energy. "// &
868 "If 'SIGMA_X' and the corresponding values for the exchange-energy are written, "// &
869 "the writing has been successful", &
870 "FALSE is needed if you want to do nothing here.", &
871 "Please, put READ for the k-point GW calculation to read the exact exchange. "// &
872 "You have to provide an output file including the exact exchange. This file "// &
873 "has to be named 'exx.dat'.", &
874 "SKIP_FOR_REGTEST is only used for the GW k-point regtest where no exchange "// &
875 "self-energy is computed."), &
880 CALL keyword_create(keyword, __location__, name=
"PRINT_SELF_ENERGY", &
881 description=
"If true, print the self-energy for all levels for real energy "// &
882 "together with the straight line to see the quasiparticle energy as intersection. "// &
883 "In addition, prints the self-energy for imaginary frequencies together with the Pade fit.", &
884 usage=
"PRINT_SELF_ENERGY", &
885 default_l_val=.false., &
886 lone_keyword_l_val=.true.)
891 description=
"If true, the exchange self-energy is calculated approximatively with RI. "// &
892 "If false, the Hartree-Fock implementation in CP2K is used.", &
893 usage=
"RI_SIGMA_X", &
894 default_l_val=.true., &
895 lone_keyword_l_val=.true.)
900 description=
"List of image charge correction from a previous calculation to be applied in G0W0 "// &
901 "or evGW. Keyword is active, if the first entry is positive (since IC corrections are positive "// &
902 "occupied MOs. The start corresponds to the first corrected GW level.", &
903 usage=
"IC_CORR_LIST <REAL> ... <REAL>", &
904 default_r_vals=[-1.0_dp], &
905 type_of_var=
real_t, n_var=-1, unit_str=
"eV")
909 CALL keyword_create(keyword, __location__, name=
"IC_CORR_LIST_BETA", &
910 description=
"IC_CORR_LIST for beta spins in case of open shell calculation.", &
911 usage=
"IC_CORR_LIST_BETA <REAL> ... <REAL>", &
912 default_r_vals=[-1.0_dp], &
913 type_of_var=
real_t, n_var=-1, unit_str=
"eV")
917 CALL keyword_create(keyword, __location__, name=
"PERIODIC_CORRECTION", &
918 description=
"If true, the periodic correction scheme is used employing k-points. "// &
919 "Method is not recommended to use, use instead PERIODIC_LOW_SCALING which much "// &
920 "more accurate than the periodic correction.", &
921 usage=
"PERIODIC_CORRECTION", &
922 default_l_val=.false., &
923 lone_keyword_l_val=.true.)
927 CALL keyword_create(keyword, __location__, name=
"IMAGE_CHARGE_MODEL", &
929 description=
"If true, an image charge model is applied to mimic the renormalization of "// &
930 "electronic levels of a molecule at a metallic surface. For this calculation, the molecule "// &
931 "has to be reflected on the desired xy image plane. The coordinates of the reflected molecule "// &
932 "have to be added to the coord file as ghost atoms. For the ghost atoms, identical basis sets "// &
933 "the normal atoms have to be used.", &
935 default_l_val=.false., &
936 lone_keyword_l_val=.true.)
940 CALL keyword_create(keyword, __location__, name=
"ANALYTIC_CONTINUATION", &
941 description=
"Defines which type of analytic continuation for the self energy is used", &
942 usage=
"ANALYTIC_CONTINUATION", &
943 enum_c_vals=
s2a(
"TWO_POLE",
"PADE"), &
945 enum_desc=
s2a(
"Use 'two-pole' model.", &
946 "Use Pade approximation."), &
952 description=
"Number of parameters for the Pade approximation "// &
953 "when using the latter for the analytic continuation of the "// &
954 "self energy. 16 parameters (corresponding to 8 poles) are "// &
955 "are recommended.", &
956 usage=
"NPARAM_PADE 16", &
961 CALL keyword_create(keyword, __location__, name=
"GAMMA_ONLY_SIGMA", &
962 variants=[
"GAMMA"], &
963 description=
"If true, the correlation self-energy is only computed at the Gamma point. "// &
964 "The Gamma point itself is obtained by averaging over all kpoints of the DFT mesh.", &
965 usage=
"GAMMA TRUE", &
966 default_l_val=.false., &
967 lone_keyword_l_val=.true.)
971 CALL keyword_create(keyword, __location__, name=
"UPDATE_XC_ENERGY", &
972 description=
"If true, the Hartree-Fock and RPA total energy are printed and the total energy "// &
973 "is corrected using exact exchange and the RPA correlation energy.", &
974 usage=
"UPDATE_XC_ENERGY", &
975 default_l_val=.false., &
976 lone_keyword_l_val=.true.)
980 CALL keyword_create(keyword, __location__, name=
"KPOINTS_SELF_ENERGY", &
981 description=
"Specify number of k-points for the k-point grid of the self-energy. Internally, a "// &
982 "Monkhorst-Pack grid is used. A dense k-point grid may be necessary to compute an accurate density "// &
983 "of state from GW. Large self-energy k-meshes do not cost much more computation time.", &
984 usage=
"KPOINTS_SELF_ENERGY nx ny nz", repeats=.true., &
985 n_var=3, type_of_var=
integer_t, default_i_vals=[0, 0, 0])
989 CALL keyword_create(keyword, __location__, name=
"REGULARIZATION_MINIMAX", &
990 description=
"Tikhonov regularization for computing weights of the Fourier transform "// &
991 "from imaginary time to imaginary frequency and vice versa. Needed for large minimax "// &
992 "grids with 20 or more points and a small range.", &
993 usage=
"REGULARIZATION_MINIMAX 1.0E-6", &
994 default_r_val=0.0_dp)
999 description=
"Calculate the spin-orbit splitting of the eigenvalues/band structure "// &
1000 "using the spin-orbit part of the GTH pseudos parametrized in Hartwigsen, Goedecker, "// &
1001 "Hutter, Phys. Rev. B 58, 3641 (1998), Eq. 19, "// &
1002 "parameters in Table I.", &
1004 enum_c_vals=
s2a(
"NONE",
"LDA",
"PBE"), &
1006 enum_desc=
s2a(
"No SOC.", &
1007 "Use parameters from LDA (PADE) pseudopotential.", &
1008 "Use parameters from PBE pseudopotential."), &
1013 CALL keyword_create(keyword, __location__, name=
"SOC_ENERGY_WINDOW", &
1014 description=
"For perturbative SOC calculation, only "// &
1015 "take frontier levels in an energy window "// &
1016 "[E_HOMO - SOC_ENERGY_WINDOW/2 , E_LUMO + SOC_ENERGY_WINDOW/2 "// &
1017 "into account for the diagonalization of H^GW,SOC.", &
1018 usage=
"SOC_ENERGY_WINDOW 20.0_eV", &
1025 CALL create_periodic_gw_correction_section(subsection)
1030 CALL create_bse_section(subsection)
1035 CALL create_ic_section(subsection)
1045 CALL create_print_section(subsection)
1049 END SUBROUTINE create_ri_g0w0
1055 SUBROUTINE create_print_section(section)
1059 TYPE(
section_type),
POINTER :: gw_dos_section, print_key
1061 cpassert(.NOT.
ASSOCIATED(section))
1062 NULLIFY (print_key, keyword)
1063 NULLIFY (gw_dos_section, keyword)
1065 description=
"Section of possible print options specific for the GW code.", &
1066 n_keywords=0, n_subsections=2, repeats=.false.)
1069 description=
"Prints a local bandgap E_gap(r), derived from the local density of "// &
1070 "states rho(r,E). Details and formulae in the SI of the periodic GW paper (2023).", &
1072 filename=
"LOCAL_BANDGAP", &
1073 common_iter_levels=3)
1075 CALL keyword_create(keyword, __location__, name=
"ENERGY_WINDOW", &
1076 description=
"Energy window in the LDOS for searching the gap.", &
1077 usage=
"ENERGY_WINDOW 6.0", &
1083 CALL keyword_create(keyword, __location__, name=
"ENERGY_SPACING", &
1084 description=
"Energy spacing of the LDOS for searching the gap.", &
1085 usage=
"ENERGY_SPACING 0.03", &
1091 CALL keyword_create(keyword, __location__, name=
"LDOS_THRESHOLD_GAP", &
1092 description=
"Relative LDOS threshold that determines the local bandgap.", &
1093 usage=
"LDOS_THRESHOLD_GAP 0.1", &
1094 default_r_val=0.1_dp)
1099 description=
"The stride (X,Y,Z) used to write the cube file "// &
1100 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1101 " 1 number valid for all components.", &
1102 usage=
"STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=
integer_t)
1109 CALL section_create(gw_dos_section, __location__, name=
"GW_DOS", &
1110 description=
"Section for printing the spectral function.", &
1111 n_keywords=6, n_subsections=0, repeats=.false.)
1114 description=
"Lower bound for GW-DOS in eV.", &
1115 usage=
"LOWER_BOUND -20.0", &
1122 description=
"Upper bound for GW-DOS in eV.", &
1123 usage=
"UPPER_BOUND 5.0", &
1130 description=
"Difference of two consecutive energy levels for GW-DOS.", &
1137 CALL keyword_create(keyword, __location__, name=
"MIN_LEVEL_SPECTRAL", &
1138 description=
"Lowest energy level to print the self energy to files.", &
1139 usage=
"MIN_LEVEL_SPECTRAL 3", &
1144 CALL keyword_create(keyword, __location__, name=
"MAX_LEVEL_SPECTRAL", &
1145 description=
"Highest energy level to print the self energy to files.", &
1146 usage=
"MAX_LEVEL_SPECTRAL 6", &
1151 CALL keyword_create(keyword, __location__, name=
"MIN_LEVEL_SELF_ENERGY", &
1152 description=
"Lowest energy level to print the self energy to files.", &
1153 usage=
"MIN_LEVEL_SELF_ENERGY 3", &
1158 CALL keyword_create(keyword, __location__, name=
"MAX_LEVEL_SELF_ENERGY", &
1159 description=
"Highest energy level to print the self energy to files.", &
1160 usage=
"MAX_LEVEL_SELF_ENERGY 6", &
1166 description=
"Broadening parameter for spectral function.", &
1167 usage=
"BROADENING 0.001", &
1176 END SUBROUTINE create_print_section
1182 SUBROUTINE create_periodic_gw_correction_section(section)
1187 cpassert(.NOT.
ASSOCIATED(section))
1188 CALL section_create(section, __location__, name=
"PERIODIC_CORRECTION", &
1189 description=
"Parameters influencing correction for periodic GW. Old method, "// &
1190 "not recommended to use", &
1191 n_keywords=12, n_subsections=1, repeats=.false.)
1196 description=
"Specify number of k-points for a single k-point grid. Internally, a "// &
1197 "Monkhorst-Pack grid is used. Typically, even numbers are chosen such that the Gamma "// &
1198 "point is excluded from the k-point mesh.", &
1199 usage=
"KPOINTS nx ny nz", repeats=.true., &
1200 n_var=3, type_of_var=
integer_t, default_i_vals=[16, 16, 16])
1204 CALL keyword_create(keyword, __location__, name=
"NUM_KP_GRIDS", &
1205 description=
"Number of k-point grids around the Gamma point with different resolution. "// &
1206 "E.g. for KPOINTS 4 4 4 and NUM_KP_GRIDS 3, there will be a 3x3x3 Monkhorst-Pack (MP) k-point "// &
1207 "grid for the whole Brillouin zone (excluding Gamma), another 3x3x3 MP grid with smaller "// &
1208 "spacing around Gamma (again excluding Gamma) and a very fine 4x4x4 MP grid around Gamma.", &
1209 usage=
"NUM_KP_GRIDS 5", &
1215 description=
"If the absolute value of a k-point is below EPS_KPOINT, this kpoint is "// &
1216 "neglected since the Gamma point is not included in the periodic correction.", &
1217 usage=
"EPS_KPOINT 1.0E-4", &
1218 default_r_val=1.0e-05_dp)
1222 CALL keyword_create(keyword, __location__, name=
"MO_COEFF_GAMMA", &
1223 description=
"If true, only the MO coefficients at the Gamma point are used for the periodic "// &
1224 "correction. Otherwise, the MO coeffs are computed at every k-point which is much more "// &
1225 "expensive. It should be okay to use the Gamma MO coefficients.", &
1226 usage=
"MO_COEFF_GAMMA", &
1227 default_l_val=.true., &
1228 lone_keyword_l_val=.true.)
1232 CALL keyword_create(keyword, __location__, name=
"AVERAGE_DEGENERATE_LEVELS", &
1234 description=
"If true, the correlation self-energy of degenerate levels is averaged.", &
1235 usage=
"AVERAGE_DEGENERATE_LEVELS", &
1236 default_l_val=.true., &
1237 lone_keyword_l_val=.true.)
1241 CALL keyword_create(keyword, __location__, name=
"EPS_EIGENVAL", &
1242 description=
"Threshold for considering levels as degenerate. Unit: Hartree.", &
1243 usage=
"EPS_EIGENVAL 1.0E-5", &
1244 default_r_val=2.0e-04_dp)
1248 CALL keyword_create(keyword, __location__, name=
"EXTRAPOLATE_KPOINTS", &
1249 variants=[
"EXTRAPOLATE"], &
1250 description=
"If true, extrapolates the k-point mesh. Only working if k-point mesh numbers are "// &
1251 "divisible by 4, e.g. 8x8x8 or 12x12x12 is recommended.", &
1252 usage=
"EXTRAPOLATE_KPOINTS FALSE", &
1253 default_l_val=.true., &
1254 lone_keyword_l_val=.true.)
1258 CALL keyword_create(keyword, __location__, name=
"DO_AUX_BAS_GW", &
1259 description=
"If true, use a different basis for the periodic correction. This can be necessary "// &
1260 "in case a diffused basis is used for GW to converge the HOMO-LUMO gap. In this case, "// &
1261 "numerical problems may occur due to diffuse functions in the basis. This keyword only works if "// &
1262 "AUX_GW <basis set> is specified in the kind section for every atom kind.", &
1263 usage=
"DO_AUX_BAS_GW TRUE", &
1264 default_l_val=.false., &
1265 lone_keyword_l_val=.true.)
1269 CALL keyword_create(keyword, __location__, name=
"FRACTION_AUX_MOS", &
1270 description=
"Fraction how many MOs are used in the auxiliary basis.", &
1271 usage=
"FRACTION_AUX_MOS 0.6", &
1272 default_r_val=0.5_dp)
1276 CALL keyword_create(keyword, __location__, name=
"NUM_OMEGA_POINTS", &
1277 description=
"Number of Clenshaw-Curtis integration points for the periodic correction in cubic- "// &
1278 "scaling GW. This variable is a dummy variable for canonical N^4 GW calculations.", &
1279 usage=
"NUM_OMEGA_POINTS 200", &
1284 END SUBROUTINE create_periodic_gw_correction_section
1290 SUBROUTINE create_bse_section(section)
1296 cpassert(.NOT.
ASSOCIATED(section))
1298 description=
"Parameters for a calculation solving the Bethe-Salpeter equation "// &
1299 "(BSE) for electronic excitations. The full BSE "// &
1300 "$\left( \begin{array}{cc}A & B\\B & A\end{array} \right)$ "// &
1301 "$\left( \begin{array}{cc}\mathbf{X}^{(n)}\\\mathbf{Y}^{(n)}\end{array} \right) = "// &
1302 "\Omega^{(n)}\left(\begin{array}{cc}1&0\\0&-1\end{array}\right)$ "// &
1303 "$\left(\begin{array}{cc}\mathbf{X}^{(n)}\\\mathbf{Y}^{(n)}\end{array}\right)$ "// &
1304 "enables, for example, the computation of electronic excitation energies $\Omega^{(n)}$ "// &
1305 "as well as optical properties. The BSE can be solved by diagonalizing "// &
1306 "the full ABBA-matrix or by setting B=0, i.e. within the Tamm-Dancoff approximation (TDA). "// &
1307 "Preliminary reference: Eq. (35) in PRB 92, 045209 (2015); http://dx.doi.org/10.1103/PhysRevB.92.045209", &
1308 n_keywords=8, n_subsections=3, repeats=.false.)
1312 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
1313 description=
"Activates BSE calculations.", &
1314 usage=
"&BSE .TRUE.", &
1315 default_l_val=.false., lone_keyword_l_val=.true.)
1320 description=
"Choose between calculation of singlet or triplet excitation (cf. given Reference above).", &
1321 usage=
"SPIN_CONFIG TRIPLET", &
1322 enum_c_vals=
s2a(
"SINGLET",
"TRIPLET"), &
1324 enum_desc=
s2a(
"Computes singlet excitations.", &
1325 "Computes triplet excitations."), &
1330 CALL keyword_create(keyword, __location__, name=
"BSE_DIAG_METHOD", &
1331 description=
"Method for BSE calculations. "// &
1332 "Choose between full or iterative diagonalization.", &
1333 usage=
"BSE_DIAG_METHOD FULLDIAG", &
1334 enum_c_vals=
s2a(
"FULLDIAG",
"ITERDIAG"), &
1336 enum_desc=
s2a(
"Fully diagonalizes the BSE matrices within the chosen level of approximation.", &
1337 "Iterative diagonalization has not been implemented yet."), &
1343 description=
"Level of approximation applied to BSE calculations. "// &
1344 "Choose between Tamm Dancoff approximation (TDA) and/or diagonalization of the full ABBA-matrix.", &
1346 enum_c_vals=
s2a(
"ON",
"OFF",
"TDA+ABBA"), &
1348 enum_desc=
s2a(
"The TDA is applied, i.e. B=0.", &
1349 "The ABBA-matrix is diagonalized, i.e. the TDA is not applied.", &
1350 "The BSE is solved within the TDA (B=0) as well as for the full ABBA-matrix."), &
1355 CALL keyword_create(keyword, __location__, name=
"ENERGY_CUTOFF_OCC", &
1356 description=
"Remove all orbitals with indices i,j from A_ia,jb and B_ia,jb with energy difference "// &
1357 "to HOMO level larger than the given energy cutoff, i.e. "// &
1358 "$\varepsilon_i\in[\varepsilon_{i=\text{HOMO}}^{GW}-E_\text{cut}^\text{occ},\varepsilon_{i=\text{HOMO}}^{GW}]$. "// &
1359 "Can be used to accelerate runtime and reduce memory consumption.", &
1360 usage=
"ENERGY_CUTOFF_OCC 10.0", unit_str=
"eV", &
1361 type_of_var=
real_t, default_r_val=-1.0_dp)
1365 CALL keyword_create(keyword, __location__, name=
"ENERGY_CUTOFF_EMPTY", &
1366 description=
"Remove all orbitals with indices a,b from A_ia,jb and B_ia,jb with energy difference "// &
1367 "to LUMO level larger than the given energy cutoff, i.e. "// &
1368 "$\varepsilon_a\in[\varepsilon_{a=\text{LUMO}}^{GW},\varepsilon_{a=\text{LUMO}}^{GW}+E_\text{cut}^\text{empty}]$. "// &
1369 "Can be used to accelerate runtime and reduce memory consumption.", &
1370 usage=
"ENERGY_CUTOFF_EMPTY 10.0", unit_str=
"eV", &
1371 type_of_var=
real_t, default_r_val=-1.0_dp)
1375 CALL keyword_create(keyword, __location__, name=
"BSE_DEBUG_PRINT", &
1376 description=
"Activates debug print statements in the BSE calculation.", &
1377 usage=
"BSE_DEBUG_PRINT .TRUE.", &
1378 default_l_val=.false., lone_keyword_l_val=.true.)
1382 CALL keyword_create(keyword, __location__, name=
"NUM_PRINT_EXC", &
1383 description=
"Number of printed excitation levels with respective "// &
1384 "energies and oscillator strengths. Does not affect computation time.", &
1385 usage=
"NUM_PRINT_EXC 25", &
1390 CALL keyword_create(keyword, __location__, name=
"NUM_PRINT_EXC_DESCR", &
1391 description=
"Number of excitation levels for which the exciton "// &
1392 "descriptors are computed. Negative or too large "// &
1393 "NUM_PRINT_EXC_DESCR defaults to NUM_PRINT_EXC.", &
1394 usage=
"NUM_PRINT_EXC_DESCR 5", &
1399 CALL keyword_create(keyword, __location__, name=
"PRINT_DIRECTIONAL_EXC_DESCR", &
1400 description=
"Activates printing of exciton descriptors per direction.", &
1401 usage=
"PRINT_DIRECTIONAL_EXC_DESCR .TRUE.", &
1402 default_l_val=.false., lone_keyword_l_val=.true.)
1407 description=
"Threshold for printing contributions of singleparticle "// &
1408 "transitions, i.e. elements of the eigenvectors $X_{ia}^{(n)}$ and $Y_{ia}^{(n)}$.", &
1409 usage=
"EPS_X 0.1", &
1410 type_of_var=
real_t, default_r_val=0.1_dp)
1414 CALL keyword_create(keyword, __location__, name=
"USE_KS_ENERGIES", &
1415 description=
"Uses KS energies instead of GW quasiparticle energies.", &
1416 usage=
"USE_KS_ENERGIES .TRUE.", &
1417 default_l_val=.false., lone_keyword_l_val=.true.)
1421 NULLIFY (subsection)
1422 CALL create_bse_screening_section(subsection)
1426 NULLIFY (subsection)
1427 CALL create_bse_iterat_section(subsection)
1431 NULLIFY (subsection)
1432 CALL create_bse_spectrum_section(subsection)
1436 NULLIFY (subsection)
1437 CALL create_bse_nto_section(subsection)
1441 END SUBROUTINE create_bse_section
1443 SUBROUTINE create_bse_screening_section(section)
1448 cpassert(.NOT.
ASSOCIATED(section))
1450 CALL section_create(section, __location__, name=
"SCREENING_IN_W", &
1451 description=
"Screening $\epsilon$ applied to $W(\omega=0)=\epsilon^{-1}(\omega=0) v $ "// &
1452 "in the BSE calculation. Besides default BSE, i.e. $W_0$ (screening with DFT energies), "// &
1453 "a fixed $\alpha = \epsilon^{-1}(\omega)$ can be applied, which is similar to the mixing "// &
1454 "parameter for hybrid functionals in LR-TDDFT. In addition, the keywords TDHF "// &
1455 "(no screening - $\alpha = 1$) and RPA (infinite screening - $\alpha = 0$) can be applied.", &
1456 n_keywords=2, n_subsections=0, repeats=.false.)
1461 keyword, __location__, name=
"_SECTION_PARAMETERS_", &
1462 description=
"Shortcut for the most common functional combinations.", &
1463 usage=
"&xc_functional BLYP", &
1464 enum_c_vals=
s2a(
"W_0",
"TDHF",
"RPA",
"ALPHA"), &
1466 enum_desc=
s2a(
"The Coulomb interaction is screened by applying DFT energies "// &
1467 "$\varepsilon_p^{DFT}$, which is typically used for GW-BSE and "// &
1468 "often labeled as $W_0$.", &
1469 "The Coulomb interaction is not screened, i.e. $W_{pq,rs}(\omega=0) "// &
1470 "\rightarrow v_{pq,rs}$ enters.", &
1471 "Infinite screening is applied, i.e. $W_{pq,rs}(\omega=0) \rightarrow 0$.", &
1472 "Arbitrary screening parameter. Specify within section."), &
1479 description=
"Screening parameter similar to the mixing in hybrid functionals used in TDDFT. "// &
1480 "$\alpha$ mimicks the screening $\epsilon^{-1}(\omega)$ and enforces $W = \alpha v$ "// &
1481 "in the BSE calculation.", &
1482 usage=
"ALPHA 0.25", &
1483 type_of_var=
real_t, default_r_val=-1.00_dp)
1487 END SUBROUTINE create_bse_screening_section
1489 SUBROUTINE create_bse_nto_section(print_key)
1494 cpassert(.NOT.
ASSOCIATED(print_key))
1497 description=
"Perform a natural transition orbital analysis, i.e. the transition density matrix "// &
1498 "$T^{(n)}=\left( \begin{array}{cc}0& {X}^{(n)}\\ \left({Y}^{(n)} \right)^T & 0\end{array} \right)$ "// &
1499 "is decomposed into its singular values "// &
1500 "$T^{(n)} = {U}^{(n)} {\Lambda^{(n)}} \left({V}^{(n)}\right)^T$ "// &
1501 "in order to compute the NTO pairs "// &
1502 "$\phi_I^{(n)}(\mathbf{r}_e) = \sum_{p=1}^{N_b} \varphi_p(\mathbf{r}_e) V_{p,I}^{(n)}$ for the electron and "// &
1503 "$\chi_I^{(n)}(\mathbf{r}_h) = \sum_{q=1}^{N_b} \varphi_q(\mathbf{r}_h) U_{q,I}^{(n)}$ for the hole.", &
1505 filename=
"BSE-NTO_ANALYSIS")
1509 CALL keyword_create(keyword, __location__, name=
"EPS_NTO_EIGVAL", &
1510 description=
"Threshold for NTO eigenvalues, i.e. only "// &
1511 "${\left(\lambda_I^{(n)}\right)}^2$ > EPS_NTO_EIGVAL are considered.", &
1512 usage=
"EPS_NTO_EIGVAL 0.01", &
1515 default_r_val=0.01_dp)
1520 description=
"Threshold of oscillator strengths $f^{(n)}$ for an excitation level. "// &
1521 "In case, the excitation level n has a smaller oscillator strength, the "// &
1522 "NTOs for this excitation level are not printed.", &
1523 usage=
"EPS_OSC_STR 0.01", &
1526 default_r_val=-1.0_dp)
1530 CALL keyword_create(keyword, __location__, name=
"NUM_PRINT_EXC_NTOS", &
1531 description=
"Number of excitation level $n$ up to which NTOs are printed. "// &
1532 "By default, this is set to NUM_PRINT_EXC. Negative or too large "// &
1533 "NUM_PRINT_EXC_NTOS defaults to NUM_PRINT_EXC.", &
1534 usage=
"NUM_PRINT_EXC_NTOS 5", &
1542 description=
"Specifies a list of excitation levels $n$ for which NTOs are printed. "// &
1543 "Overrides NUM_PRINT_EXC_NTOS.", &
1544 usage=
"STATE_LIST {integer} {integer} .. {integer}", &
1550 description=
"Print NTOs on Cube Files", &
1551 usage=
"CUBE_FILES {logical}", repeats=.false., n_var=1, &
1552 default_l_val=.true., lone_keyword_l_val=.true., type_of_var=
logical_t)
1557 description=
"The stride (X,Y,Z) used to write the cube file "// &
1558 "(larger values result in smaller cube files). Provide 3 numbers (for X,Y,Z) or"// &
1559 " 1 number valid for all components.", &
1560 usage=
"STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=
integer_t)
1565 description=
"append the cube files when they already exist", &
1566 default_l_val=.false., lone_keyword_l_val=.true.)
1570 END SUBROUTINE create_bse_nto_section
1572 SUBROUTINE create_bse_spectrum_section(section)
1577 cpassert(.NOT.
ASSOCIATED(section))
1578 CALL section_create(section, __location__, name=
"BSE_SPECTRUM", &
1579 description=
"Parameters influencing the output of the optical absorption spectrum, i.e. "// &
1580 "the dynamical dipole polarizability tensor $\alpha_{\mu,\mu'}(\omega)$ "// &
1581 "($\mu,\mu'\in\{x,y,z\}$), obtained from a BSE calculation, which is defined as "// &
1582 "$ \alpha_{\mu,\mu'}(\omega) = \sum_n \frac{2 E^{(n)} d^{(n)}_{\mu} d^{(n)}_{\mu'}} "// &
1583 "{(\omega+i\eta)^2-\left(\Omega^{(n)}\right)^2} $. "// &
1584 "The printed file will contain the specified frequency range $\omega$ and the "// &
1585 "corresponding imaginary part of the average $\bar{\alpha}(\omega)=\frac{1}{3}\mathrm{Tr} "// &
1586 "\left[ \alpha_{\mu,\mu'}(\omega)\right]$ as well as of the elements of $\alpha_{\mu,\mu'}(\omega)$.", &
1587 n_keywords=9, n_subsections=0, repeats=.false.)
1591 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
1592 description=
"Activates printing of optical absorption spectrum from the BSE calculation.", &
1593 usage=
"&BSE .TRUE.", &
1594 default_l_val=.false., lone_keyword_l_val=.true.)
1598 CALL keyword_create(keyword, __location__, name=
"FREQUENCY_STEP_SIZE", &
1599 description=
"Step size of frequencies for the optical absorption spectrum.", &
1600 usage=
"FREQUENCY_STEP_SIZE 0.1", unit_str=
"eV", &
1606 CALL keyword_create(keyword, __location__, name=
"FREQUENCY_STARTING_POINT", &
1607 description=
"First frequency to print in the optical absorption spectrum.", &
1608 usage=
"FREQUENCY_STARTING_POINT 0", unit_str=
"eV", &
1609 type_of_var=
real_t, default_r_val=0.0_dp)
1613 CALL keyword_create(keyword, __location__, name=
"FREQUENCY_END_POINT", &
1614 description=
"Last frequency to print in the optical absorption spectrum.", &
1615 usage=
"FREQUENCY_END_POINT 0", unit_str=
"eV", &
1622 description=
"List of broadening of the peaks in the optical absorption spectrum.", &
1623 usage=
"ETA_LIST 0.01 ...", unit_str=
"eV", &
1625 type_of_var=
real_t, n_var=-1)
1629 END SUBROUTINE create_bse_spectrum_section
1635 SUBROUTINE create_bse_iterat_section(section)
1640 cpassert(.NOT.
ASSOCIATED(section))
1642 description=
"Parameters influencing the iterative Bethe-Salpeter calculation. "// &
1643 "The iterative solver has not been fully implemented yet.", &
1644 n_keywords=9, n_subsections=0, repeats=.false.)
1648 CALL keyword_create(keyword, __location__, name=
"DAVIDSON_ABORT_COND", &
1649 description=
"Desired abortion condition for Davidson solver", &
1650 usage=
"DAVIDSON_ABORT_COND OR", &
1651 enum_c_vals=
s2a(
"EN",
"RES",
"OR"), &
1653 enum_desc=
s2a(
"Uses energy threshold for successfully exiting solver.", &
1654 "Uses residual threshold for successfully exiting solver.", &
1655 "Uses either energy or residual threshold for successfully exiting solver."), &
1661 description=
"Number of lowest excitation energies to be computed.", &
1662 usage=
"NUM_EXC_EN 3", &
1667 CALL keyword_create(keyword, __location__, name=
"NUM_ADD_START_Z_SPACE", &
1668 description=
"Determines the initial dimension of the subspace as "// &
1669 "dim = (NUM_EXC_EN+NUM_ADD_START_Z_SPACE)", &
1670 usage=
"NUM_ADD_START_Z_SPACE 1", &
1675 CALL keyword_create(keyword, __location__, name=
"FAC_MAX_Z_SPACE", &
1676 description=
"Factor to determine maximum dimension of the Davidson subspace. "// &
1677 "dimension = (NUM_EXC_EN+NUM_ADD_START_Z_SPACE)*FAC_MAX_Z_SPACE", &
1678 usage=
"FAC_MAX_Z_SPACE 5", &
1684 description=
"Number of new t vectors added. "// &
1685 "Must be smaller/equals (NUM_EXC_EN+NUM_ADD_START_Z_SPACE)", &
1686 usage=
"NUM_NEW_T 4", &
1692 description=
"Threshold for stopping the iteration for computing the transition energies. "// &
1693 "If the residuals inside the Davidson space change by less than EPS_RES (in eV), the iteration "// &
1695 usage=
"EPS_RES 0.001", unit_str=
"eV", &
1696 type_of_var=
real_t, default_r_val=0.001_dp)
1701 description=
"Threshold for stopping the iteration for computing the transition energies. "// &
1702 "If the desired excitation energies change by less than EPS_EXC_EN (in eV), the iteration "// &
1704 usage=
"EPS_EXC_EN 0.001", unit_str=
"eV", &
1705 type_of_var=
real_t, default_r_val=0.001_dp)
1709 CALL keyword_create(keyword, __location__, name=
"NUM_DAVIDSON_ITER", &
1710 description=
"Maximum number of iterations for determining the transition energies.", &
1711 usage=
"NUM_DAVIDSON_ITER 100", &
1716 CALL keyword_create(keyword, __location__, name=
"Z_SPACE_ENERGY_CUTOFF", &
1717 description=
"Cutoff (in eV) for maximal energy difference entering the A matrix. "// &
1718 "Per default and for negative values, there is no cutoff applied.", &
1719 usage=
"Z_SPACE_ENERGY_CUTOFF 60", unit_str=
"eV", &
1720 type_of_var=
real_t, default_r_val=-1.0_dp)
1723 END SUBROUTINE create_bse_iterat_section
1729 SUBROUTINE create_ic_section(section)
1734 cpassert(.NOT.
ASSOCIATED(section))
1736 description=
"Parameters influencing the image charge correction. "// &
1737 "The image plane is always an xy plane, so adjust the molecule according "// &
1739 n_keywords=3, n_subsections=1, repeats=.false.)
1743 CALL keyword_create(keyword, __location__, name=
"PRINT_IC_LIST", &
1744 description=
"If true, the image charge correction values are printed in a list, "// &
1745 "such that it can be used as input for a subsequent evGW calculation.", &
1746 usage=
"PRINT_IC_LIST .TRUE.", &
1747 default_l_val=.false., &
1748 lone_keyword_l_val=.true.)
1753 description=
"Threshold where molecule and image molecule have to coincide. ", &
1754 usage=
"EPS_DIST 0.1", unit_str=
"angstrom", &
1755 type_of_var=
real_t, default_r_val=3.0e-02_dp, repeats=.false.)
1759 END SUBROUTINE create_ic_section
1765 SUBROUTINE create_low_scaling(section)
1771 cpassert(.NOT.
ASSOCIATED(section))
1773 section, __location__, name=
"LOW_SCALING", &
1774 description=
"Cubic scaling RI-RPA, GW and Laplace-SOS-MP2 method using the imaginary time formalism. "// &
1775 "EPS_GRID in WFC_GPW section controls accuracy / req. memory for 3-center integrals. "// &
1776 "SORT_BASIS EXP should be specified in DFT section.", &
1777 n_keywords=12, n_subsections=2, repeats=.false., &
1781 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
1782 description=
"Activates cubic-scaling RPA, GW and Laplace-SOS-MP2 calculations.", &
1783 usage=
"&LOW_SCALING .TRUE.", &
1784 default_l_val=.false., lone_keyword_l_val=.true.)
1789 description=
"Reduces memory for sparse tensor contractions by this factor. "// &
1790 "A high value leads to some loss of performance. "// &
1791 "This memory reduction factor applies to storage of the tensors 'M occ' / 'M virt' "// &
1792 "but does not reduce storage of '3c ints'.", &
1793 usage=
"MEMORY_CUT 16", &
1799 description=
"Decide whether to print memory info on the sparse matrices.", &
1800 usage=
"MEMORY_INFO", &
1801 default_l_val=.false., &
1802 lone_keyword_l_val=.true.)
1807 keyword, __location__, name=
"EPS_FILTER", &
1808 description=
"Determines a threshold for the DBCSR based multiply. "// &
1809 "Normally, this EPS_FILTER determines accuracy and timing of low-scaling RPA and GW calculations.", &
1810 usage=
"EPS_FILTER 1.0E-10 ", type_of_var=
real_t, &
1811 default_r_val=1.0e-9_dp)
1816 keyword, __location__, name=
"EPS_FILTER_FACTOR", &
1817 description=
"Multiply EPS_FILTER with this factor to determine filter epsilon "// &
1818 "for DBCSR based multiply P(it)=(Mocc(it))^T*Mvirt(it) "// &
1819 "Default should be kept.", &
1821 default_r_val=10.0_dp)
1826 keyword, __location__, &
1827 name=
"EPS_STORAGE_SCALING", &
1828 variants=[
"EPS_STORAGE"], &
1829 description=
"Scaling factor to scale EPS_FILTER. Storage threshold for compression "// &
1830 "will be EPS_FILTER*EPS_STORAGE_SCALING.", &
1831 default_r_val=1.0e-3_dp)
1836 keyword, __location__, &
1837 name=
"DO_KPOINTS", &
1838 description=
"Besides in DFT, this keyword has to be switched on if one wants to do kpoints in. "// &
1840 usage=
"DO_KPOINTS", &
1841 default_l_val=.false., &
1842 lone_keyword_l_val=.true.)
1847 keyword, __location__, name=
"KPOINTS", &
1848 description=
"Keyword activates periodic, low-scaling GW calculations (&LOW_SCALING section also needed). "// &
1849 "For periodic calculations, kpoints are used for the density response, the "// &
1850 "Coulomb interaction and the screened Coulomb interaction. For 2d periodic systems, e.g. xz "// &
1851 "periodicity, please also specify KPOINTS, e.g. N_x 1 N_z.", &
1852 usage=
"KPOINTS N_x N_y N_z", &
1853 n_var=3, type_of_var=
integer_t, default_i_vals=[0, 0, 0])
1858 keyword, __location__, &
1859 name=
"KPOINT_WEIGHTS_W", &
1860 description=
"For kpoints in low-scaling GW, a Monkhorst-Pack mesh is used. The screened Coulomb "// &
1861 "interaction W(k) needs special care near the Gamma point (e.g. in 3d, W(k) diverges at the "// &
1862 "Gamma point with W(k) ~ k^alpha). KPOINT_WEIGHTS_W decides how the weights of the "// &
1863 "Monkhorst-Pack mesh are chosen to compute W(R) = int_BZ W(k) exp(ikR) dk (BZ=Brllouin zone). ", &
1864 usage=
"KPOINT_WEIGHTS_W AUTO", &
1865 enum_c_vals=
s2a(
"TAILORED",
"AUTO",
"UNIFORM"), &
1867 enum_desc=
s2a(
"Choose k-point integration weights such that the function f(k)=k^alpha is "// &
1868 "exactly integrated. alpha is specified using EXPONENT_TAILORED_WEIGHTS.", &
1869 "As 'TAILORED', but alpha is chosen automatically according to dimensionality "// &
1870 "(3D: alpha = -2 for 3D, 2D: alpha = -1 for exchange self-energy, uniform "// &
1871 "weights for correlation self-energy).", &
1872 "Choose the same weight for every k-point (original Monkhorst-Pack method)."), &
1878 keyword, __location__, &
1879 name=
"EXPONENT_TAILORED_WEIGHTS", &
1880 description=
"Gives the exponent of exactly integrated function in case 'KPOINT_WEIGHTS_W "// &
1881 "TAILORED' is chosen.", &
1882 usage=
"EXPONENT_TAILORED_WEIGHTS -2", &
1883 default_r_val=-2.0_dp)
1888 keyword, __location__, &
1889 name=
"REGULARIZATION_RI", &
1890 description=
"Parameter to reduce the expansion coefficients in RI for periodic GW. Larger parameter "// &
1891 "means smaller expansion coefficients that leads to a more stable calculation at the price "// &
1892 "of a slightly worse RI approximation. In case the parameter 0.0 is chosen, ordinary RI is used.", &
1893 usage=
"REGULARIZATION_RI 1.0E-4", &
1894 default_r_val=0.0_dp)
1899 keyword, __location__, &
1900 name=
"EPS_EIGVAL_S", &
1901 description=
"Parameter to reduce the expansion coefficients in RI for periodic GW. Removes all "// &
1902 "eigenvectors and eigenvalues of S_PQ(k) that are smaller than EPS_EIGVAL_S. ", &
1903 usage=
"EPS_EIGVAL_S 1.0E-3", &
1904 default_r_val=0.0_dp)
1909 keyword, __location__, &
1910 name=
"EPS_EIGVAL_S_GAMMA", &
1911 description=
"Parameter to reduce the expansion coefficients in RI for periodic GW. Removes all "// &
1912 "eigenvectors and eigenvalues of M_PQ(k=0) that are smaller than EPS_EIGVAL_S. ", &
1913 usage=
"EPS_EIGVAL_S_GAMMA 1.0E-3", &
1914 default_r_val=0.0_dp)
1919 keyword, __location__, &
1920 name=
"MAKE_CHI_POS_DEFINITE", &
1921 description=
"If true, makes eigenvalue decomposition of chi(iw,k) and removes negative "// &
1922 "eigenvalues. May increase computational cost significantly. Only recommended to try in case "// &
1923 "Cholesky decomposition of epsilon(iw,k) fails.", &
1924 usage=
"MAKE_CHI_POS_DEFINITE", &
1925 default_l_val=.true., &
1926 lone_keyword_l_val=.true.)
1931 keyword, __location__, &
1932 name=
"MAKE_OVERLAP_MAT_AO_POS_DEFINITE", &
1933 description=
"If true, makes eigenvalue decomposition of S_mu,nu(k) and removes negative "// &
1934 "eigenvalues. Slightly increases computational cost. Only recommended to try in case "// &
1935 "Cholesky decomposition of S_mu,nu(k) fails (error message: Cholesky decompose failed: "// &
1936 "matrix is not positive definite or ill-conditioned; when calling create_kp_and_calc_kp_orbitals).", &
1937 usage=
"MAKE_OVERLAP_MAT_AO_POS_DEFINITE", &
1938 default_l_val=.false., &
1939 lone_keyword_l_val=.true.)
1944 keyword, __location__, &
1945 name=
"DO_EXTRAPOLATE_KPOINTS", &
1946 description=
"If true, use a larger k-mesh to extrapolate the k-point integration of W. "// &
1947 "For example, in 2D, when using KPOINTS 4 4 1, an additional 6x6x1 mesh will be used to "// &
1948 "extrapolate the k-point integration of W with N_k^-0.5, where Nk is the number of k-points.", &
1949 usage=
"DO_EXTRAPOLATE_KPOINTS FALSE", &
1950 default_l_val=.true., &
1951 lone_keyword_l_val=.true.)
1956 keyword, __location__, &
1957 name=
"TRUNC_COULOMB_RI_X", &
1958 description=
"If true, use the truncated Coulomb operator for the exchange-self-energy in "// &
1960 usage=
"TRUNC_COULOMB_RI_X", &
1961 default_l_val=.true., &
1962 lone_keyword_l_val=.true.)
1967 keyword, __location__, &
1968 name=
"REL_CUTOFF_TRUNC_COULOMB_RI_X", &
1969 description=
"Only active in case TRUNC_COULOMB_RI_X = True. Normally, relative cutoff = 0.5 is "// &
1970 "good choice; still needs to be evaluated for RI schemes. ", &
1971 usage=
"REL_CUTOFF_TRUNC_COULOMB_RI_X 0.3", &
1972 default_r_val=0.5_dp)
1977 keyword, __location__, &
1978 name=
"KEEP_QUADRATURE", &
1979 variants=
s2a(
"KEEP_WEIGHTS",
"KEEP_QUAD",
"KEEP_WEIGHT"), &
1980 description=
"Keep the Laplace quadrature defined at the first energy evaluations throughout "// &
1981 "the run. Allows to have consistent force evaluations.", &
1982 usage=
"KEEP_QUADRATURE", &
1983 default_l_val=.true., &
1984 lone_keyword_l_val=.true.)
1989 keyword, __location__, &
1990 name=
"K_MESH_G_FACTOR", &
1991 description=
"The k-mesh for the Green's function can be chosen to be larger than the k-mesh for "// &
1992 "W (without much higher computational cost). The factor given here multiplies the mesh for W to obtain "// &
1993 "the k-mesh for G. Example: factor 4, k-mesh for W: 4x4x1 -> k-mesh for G: 16x16x1 (z-dir. is "// &
2000 keyword, __location__, &
2001 name=
"MIN_BLOCK_SIZE", &
2002 description=
"Minimum tensor block size. Adjusting this value may have minor effect on "// &
2003 "performance but default should be good enough.", &
2009 keyword, __location__, &
2010 name=
"MIN_BLOCK_SIZE_MO", &
2011 description=
"Tensor block size for MOs. Only relevant for GW calculations. "// &
2012 "The memory consumption of GW scales as O(MIN_BLOCK_SIZE_MO). It is recommended to "// &
2013 "set this parameter to a smaller number if GW runs out of memory. "// &
2014 "Otherwise the default should not be changed.", &
2019 NULLIFY (subsection)
2020 CALL create_low_scaling_cphf(subsection)
2024 END SUBROUTINE create_low_scaling
2030 SUBROUTINE create_wfc_gpw(section)
2035 cpassert(.NOT.
ASSOCIATED(section))
2037 description=
"Parameters for the GPW approach in Wavefunction-based Correlation methods", &
2038 n_keywords=5, n_subsections=0, repeats=.false.)
2042 description=
"Determines a threshold for the GPW based integration", &
2043 usage=
"EPS_GRID 1.0E-9 ", type_of_var=
real_t, &
2044 default_r_val=1.0e-8_dp)
2049 keyword, __location__, name=
"EPS_FILTER", &
2050 description=
"Determines a threshold for the DBCSR based multiply (usually 10 times smaller than EPS_GRID). "// &
2051 "Normally, this EPS_FILTER determines accuracy and timing of cubic-scaling RPA calculation.", &
2052 usage=
"EPS_FILTER 1.0E-10 ", type_of_var=
real_t, &
2053 default_r_val=1.0e-9_dp)
2058 description=
"The cutoff of the finest grid level in the MP2 gpw integration.", &
2059 usage=
"CUTOFF 300", type_of_var=
real_t, &
2060 default_r_val=300.0_dp)
2065 variants=[
"RELATIVE_CUTOFF"], &
2066 description=
"Determines the grid at which a Gaussian is mapped.", &
2067 usage=
"REL_CUTOFF 50", type_of_var=
real_t, &
2068 default_r_val=50.0_dp)
2073 variants=[
"IOLEVEL"], &
2074 description=
"How much output is written by the individual groups.", &
2075 usage=
"PRINT_LEVEL HIGH", &
2077 s2a(
"SILENT",
"LOW",
"MEDIUM",
"HIGH",
"DEBUG"), &
2078 enum_desc=
s2a(
"Almost no output", &
2079 "Little output",
"Quite some output",
"Lots of output", &
2080 "Everything is written out, useful for debugging purposes only"), &
2087 keyword, __location__, name=
"EPS_PGF_ORB_S", &
2088 description=
"Screening for overlap matrix in RI. Usually, it is best to choose this parameter "// &
2089 "to be very small since the inversion of overlap matrix might be ill-conditioned.", &
2090 usage=
"EPS_PGF_ORB_S 1.0E-10 ", type_of_var=
real_t, &
2091 default_r_val=1.0e-10_dp)
2095 END SUBROUTINE create_wfc_gpw
2101 SUBROUTINE create_cphf(section)
2106 cpassert(.NOT.
ASSOCIATED(section))
2108 section, __location__, name=
"CPHF", &
2109 description=
"Parameters influencing the solution of the Z-vector equations in MP2 gradients calculations.", &
2110 n_keywords=2, n_subsections=0, repeats=.false., &
2116 variants=[
"MAX_NUM_ITER"], &
2117 description=
"Maximum number of iterations allowed for the solution of the Z-vector equations.", &
2118 usage=
"MAX_ITER 50", &
2123 CALL keyword_create(keyword, __location__, name=
"RESTART_EVERY", &
2124 description=
"Restart iteration every given number of steps.", &
2125 usage=
"RESTART_EVERY 5", &
2130 CALL keyword_create(keyword, __location__, name=
"SOLVER_METHOD", &
2131 description=
"Chose solver of the z-vector equations.", &
2132 usage=
"SOLVER_METHOD POPLE", enum_c_vals= &
2133 s2a(
"POPLE",
"CG",
"RICHARDSON",
"SD"), &
2134 enum_desc=
s2a(
"Pople's method (Default).", &
2135 "Conjugated gradient method (equivalent to Pople).", &
2136 "Richardson iteration", &
2137 "Steepest Descent iteration"), &
2144 description=
"Convergence threshold for the solution of the Z-vector equations. "// &
2145 "The Z-vector equations have the form of a linear system of equations Ax=b, "// &
2146 "convergence is achieved when |Ax-b|<=EPS_CONV.", &
2147 usage=
"EPS_CONV 1.0E-6", type_of_var=
real_t, &
2148 default_r_val=1.0e-4_dp)
2152 CALL keyword_create(keyword, __location__, name=
"SCALE_STEP_SIZE", &
2153 description=
"Scaling factor of each step.", &
2154 usage=
"SCALE_STEP_SIZE 1.0", &
2155 default_r_val=1.0_dp)
2159 CALL keyword_create(keyword, __location__, name=
"ENFORCE_DECREASE", &
2160 description=
"Restarts if residual does not decrease.", &
2161 usage=
"ENFORCE_DECREASE T", &
2162 lone_keyword_l_val=.true., &
2163 default_l_val=.false.)
2167 CALL keyword_create(keyword, __location__, name=
"DO_POLAK_RIBIERE", &
2168 description=
"Use a Polak-Ribiere update of the search vector in CG instead of the Fletcher "// &
2169 "Reeves update. Improves the convergence with modified step sizes. "// &
2170 "Ignored with other methods than CG.", &
2171 usage=
"DO_POLAK_RIBIERE T", &
2172 lone_keyword_l_val=.true., &
2173 default_l_val=.false.)
2177 CALL keyword_create(keyword, __location__, name=
"RECALC_RESIDUAL", &
2178 description=
"Recalculates residual in every step.", &
2179 usage=
"RECALC_RESIDUAL T", &
2180 lone_keyword_l_val=.true., &
2181 default_l_val=.false.)
2185 END SUBROUTINE create_cphf
2191 SUBROUTINE create_low_scaling_cphf(section)
2198 cpassert(.NOT.
ASSOCIATED(section))
2200 description=
"Parameters influencing the solution of the Z-vector equations "// &
2201 "in low-scaling Laplace-SOS-MP2 gradients calculations.", &
2202 n_keywords=5, n_subsections=0, repeats=.false.)
2205 description=
"Target accuracy for Z-vector euation solution.", &
2206 usage=
"EPS_CONV 1.e-6", default_r_val=1.e-6_dp)
2211 description=
"Maximum number of conjugate gradient iteration to be performed for one optimization.", &
2212 usage=
"MAX_ITER 200", default_i_val=50)
2217 keyword, __location__, name=
"PRECONDITIONER", &
2218 description=
"Type of preconditioner to be used with all minimization schemes. "// &
2219 "They differ in effectiveness, cost of construction, cost of application. "// &
2220 "Properly preconditioned minimization can be orders of magnitude faster than doing nothing.", &
2221 usage=
"PRECONDITIONER FULL_ALL", &
2223 enum_c_vals=
s2a(
"FULL_ALL",
"FULL_SINGLE_INVERSE",
"FULL_SINGLE",
"FULL_KINETIC",
"FULL_S_INVERSE", &
2225 enum_desc=
s2a(
"Most effective state selective preconditioner based on diagonalization, "// &
2226 "requires the ENERGY_GAP parameter to be an underestimate of the HOMO-LUMO gap. "// &
2227 "This preconditioner is recommended for almost all systems, except very large systems where "// &
2228 "make_preconditioner would dominate the total computational cost.", &
2229 "Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
2230 "but cheaper to construct, "// &
2231 "might be somewhat less robust. Recommended for large systems.", &
2232 "Based on H-eS diagonalisation, not as good as FULL_ALL, but somewhat cheaper to apply. ", &
2233 "Cholesky inversion of S and T, fast construction, robust, and relatively good, "// &
2234 "use for very large systems.", &
2235 "Cholesky inversion of S, not as good as FULL_KINETIC, yet equally expensive.", &
2236 "skip preconditioning"), &
2243 description=
"Energy gap estimate [a.u.] for preconditioning", &
2244 usage=
"ENERGY_GAP 0.1", &
2245 default_r_val=0.2_dp)
2249 END SUBROUTINE create_low_scaling_cphf
2255 SUBROUTINE create_mp2_potential(section)
2260 cpassert(.NOT.
ASSOCIATED(section))
2261 CALL section_create(section, __location__, name=
"INTERACTION_POTENTIAL", &
2262 description=
"Parameters the interaction potential in computing the biel integrals", &
2263 n_keywords=4, n_subsections=0, repeats=.false.)
2267 keyword, __location__, &
2268 name=
"POTENTIAL_TYPE", &
2269 description=
"Which interaction potential should be used "// &
2270 "(Coulomb, TShPSC operator).", &
2271 usage=
"POTENTIAL_TYPE TSHPSC", &
2272 enum_c_vals=
s2a(
"COULOMB",
"TShPSC",
"LONGRANGE",
"SHORTRANGE",
"TRUNCATED",
"MIX_CL",
"IDENTITY"), &
2280 enum_desc=
s2a(
"Coulomb potential: 1/r", &
2281 "| Range | TShPSC |"//
newline// &
2282 "| ----- | ------ |"//
newline// &
2283 "| $ x \leq R_c $ | $ 1/x - s/R_c $ |"//
newline// &
2284 "| $ R_c < x \leq nR_c $ | "// &
2285 "$ (1 - s)/R_c - (x - R_c)/R_c^2 + (x - R_c)^2/R_c^3 - "// &
2286 "(2n^2 - 7n + 9 - 4s)(x - R_c)^3/(R_c^4(n^2 - 2n + 1)(n - 1)) + "// &
2287 "(6-3s - 4n + n^2)(x - R_c)^4/(R_c^5(n^4 - 4n^3 + 6n^2 - 4n + 1)) $ "// &
2288 "(4th order polynomial) | "//
newline// &
2289 "| $ x > nR_c $ | $ 0 $ | "//
newline, &
2290 "Longrange Coulomb potential: $ \operatorname{erf}(wr)/r $", &
2291 "Shortrange Coulomb potential: $ \operatorname{erfc}(wr)/r $", &
2292 "Truncated Coulomb potential", &
2293 "Mixed Coulomb/Longrange Coulomb potential", &
2294 "Delta potential"), &
2299 CALL keyword_create(keyword, __location__, name=
"TRUNCATION_RADIUS", &
2300 variants=[
"CUTOFF_RADIUS"], &
2301 description=
"Determines truncation radius for the truncated potentials. "// &
2302 "Only valid when doing truncated calculations", &
2303 usage=
"TRUNCATION_RADIUS 10.0", type_of_var=
real_t, &
2304 default_r_val=10.0_dp, &
2305 unit_str=
"angstrom")
2310 keyword, __location__, &
2311 name=
"POTENTIAL_DATA", &
2312 variants=
s2a(
"TShPSC_DATA",
"T_C_G_DATA"), &
2313 description=
"Location of the file TShPSC.dat or t_c_g.dat that contains the data for the "// &
2314 "evaluation of the evaluation of the truncated potentials", &
2315 usage=
"TShPSC_DATA t_sh_p_s_c.dat", &
2316 default_c_val=
"t_sh_p_s_c.dat")
2321 keyword, __location__, &
2323 description=
"Range separation parameter for the longrange or shortrange potential. "// &
2324 "Only valid when longrange or shortrange potential is requested.", &
2325 usage=
"OMEGA 0.5", type_of_var=
real_t, &
2326 default_r_val=0.5_dp)
2331 keyword, __location__, &
2332 name=
"SCALE_COULOMB", &
2333 description=
"Scaling factor of (truncated) Coulomb potential in mixed (truncated) Coulomb/Longrange potential. "// &
2334 "Only valid when mixed potential is requested.", &
2335 usage=
"SCALE_COULOMB 0.5", type_of_var=
real_t, &
2336 default_r_val=1.0_dp)
2341 keyword, __location__, &
2342 name=
"SCALE_LONGRANGE", &
2343 description=
"Scaling factor of longrange Coulomb potential in mixed (truncated) Coulomb/Longrange potential. "// &
2344 "Only valid when mixed potential is requested.", &
2345 usage=
"SCALE_LONGRANGE 0.5", type_of_var=
real_t, &
2346 default_r_val=1.0_dp)
2350 END SUBROUTINE create_mp2_potential
2356 SUBROUTINE create_ri_section(section)
2362 cpassert(.NOT.
ASSOCIATED(section))
2364 description=
"Parameters influencing resolution of the identity (RI) that is "// &
2365 "used in RI-MP2, RI-RPA, RI-SOS-MP2 and GW (inside RI-RPA).", &
2366 n_keywords=6, n_subsections=2, repeats=.false.)
2368 NULLIFY (subsection)
2369 CALL create_ri_metric_section(subsection)
2373 CALL create_opt_ri_basis(subsection)
2379 keyword, __location__, &
2381 variants=[
"ROW_BLOCK_SIZE"], &
2382 description=
"Size of the row block used in the SCALAPACK block cyclic data distribution. "// &
2383 "Default is (ROW_BLOCK=-1) is automatic. "// &
2384 "A proper choice can speedup the parallel matrix multiplication in the case of RI-RPA and RI-SOS-MP2-Laplace.", &
2385 usage=
"ROW_BLOCK 512", &
2391 keyword, __location__, &
2393 variants=[
"COL_BLOCK_SIZE"], &
2394 description=
"Size of the column block used in the SCALAPACK block cyclic data distribution. "// &
2395 "Default is (COL_BLOCK=-1) is automatic. "// &
2396 "A proper choice can speedup the parallel matrix multiplication in the case of RI-RPA and RI-SOS-MP2-Laplace.", &
2397 usage=
"COL_BLOCK 512", &
2403 keyword, __location__, &
2404 name=
"CALC_COND_NUM", &
2405 variants=[
"CALC_CONDITION_NUMBER"], &
2406 description=
"Calculate the condition number of the (P|Q) matrix for the RI methods.", &
2407 usage=
"CALC_COND_NUM", &
2408 default_l_val=.false., &
2409 lone_keyword_l_val=.true.)
2414 description=
"Wether to perform a singular value decomposition instead of the Cholesky decomposition "// &
2415 "of the potential operator in the RI basis. Computationally expensive but numerically more stable. "// &
2416 "It reduces the computational costs of some subsequent steps. Recommended when a longrange Coulomb "// &
2417 "potential is employed.", &
2418 usage=
"DO_SVD .TRUE.", &
2419 default_l_val=.false., lone_keyword_l_val=.true.)
2424 description=
"Determines the upper bound of eigenvectors to be removed during the SVD (see DO_SVD).", &
2425 usage=
"EPS_SVD 1E-5", &
2426 default_r_val=0.0_dp)
2431 description=
"block sizes for tensors (only used if ERI_METHOD=MME). First value "// &
2432 "is the block size for ORB basis, second value is the block size for RI_AUX basis.", &
2433 usage=
"ERI_BLKSIZE", &
2435 default_i_vals=[4, 16])
2439 END SUBROUTINE create_ri_section
2445 SUBROUTINE create_integrals_section(section)
2451 cpassert(.NOT.
ASSOCIATED(section))
2453 description=
"Parameters controlling how to compute integrals that are needed "// &
2454 "in MP2, RI-MP2, RI-RPA, RI-SOS-MP2 and GW (inside RI-RPA).", &
2455 n_keywords=2, n_subsections=3, repeats=.false.)
2457 NULLIFY (subsection)
2462 CALL create_wfc_gpw(subsection)
2466 CALL create_mp2_potential(subsection)
2472 description=
"Method for calculating periodic electron repulsion integrals "// &
2473 "(MME method is faster but experimental, forces not yet implemented). "// &
2474 "Obara-Saika (OS) for the Coulomb operator can only be used for non-periodic calculations.", &
2475 usage=
"ERI_METHOD MME", &
2476 enum_c_vals=
s2a(
"DEFAULT",
"GPW",
"MME",
"OS"), &
2478 enum_desc=
s2a(
"Use default ERI method (for periodic systems: GPW, for molecules: OS, "// &
2479 "for MP2 and RI-MP2: GPW in any case).", &
2480 "Uses Gaussian Plane Wave method [DelBen2013].", &
2481 "Uses MiniMax-Ewald method (experimental, ERI_MME subsection, only for fully periodic "// &
2482 "systems with orthorhombic cells).", &
2483 "Use analytical Obara-Saika method."), &
2488 CALL keyword_create(keyword, __location__, name=
"SIZE_LATTICE_SUM", &
2489 description=
"Size of sum range L. ", &
2490 usage=
"SIZE_LATTICE_SUM 10", &
2495 END SUBROUTINE create_integrals_section
2501 SUBROUTINE create_ri_metric_section(section)
2506 cpassert(.NOT.
ASSOCIATED(section))
2508 description=
"Sets up RI metric", &
2513 keyword, __location__, &
2514 name=
"POTENTIAL_TYPE", &
2515 description=
"Decides which operator/metric is used for resolution of the identity (RI).", &
2516 usage=
"POTENTIAL_TYPE DEFAULT", &
2517 enum_c_vals=
s2a(
"DEFAULT",
"COULOMB",
"IDENTITY",
"LONGRANGE",
"SHORTRANGE",
"TRUNCATED"), &
2520 enum_desc=
s2a(
"Use Coulomb metric for RI-MP2 and normal-scaling RI-SOS-MP2, RI-RPA and GW. "// &
2521 "Use Overlap metric for low-scaling RI-SOS-MP2, RI-RPA and GW for periodic systems. "// &
2522 "Use truncated Coulomb metric for low-scaling RI-SOS-MP2, RI-RPA and GW for non-periodic systems.", &
2523 "Coulomb metric: 1/r. Recommended for RI-MP2,", &
2524 "Overlap metric: delta(r).", &
2525 "Longrange metric: erf(omega*r)/r. Not recommended with DO_SVD .TRUE.", &
2526 "Shortrange metric: erfc(omega*r)/r", &
2527 "Truncated Coulomb metric: if (r < R_c) 1/r else 0. More "// &
2528 "accurate than IDENTITY for non-periodic systems. Recommended for low-scaling methods."), &
2535 keyword, __location__, &
2537 description=
"The range parameter for the short/long range operator (in 1/a0).", &
2538 usage=
"OMEGA 0.5", &
2539 default_r_val=0.0_dp)
2543 CALL keyword_create(keyword, __location__, name=
"CUTOFF_RADIUS", &
2544 description=
"The cutoff radius (in Angstrom) for the truncated Coulomb operator.", &
2545 usage=
"CUTOFF_RADIUS 3.0", default_r_val=
cp_unit_to_cp2k(
value=3.0_dp, unit_str=
"angstrom"), &
2546 type_of_var=
real_t, unit_str=
"angstrom")
2551 keyword, __location__, &
2552 name=
"T_C_G_DATA", &
2553 description=
"Location of the file t_c_g.dat that contains the data for the "// &
2554 "evaluation of the truncated gamma function ", &
2555 default_c_val=
"t_c_g.dat")
2560 description=
"The threshold to determine the effective range of the short range "// &
2561 "RI metric: erfc(omega*eff_range)/eff_range = EPS_RANGE", &
2562 default_r_val=1.0e-08_dp, &
2567 END SUBROUTINE create_ri_metric_section
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public stein2024
integer, save, public stein2022
integer, save, public wilhelm2016b
integer, save, public delben2015
integer, save, public wilhelm2016a
integer, save, public wilhelm2018
integer, save, public rybkin2016
integer, save, public delben2013
integer, save, public delben2012
integer, save, public delben2015b
integer, save, public wilhelm2017
integer, save, public bussy2023
integer, save, public bates2013
Interface to Minimax-Ewald method for periodic ERI's to be used in CP2K.
subroutine, public create_eri_mme_section(section, default_n_minimax)
Create main input section.
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public debug_print_level
integer, parameter, public low_print_level
integer, parameter, public medium_print_level
integer, parameter, public high_print_level
integer, parameter, public add_last_numeric
integer, parameter, public silent_print_level
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str)
creates a print_key section
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Defines the basic variable types.
integer, parameter, public dp
Utilities for string manipulations.
character(len=1), parameter, public newline