46#include "./base/base_uses.f90"
51 CHARACTER(LEN=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_as'
71 cpassert(.NOT.
ASSOCIATED(section))
74 description=
"Define parameters and method to calculate an electronic active space", &
75 n_keywords=1, n_subsections=0, repeats=.false.)
77 NULLIFY (keyword, subsection, print_key)
80 name=
"_SECTION_PARAMETERS_", &
81 description=
"Controls the activation of the ACTIVE_SPACE section", &
82 usage=
"&ACTIVE_SPACE ON", &
83 default_l_val=.false., &
84 lone_keyword_l_val=.true.)
88 CALL keyword_create(keyword, __location__, name=
"ACTIVE_ELECTRONS", &
89 description=
"The number of active electrons in the CAS space", &
90 usage=
"ACTIVE_ELECTRONS 4", n_var=1, default_i_val=-1, type_of_var=
integer_t)
94 CALL keyword_create(keyword, __location__, name=
"ACTIVE_ORBITALS", &
95 description=
"The number of active orbitals defining the CAS space.", &
96 usage=
"ACTIVE_ORBITALS 2", n_var=1, default_i_val=-1, type_of_var=
integer_t)
100 CALL keyword_create(keyword, __location__, name=
"ACTIVE_ORBITAL_INDICES", &
101 description=
"The indices of the active orbitals. Requires ORBITAL_SELECTION MANUAL! "// &
102 "Need to be as many indices as active orbitals times the number of spin "// &
103 "channels (2 if ROKS or UKS/LSD else 1). The indices refer to the canonical "// &
104 "SCF orbitals ordered by energy: if the SCF orbitals are not canonical (e.g. OT), "// &
105 "they are first rotated into canonical orbitals, so the indices do not refer to "// &
106 "the original OT orbitals. With OT%ON_THE_FLY_LOC the indices refer to the "// &
107 "localized orbitals.", &
108 usage=
"ACTIVE_ORBITAL_INDICES 2 3 {...}", n_var=-1, default_i_vals=[-1], &
114 description=
"Controls the writing of a file in FCIDUMP format.", &
120 description=
"Writes the orbitals of the active space Hamiltonian in "// &
121 "Molden format: the inactive orbitals first, then the active orbitals "// &
122 "in the orbital order of the FCIDUMP file. These are exactly the "// &
123 "orbitals used for the integrals, also for ORBITAL_SELECTION MANUAL.", &
126 description=
"Unit for coordinates and cell in the MOLDEN file.", &
127 usage=
"UNIT ANGSTROM", &
128 enum_c_vals=
s2a(
"BOHR",
"ANGSTROM"), &
129 enum_desc=
s2a(
"Write in Bohr (AU)",
"Write in Angstrom"), &
130 enum_i_vals=[1, 2], &
135 description=
"Controls whether the [Cell] block is written to the MOLDEN file.", &
136 usage=
"WRITE_CELL T", &
137 default_l_val=.false., lone_keyword_l_val=.true.)
141 description=
"Controls whether the [Pseudo] block is written to the MOLDEN file.", &
142 usage=
"WRITE_PSEUDO T", &
143 default_l_val=.false., lone_keyword_l_val=.true.)
147 description=
"Controls whether ghost atoms are marked in the [Atoms] block by "// &
148 "setting their atomic number to zero.", &
149 usage=
"MARK_GHOST T", &
150 default_l_val=.false., lone_keyword_l_val=.true.)
154 description=
"Specifies the number of significant digits retained. "// &
155 "The default keeps full precision for use in other programs.", &
156 usage=
"NDIGITS {int}", &
161 description=
"Representation of Gaussian-type orbitals", &
163 enum_c_vals=
s2a(
"CARTESIAN",
"SPHERICAL"), &
165 "Cartesian Gaussian orbitals. Use with caution", &
166 "Spherical Gaussian orbitals. Incompatible with VMD"), &
173 CALL keyword_create(keyword, __location__, name=
"ORBITAL_SELECTION", &
174 description=
"Method used to select active space orbitals. CANONICAL and MANUAL "// &
175 "use the canonical SCF orbitals unchanged; non-canonical SCF orbitals (e.g. "// &
176 "from OT) are first rotated once into canonical orbitals, separately within the "// &
177 "occupied and the unoccupied orbitals. Not done for ROKS and for OT%ON_THE_FLY_LOC, "// &
178 "where CANONICAL is not possible.", &
179 usage=
"ORBITAL_SELECTION CANONICAL", &
181 enum_c_vals=
s2a(
"CANONICAL",
"WANNIER_PROJECTION",
"MAO",
"MANUAL"), &
183 enum_desc=
s2a(
"Select orbitals using energy ordering of canonical orbitals", &
184 "Select orbitals from projected Wannier functions", &
185 "Select orbitals from modified atomic orbitals", &
186 "Select canonical orbitals by their indices given in ACTIVE_ORBITAL_INDICES"))
191 CALL keyword_create(keyword, __location__, name=
"SUBSPACE_ATOM", &
192 description=
"Number of atom that defines the subspace to be projected on.", &
193 usage=
"SUBSPACE_ATOM x", default_i_val=-1, &
198 CALL keyword_create(keyword, __location__, name=
"SUBSPACE_SHELL", &
199 description=
"Shell definition for subsapce.", &
200 usage=
"SUBSPACE_SHELL 3d4s", default_c_val=
"X", &
205 CALL keyword_create(keyword, __location__, name=
"SCF_EMBEDDING", &
206 description=
"Whether to turn on the self-consistent embedding scheme", &
207 default_l_val=.false., lone_keyword_l_val=.false.)
212 description=
"Name of the QCSchema file, may include a path", &
213 usage=
"QCSCHEMA <FILENAME>", &
214 type_of_var=
lchar_t, repeats=.false., &
220 description=
"The active space solver for the embedding approach", &
221 usage=
"AS_SOLVER FCI", &
223 enum_c_vals=
s2a(
"NONE",
"QISKIT",
"FCI"), &
225 enum_desc=
s2a(
"NO solver, used to produce FCIDUMP/QCSchema files", &
226 "QISKIT active space solver", &
227 "LibFCI full-CI active space solver"))
232 description=
"Squared residual norm (energy variance) threshold, in hartree squared, "// &
233 "for AS_SOLVER FCI. This controls the inner FCI solver, not the embedding iterations. "// &
234 "Loose values can give inaccurate one-particle density matrices.", &
235 usage=
"EPS_FCI 1.0E-20", type_of_var=
real_t, default_r_val=1.0e-20_dp)
240 description=
"Energy convergence threshold of the DFT embedding scheme.", &
241 usage=
"EPS_ITER 1.0E-6 ", type_of_var=
real_t, &
242 default_r_val=1.0e-6_dp)
247 description=
"Fraction of new density to be mixed with previous one in SCF embedding. "// &
248 "Kept for backwards compatibility; prefer ACTIVE_SPACE%MIXING%ALPHA.", &
249 usage=
"ALPHA 0.25", type_of_var=
real_t, &
250 default_r_val=0.8_dp)
255 description=
"Max number of iterations for the DFT embedding scheme.", &
256 usage=
"MAX_ITER 50", type_of_var=
integer_t, &
261 CALL create_print_orb_section(subsection)
265 CALL create_eri_section(subsection)
269 CALL create_eri_gpw(subsection)
281 CALL create_socket_section(subsection)
295 SUBROUTINE create_socket_section(section)
300 cpassert(.NOT.
ASSOCIATED(section))
302 description=
"Parameters to set up the socket communicating to the external active space solver.", &
303 n_keywords=3, n_subsections=0, repeats=.false.)
307 description=
"Use an INET socket rather than a UNIX socket.", &
308 usage=
"INET <LOGICAL>", &
309 default_l_val=.false., lone_keyword_l_val=.true.)
314 description=
"Port number for the socket client.", &
315 usage=
"port <INTEGER>", &
321 description=
"Host name for the socket client.", &
322 usage=
"host <HOSTNAME>", &
323 default_c_val=
"embedding_socket")
327 END SUBROUTINE create_socket_section
333 SUBROUTINE create_print_orb_section(section)
338 cpassert(.NOT.
ASSOCIATED(section))
339 CALL section_create(section, __location__, name=
"PRINT_ORBITAL_CUBES", &
340 description=
"Controls printing of active orbital cube files.", &
341 n_keywords=5, n_subsections=0, repeats=.false.)
345 description=
"Body of Filename for the cube files.", &
346 usage=
"FILENAME {name}", default_c_val=
"ActiveOrbital", &
352 description=
"List of alpha orbitals to be printed. -1 defaults to all values", &
353 usage=
"ALIST {1 2 3 ...}", n_var=-1, default_i_vals=[-1], &
354 lone_keyword_i_val=-1, type_of_var=
integer_t)
359 description=
"List of beta orbitals to be printed. -1 defaults to all values", &
360 usage=
"BLIST {1 2 3 ...}", n_var=-1, default_i_vals=[-1], &
361 lone_keyword_i_val=-1, type_of_var=
integer_t)
366 description=
"The stride (X,Y,Z) used to write the cube file"// &
367 " (larger values result in smaller cube files)."// &
368 " You can provide 3 numbers (for X,Y,Z) or 1 number valid for all components", &
369 usage=
"STRIDE {2 2 2}", n_var=-1, default_i_vals=[2, 2, 2], &
374 CALL keyword_create(keyword, __location__, name=
"STOP_AFTER_CUBES", &
375 description=
"Whether to stop the computation after printing the cubes.", &
376 default_l_val=.false., lone_keyword_l_val=.false.)
380 END SUBROUTINE create_print_orb_section
386 SUBROUTINE create_eri_section(section)
391 cpassert(.NOT.
ASSOCIATED(section))
393 description=
"Parameters for the electron repulsion integrals.", &
394 n_keywords=5, n_subsections=0, repeats=.false.)
398 description=
"Method used in ERI calculation.", &
399 usage=
"METHOD FULL_GPW", &
400 enum_c_vals=
s2a(
"FULL_GPW",
"GPW_HALF_TRANSFORM"), &
402 enum_desc=
s2a(
"Use the GPW approach with MOs", &
403 "Use the GPW approach for half-transformed MO ERIs"), &
409 description=
"Operator used in ERI calculation.", &
410 usage=
"OPERATOR LONGRANGE", &
411 enum_c_vals=
s2a(
"COULOMB",
"YUKAWA",
"LONGRANGE", &
412 "SHORTRANGE",
"GAUSSIAN",
"TRUNCATED",
"LR_TRUNC"), &
416 enum_desc=
s2a(
"Coulomb operator: $\frac{1}{r}$", &
417 "Yukawa operator: $\frac{\exp{(-\omega \cdot r)}}{r}$", &
418 "Longrange operator: $\frac{\mathrm{erf}(\omega \cdot r)}{r}$", &
419 "Shortrange operator: $\frac{\mathrm{erfc}(\omega \cdot r)}{r}$", &
420 "Gaussian operator: exp(-omega*R2)/R", &
421 "Truncated Coulomb operator: $\frac{1}{r} \text{ if } (r \lt R_c) \text{ else } 0$", &
422 "Truncated longrange operator: "// &
423 "$\frac{\mathrm{erf}(\omega \cdot r)}{r} \text{ if } (r \lt R_c) \text{ else } 0$"), &
429 description=
"Periodicity used for operators in ERI calclulation.", &
430 usage=
"PERIODICITY 1 1 1", n_var=-1, default_i_vals=[0, 0, 0], &
436 description=
"Range-separation parameter $\omega$ for ERI operator.", &
437 usage=
"OMEGA 0.25", type_of_var=
real_t, &
438 default_r_val=0.4_dp)
442 CALL keyword_create(keyword, __location__, name=
"CUTOFF_RADIUS", &
443 description=
"Cutoff radius (in Angstroms) $R_c$ for the truncated "// &
444 "$\frac{1}{r}$ and longrange potentials. "// &
445 "Only valid when doing truncated calculations.", &
446 usage=
"CUTOFF_RADIUS 10.0", type_of_var=
real_t, &
447 unit_str=
"angstrom", default_r_val=0.0_dp)
452 keyword, __location__, name=
"EPS_INTEGRAL", &
453 description=
"Accuracy of ERIs that will be stored.", &
454 usage=
"EPS_INTEGRAL 1.0E-10 ", type_of_var=
real_t, &
455 default_r_val=1.0e-12_dp)
459 END SUBROUTINE create_eri_section
465 SUBROUTINE create_eri_gpw(section)
470 cpassert(.NOT.
ASSOCIATED(section))
472 description=
"Parameters for the GPW approach to electron repulsion integrals.", &
473 n_keywords=5, n_subsections=0, repeats=.false.)
477 description=
"Determines a threshold for the GPW based integration", &
478 usage=
"EPS_GRID 1.0E-9 ", type_of_var=
real_t, &
479 default_r_val=1.0e-8_dp)
484 description=
"Determines a threshold for the sparse matrix multiplications if METHOD "// &
485 "GPW_HALF_TRANSFORM is used", &
486 usage=
"EPS_FILTER 1.0E-9 ", type_of_var=
real_t, &
487 default_r_val=1.0e-9_dp)
492 description=
"The cutoff of the finest grid level in the GPW integration.", &
493 usage=
"CUTOFF 300", type_of_var=
real_t, &
494 default_r_val=300.0_dp)
499 variants=[
"RELATIVE_CUTOFF"], &
500 description=
"Determines the grid at which a Gaussian is mapped.", &
501 usage=
"REL_CUTOFF 50", type_of_var=
real_t, &
502 default_r_val=50.0_dp)
507 variants=[
"STORE_WAVEFUNCTION"], &
508 description=
"Store wavefunction in real space representation for integration.", &
509 usage=
"STORE_WFN T", type_of_var=
logical_t, &
510 default_l_val=.true., lone_keyword_l_val=.true.)
515 description=
"Sets the size of a subgroup for ERI calculation, "// &
516 "each of which with a full set of work grids, arrays or orbitals "// &
517 "depending on the method of grids (work grids, arrays, orbitals). "// &
518 "Small numbers reduce communication but increase the memory demands. "// &
519 "A negative number indicates all processes (default).", &
520 usage=
"GROUP_SIZE 2", type_of_var=
integer_t, &
526 variants=[
"IOLEVEL"], &
527 description=
"How much output is written by the individual groups.", &
528 usage=
"PRINT_LEVEL HIGH", &
530 s2a(
"SILENT",
"LOW",
"MEDIUM",
"HIGH",
"DEBUG"), &
531 enum_desc=
s2a(
"Almost no output", &
532 "Little output",
"Quite some output",
"Lots of output", &
533 "Everything is written out, useful for debugging purposes only"), &
539 END SUBROUTINE create_eri_gpw
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
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, do_backup)
creates a print_key section
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 silent_print_level
Defines the basic variable types.
integer, parameter, public dp
module that contains the definitions of the scf types
subroutine, public create_mixing_section(section, ls_scf, active_space)
Create CP2K input section for SCF or active-space density mixing.
Utilities for string manipulations.