(git:374b731)
Loading...
Searching...
No Matches
shg_integrals_test.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Calculates 2-center integrals for different r12 operators comparing the Solid harmonic
10!> Gaussian integral scheme to the Obara-Saika (OS) scheme
11!> \author Dorothea Golze [05.2016]
12! **************************************************************************************************
14
44 USE input_section_types, ONLY: &
48 USE input_val_types, ONLY: real_t
49 USE kinds, ONLY: default_string_length,&
50 dp
53#include "./base/base_uses.f90"
54
55 IMPLICIT NONE
56
57 PRIVATE
58
59! **************************************************************************************************
60
61 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'shg_integrals_test'
62
64
65CONTAINS
66
67! **************************************************************************************************
68!> \brief Create input section for unit testing
69!> \param section ...
70! **************************************************************************************************
72 TYPE(section_type), INTENT(INOUT), POINTER :: section
73
74 TYPE(keyword_type), POINTER :: keyword
75 TYPE(section_type), POINTER :: subsection
76
77 NULLIFY (keyword, subsection)
78
79 cpassert(.NOT. ASSOCIATED(section))
80 CALL section_create(section, __location__, name="SHG_INTEGRALS_TEST", &
81 description="Parameters for testing the SHG 2-center integrals for "// &
82 "different r12 operators. Test w.r.t. performance and accurarcy.", &
83 n_keywords=4, n_subsections=1)
84
85 CALL create_basis_section(subsection)
86 CALL section_add_subsection(section, subsection)
87 CALL section_release(subsection)
88
89 CALL keyword_create(keyword, __location__, &
90 name="_SECTION_PARAMETERS_", &
91 description="Controls the activation the SHG integral test. ", &
92 default_l_val=.false., &
93 lone_keyword_l_val=.true.)
94 CALL section_add_keyword(section, keyword)
95 CALL keyword_release(keyword)
96
97 CALL keyword_create(keyword, __location__, name="ABC", &
98 description="Specify the lengths of the cell vectors A, B, and C. ", &
99 usage="ABC 10.000 10.000 10.000", unit_str="angstrom", &
100 n_var=3, type_of_var=real_t)
101 CALL section_add_keyword(section, keyword)
102 CALL keyword_release(keyword)
103
104 CALL keyword_create(keyword, __location__, name="NAB_MIN", &
105 description="Minimum number of atomic distances to consider. ", &
106 default_i_val=8)
107 CALL section_add_keyword(section, keyword)
108 CALL keyword_release(keyword)
109
110 CALL keyword_create(keyword, __location__, name="NREP", &
111 description="Number of repeated calculation of each integral. ", &
112 default_i_val=1)
113 CALL section_add_keyword(section, keyword)
114 CALL keyword_release(keyword)
115
116 CALL keyword_create(keyword, __location__, name="CHECK_ACCURACY", &
117 description="Causes abortion when SHG and OS integrals differ "// &
118 "more what's given by ACCURACY_LEVEL.", &
119 default_l_val=.true., lone_keyword_l_val=.true.)
120 CALL section_add_keyword(section, keyword)
121 CALL keyword_release(keyword)
122
123 CALL keyword_create(keyword, __location__, name="ACCURACY_LEVEL", &
124 description="Level of accuracy for comparison of SHG and OS "// &
125 "integrals.", &
126 default_r_val=1.0e-8_dp)
127 CALL section_add_keyword(section, keyword)
128 CALL keyword_release(keyword)
129
130 CALL keyword_create(keyword, __location__, name="CALCULATE_DERIVATIVES", &
131 description="Calculates also the derivatives of the integrals.", &
132 default_l_val=.false., lone_keyword_l_val=.true.)
133 CALL section_add_keyword(section, keyword)
134 CALL keyword_release(keyword)
135
136 CALL keyword_create(keyword, __location__, name="TEST_OVERLAP", &
137 description="Calculates the integrals (a|b).", &
138 default_l_val=.false., lone_keyword_l_val=.true.)
139 CALL section_add_keyword(section, keyword)
140 CALL keyword_release(keyword)
141
142 CALL keyword_release(keyword)
143 CALL keyword_create(keyword, __location__, name="TEST_COULOMB", &
144 description="Calculates the integrals (a|1/r12|b).", &
145 default_l_val=.false., lone_keyword_l_val=.true.)
146 CALL section_add_keyword(section, keyword)
147 CALL keyword_release(keyword)
148
149 CALL keyword_create(keyword, __location__, name="TEST_VERF", &
150 description="Calculates the integrals (a|erf(omega*r12)/r12|b).", &
151 default_l_val=.false., lone_keyword_l_val=.true.)
152 CALL section_add_keyword(section, keyword)
153 CALL keyword_release(keyword)
154
155 CALL keyword_create(keyword, __location__, name="TEST_VERFC", &
156 description="Calculates the integrals (a|erfc(omega*r12)/r12|b).", &
157 default_l_val=.false., lone_keyword_l_val=.true.)
158 CALL section_add_keyword(section, keyword)
159 CALL keyword_release(keyword)
160
161 CALL keyword_create(keyword, __location__, name="TEST_VGAUSS", &
162 description="Calculates the integrals (a|exp(omega*r12^2)/r12|b).", &
163 default_l_val=.false., lone_keyword_l_val=.true.)
164 CALL section_add_keyword(section, keyword)
165 CALL keyword_release(keyword)
166
167 CALL keyword_create(keyword, __location__, name="TEST_GAUSS", &
168 description="Calculates the integrals (a|exp(omega*r12^2)|b).", &
169 default_l_val=.false., lone_keyword_l_val=.true.)
170 CALL section_add_keyword(section, keyword)
171 CALL keyword_release(keyword)
172
173 CALL keyword_create(keyword, __location__, name="TEST_RA2M", &
174 description="Calculates the integrals (a|(r-Ra)^(2m)|b).", &
175 default_l_val=.false., lone_keyword_l_val=.true.)
176 CALL section_add_keyword(section, keyword)
177 CALL keyword_release(keyword)
178
179 CALL keyword_create(keyword, __location__, name="M", &
180 description="Exponent in integral (a|(r-Ra)^(2m)|b).", &
181 default_i_val=1)
182 CALL section_add_keyword(section, keyword)
183 CALL keyword_release(keyword)
184
185 CALL keyword_create(keyword, __location__, name="TEST_OVERLAP_ABA", &
186 description="Calculates the integrals (a|b|b).", &
187 default_l_val=.false., lone_keyword_l_val=.true.)
188 CALL section_add_keyword(section, keyword)
189 CALL keyword_release(keyword)
190
191 CALL keyword_create(keyword, __location__, name="TEST_OVERLAP_ABB", &
192 description="Calculates the integrals (a|b|b).", &
193 default_l_val=.false., lone_keyword_l_val=.true.)
194 CALL section_add_keyword(section, keyword)
195 CALL keyword_release(keyword)
196
198
199! **************************************************************************************************
200!> \brief Unit test for performance and accuracy of the SHG integrals
201!> \param iw output unit
202!> \param shg_integrals_test_section ...
203! **************************************************************************************************
204 SUBROUTINE shg_integrals_perf_acc_test(iw, shg_integrals_test_section)
205 INTEGER, INTENT(IN) :: iw
206 TYPE(section_vals_type), INTENT(INOUT), POINTER :: shg_integrals_test_section
207
208 CHARACTER(len=*), PARAMETER :: routinen = 'shg_integrals_perf_acc_test'
209
210 CHARACTER(LEN=default_string_length) :: basis_type
211 INTEGER :: count_ab, handle, iab, jab, kab, lamax, &
212 lbmax, lcamax, lcbmax, lmax, nab, &
213 nab_min, nab_xyz, nrep, nrep_bas
214 LOGICAL :: acc_check, calc_derivatives, &
215 test_overlap_aba, test_overlap_abb
216 REAL(kind=dp) :: acc_param
217 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: rab
218 REAL(kind=dp), DIMENSION(:), POINTER :: cell_par
219 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: scona_shg, sconb_shg
220 TYPE(gto_basis_set_type), POINTER :: fba, fbb, oba, obb
221 TYPE(section_vals_type), POINTER :: basis_section
222
223 CALL timeset(routinen, handle)
224 NULLIFY (oba, obb, fba, fbb, basis_section, cell_par)
225 CALL section_vals_val_get(shg_integrals_test_section, "ABC", r_vals=cell_par)
226 CALL section_vals_val_get(shg_integrals_test_section, "NAB_MIN", i_val=nab_min)
227 CALL section_vals_val_get(shg_integrals_test_section, "NREP", i_val=nrep)
228 CALL section_vals_val_get(shg_integrals_test_section, "CHECK_ACCURACY", l_val=acc_check)
229 CALL section_vals_val_get(shg_integrals_test_section, "ACCURACY_LEVEL", r_val=acc_param)
230 CALL section_vals_val_get(shg_integrals_test_section, "CALCULATE_DERIVATIVES", l_val=calc_derivatives)
231 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP_ABA", l_val=test_overlap_aba)
232 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP_ABB", l_val=test_overlap_abb)
233
234 !*** Read the basis set information
235 basis_section => section_vals_get_subs_vals(shg_integrals_test_section, "BASIS")
236 CALL section_vals_get(basis_section, n_repetition=nrep_bas)
237 IF (.NOT. (nrep_bas == 2 .OR. nrep_bas == 3)) THEN
238 CALL cp_abort(__location__, &
239 "Provide basis sets")
240 END IF
241 CALL allocate_gto_basis_set(oba)
242 CALL read_gto_basis_set(trim("A"), basis_type, oba, basis_section, irep=1)
243 lamax = maxval(oba%lmax)
244 CALL allocate_gto_basis_set(obb)
245 CALL read_gto_basis_set(trim("B"), basis_type, obb, basis_section, irep=2)
246 lbmax = maxval(obb%lmax)
247 lmax = max(lamax, lbmax)
248 IF (test_overlap_aba) THEN
249 CALL allocate_gto_basis_set(fba)
250 CALL read_gto_basis_set(trim("CA"), basis_type, fba, basis_section, irep=3)
251 lcamax = maxval(fba%lmax)
252 lmax = max(lamax + lcamax, lbmax)
253 END IF
254 IF (test_overlap_abb) THEN
255 CALL allocate_gto_basis_set(fbb)
256 CALL read_gto_basis_set(trim("CB"), basis_type, fbb, basis_section, irep=3)
257 lcbmax = maxval(fbb%lmax)
258 lmax = max(lamax, lbmax + lcbmax)
259 END IF
260 IF (test_overlap_aba .AND. test_overlap_abb) THEN
261 lmax = max(max(lamax + lcamax, lbmax), max(lamax, lbmax + lcbmax))
262 END IF
263 !*** Initialize basis set information
264 CALL init_orbital_pointers(lmax + 1)
265 CALL init_spherical_harmonics(lmax, output_unit=-100)
266 oba%norm_type = 2
267 CALL init_orb_basis_set(oba)
268 obb%norm_type = 2
269 CALL init_orb_basis_set(obb)
270 IF (test_overlap_aba) THEN
271 fba%norm_type = 2
272 CALL init_orb_basis_set(fba)
273 END IF
274 IF (test_overlap_abb) THEN
275 fbb%norm_type = 2
276 CALL init_orb_basis_set(fbb)
277 END IF
278 ! if shg integrals are later actually used in the code, contraction_matrix_shg should be
279 ! moved to init_orb_basis_set and scon_shg should become an element of gto_basis_set_type
280 CALL contraction_matrix_shg(oba, scona_shg)
281 CALL contraction_matrix_shg(obb, sconb_shg)
282
283 !*** Create range of rab (atomic distances) to be tested
284 nab_xyz = ceiling(real(nab_min, kind=dp)**(1.0_dp/3.0_dp) - 1.0e-06)
285 nab = nab_xyz**3
286
287 ALLOCATE (rab(3, nab))
288 count_ab = 0
289 DO iab = 1, nab_xyz
290 DO jab = 1, nab_xyz
291 DO kab = 1, nab_xyz
292 count_ab = count_ab + 1
293 rab(:, count_ab) = [iab*abs(cell_par(1)), jab*abs(cell_par(2)), kab*abs(cell_par(3))]/nab_xyz
294 END DO
295 END DO
296 END DO
297
298 !*** Calculate the SHG integrals
299
300 CALL test_shg_operator12_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
301 shg_integrals_test_section, acc_check, &
302 acc_param, calc_derivatives, iw)
303
304 CALL test_shg_overlap_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
305 shg_integrals_test_section, acc_check, &
306 acc_param, calc_derivatives, iw)
307 CALL test_shg_ra2m_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
308 shg_integrals_test_section, acc_check, &
309 acc_param, calc_derivatives, iw)
310
311 CALL test_shg_overlap_aba_integrals(oba, obb, fba, fbb, rab, nrep, scona_shg, sconb_shg, &
312 shg_integrals_test_section, acc_check, &
313 acc_param, calc_derivatives, iw)
314
315 DEALLOCATE (scona_shg, sconb_shg, rab)
318 IF (test_overlap_aba) CALL deallocate_gto_basis_set(fba)
319 IF (test_overlap_abb) CALL deallocate_gto_basis_set(fbb)
320
321 CALL timestop(handle)
322
323 END SUBROUTINE shg_integrals_perf_acc_test
324
325! **************************************************************************************************
326!> \brief tests two-center integrals of the type [a|O(r12)|b]
327!> \param oba basis set on a
328!> \param obb basis set on b
329!> \param rab distance between a and b
330!> \param nrep ...
331!> \param scona_shg SHG contraction matrix for a
332!> \param sconb_shg SHG contraction matrix for b
333!> \param shg_integrals_test_section ...
334!> \param acc_check if accuracy is checked
335!> \param acc_param accuracy level, if deviation larger abort
336!> \param calc_derivatives ...
337!> \param iw ...
338! **************************************************************************************************
339 SUBROUTINE test_shg_operator12_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
340 shg_integrals_test_section, acc_check, &
341 acc_param, calc_derivatives, iw)
342 TYPE(gto_basis_set_type), POINTER :: oba, obb
343 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: rab
344 INTEGER, INTENT(IN) :: nrep
345 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: scona_shg, sconb_shg
346 TYPE(section_vals_type), INTENT(IN), POINTER :: shg_integrals_test_section
347 LOGICAL, INTENT(IN) :: acc_check
348 REAL(kind=dp), INTENT(IN) :: acc_param
349 LOGICAL, INTENT(IN) :: calc_derivatives
350 INTEGER, INTENT(IN) :: iw
351
352 INTEGER :: iab, irep, nab, nfa, nfb
353 LOGICAL :: test_any, test_coulomb, test_gauss, &
354 test_verf, test_verfc, test_vgauss
355 REAL(kind=dp) :: ddmax_coulomb, ddmax_gauss, ddmax_verf, ddmax_verfc, ddmax_vgauss, ddtemp, &
356 dmax_coulomb, dmax_gauss, dmax_verf, dmax_verfc, dmax_vgauss, dtemp, omega
357 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: vab_os, vab_shg
358 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: dvab_os, dvab_shg
359
360 CALL section_vals_val_get(shg_integrals_test_section, "TEST_COULOMB", l_val=test_coulomb)
361 CALL section_vals_val_get(shg_integrals_test_section, "TEST_VERF", l_val=test_verf)
362 CALL section_vals_val_get(shg_integrals_test_section, "TEST_VERFC", l_val=test_verfc)
363 CALL section_vals_val_get(shg_integrals_test_section, "TEST_VGAUSS", l_val=test_vgauss)
364 CALL section_vals_val_get(shg_integrals_test_section, "TEST_GAUSS", l_val=test_gauss)
365
366 test_any = (test_coulomb .OR. test_verf .OR. test_verfc .OR. test_vgauss .OR. test_gauss)
367
368 IF (test_any) THEN
369 nfa = oba%nsgf
370 nfb = obb%nsgf
371 ALLOCATE (vab_shg(nfa, nfb), dvab_shg(nfa, nfb, 3))
372 ALLOCATE (vab_os(nfa, nfb), dvab_os(nfa, nfb, 3))
373 omega = 2.3_dp
374 dmax_coulomb = 0.0_dp
375 ddmax_coulomb = 0.0_dp
376 dmax_verf = 0.0_dp
377 ddmax_verf = 0.0_dp
378 dmax_verfc = 0.0_dp
379 ddmax_verfc = 0.0_dp
380 dmax_vgauss = 0.0_dp
381 ddmax_vgauss = 0.0_dp
382 dmax_gauss = 0.0_dp
383 ddmax_gauss = 0.0_dp
384
385 nab = SIZE(rab, 2)
386 DO irep = 1, nrep
387 DO iab = 1, nab
388 !*** Coulomb: (a|1/r12|b)
389 IF (test_coulomb) THEN
390 CALL int_operators_r12_ab_shg(operator_coulomb, vab_shg, dvab_shg, rab(:, iab), &
391 oba, obb, scona_shg, sconb_shg, &
392 calculate_forces=calc_derivatives)
393 CALL int_operators_r12_ab_os(operator_coulomb, vab_os, dvab_os, rab(:, iab), &
394 oba, obb, calculate_forces=calc_derivatives)
395 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
396 dmax_coulomb = max(dmax_coulomb, dtemp)
397 ddmax_coulomb = max(ddmax_coulomb, ddtemp)
398 END IF
399 !*** verf: (a|erf(omega*r12)/r12|b)
400 IF (test_verf) THEN
401 CALL int_operators_r12_ab_shg(operator_verf, vab_shg, dvab_shg, rab(:, iab), &
402 oba, obb, scona_shg, sconb_shg, omega, &
403 calc_derivatives)
404 CALL int_operators_r12_ab_os(operator_verf, vab_os, dvab_os, rab(:, iab), &
405 oba, obb, omega=omega, calculate_forces=calc_derivatives)
406 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
407 dmax_verf = max(dmax_verf, dtemp)
408 ddmax_verf = max(ddmax_verf, ddtemp)
409 END IF
410 !*** verfc: (a|erfc(omega*r12)/r12|b)
411 IF (test_verfc) THEN
412 CALL int_operators_r12_ab_shg(operator_verfc, vab_shg, dvab_shg, rab(:, iab), &
413 oba, obb, scona_shg, sconb_shg, omega, &
414 calc_derivatives)
415 CALL int_operators_r12_ab_os(operator_verfc, vab_os, dvab_os, rab(:, iab), &
416 oba, obb, omega=omega, calculate_forces=calc_derivatives)
417 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
418 dmax_verfc = max(dmax_verfc, dtemp)
419 ddmax_verfc = max(ddmax_verfc, ddtemp)
420 END IF
421 !*** vgauss: (a|exp(omega*r12^2)/r12|b)
422 IF (test_vgauss) THEN
423 CALL int_operators_r12_ab_shg(operator_vgauss, vab_shg, dvab_shg, rab(:, iab), &
424 oba, obb, scona_shg, sconb_shg, omega, &
425 calc_derivatives)
426 CALL int_operators_r12_ab_os(operator_vgauss, vab_os, dvab_os, rab(:, iab), &
427 oba, obb, omega=omega, calculate_forces=calc_derivatives)
428 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
429 dmax_vgauss = max(dmax_vgauss, dtemp)
430 ddmax_vgauss = max(ddmax_vgauss, ddtemp)
431 END IF
432 !*** gauss: (a|exp(omega*r12^2)|b)
433 IF (test_gauss) THEN
434 CALL int_operators_r12_ab_shg(operator_gauss, vab_shg, dvab_shg, rab(:, iab), &
435 oba, obb, scona_shg, sconb_shg, omega, &
436 calc_derivatives)
437 CALL int_operators_r12_ab_os(operator_gauss, vab_os, dvab_os, rab(:, iab), &
438 oba, obb, omega=omega, calculate_forces=calc_derivatives)
439 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
440 dmax_gauss = max(dmax_gauss, dtemp)
441 ddmax_gauss = max(ddmax_gauss, ddtemp)
442 END IF
443 END DO
444 END DO
445
446 IF (iw > 0) THEN
447 WRITE (iw, fmt="(/,T2,A)") "TEST INFO FOR 2-CENTER SHG and OS INTEGRALS:"
448 WRITE (iw, fmt="(T2,A)") "Maximal deviation between SHG and OS integrals and their derivatives"
449 IF (test_coulomb) THEN
450 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|1/r12|b]", &
451 dmax_coulomb, ddmax_coulomb
452 END IF
453 IF (test_verf) THEN
454 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|erf(omega*r12)/r12|b]", &
455 dmax_verf, ddmax_verf
456 END IF
457 IF (test_verfc) THEN
458 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|erfc(omega*r12)/r12|b]", &
459 dmax_verfc, ddmax_verfc
460 END IF
461 IF (test_vgauss) THEN
462 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|exp(-omega*r12^2)/r12|b]", &
463 dmax_vgauss, ddmax_vgauss
464 END IF
465 IF (test_gauss) THEN
466 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|exp(-omega*r12^2)|b]", &
467 dmax_gauss, ddmax_gauss
468 END IF
469
470 IF (acc_check) THEN
471 IF ((dmax_coulomb >= acc_param) .OR. (ddmax_coulomb >= acc_param)) THEN
472 cpabort("[a|1/r12|b]: Dev. larger than"//cp_to_string(acc_param))
473 END IF
474 IF ((dmax_verf >= acc_param) .OR. (ddmax_verf >= acc_param)) THEN
475 cpabort("[a|erf(omega*r12)/r12|b]: Dev. larger than"//cp_to_string(acc_param))
476 END IF
477 IF ((dmax_verfc >= acc_param) .OR. (ddmax_verfc >= acc_param)) THEN
478 cpabort("[a|erfc(omega*r12)/r12|b]: Dev. larger than"//cp_to_string(acc_param))
479 END IF
480 IF ((dmax_vgauss >= acc_param) .OR. (ddmax_vgauss >= acc_param)) THEN
481 cpabort("[a|exp(-omega*r12^2)/r12|b]: Dev. larger than"//cp_to_string(acc_param))
482 END IF
483 IF ((dmax_gauss >= acc_param) .OR. (ddmax_gauss >= acc_param)) THEN
484 cpabort("[a|exp(-omega*r12^2)|b]: Dev. larger than"//cp_to_string(acc_param))
485 END IF
486 END IF
487 END IF
488 DEALLOCATE (vab_shg, vab_os, dvab_shg, dvab_os)
489 END IF
490
491 END SUBROUTINE test_shg_operator12_integrals
492
493! **************************************************************************************************
494!> \brief tests two center overlap integrals [a|b]
495!> \param oba ...
496!> \param obb ...
497!> \param rab ...
498!> \param nrep ...
499!> \param scona_shg ...
500!> \param sconb_shg ...
501!> \param shg_integrals_test_section ...
502!> \param acc_check ...
503!> \param acc_param ...
504!> \param calc_derivatives ...
505!> \param iw ...
506! **************************************************************************************************
507 SUBROUTINE test_shg_overlap_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
508 shg_integrals_test_section, acc_check, &
509 acc_param, calc_derivatives, iw)
510 TYPE(gto_basis_set_type), POINTER :: oba, obb
511 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: rab
512 INTEGER, INTENT(IN) :: nrep
513 REAL(kind=dp), DIMENSION(:, :, :), INTENT(IN) :: scona_shg, sconb_shg
514 TYPE(section_vals_type), INTENT(IN), POINTER :: shg_integrals_test_section
515 LOGICAL, INTENT(IN) :: acc_check
516 REAL(kind=dp), INTENT(IN) :: acc_param
517 LOGICAL, INTENT(IN) :: calc_derivatives
518 INTEGER, INTENT(IN) :: iw
519
520 INTEGER :: iab, irep, nab, nfa, nfb
521 LOGICAL :: test_overlap
522 REAL(kind=dp) :: ddmax_overlap, ddtemp, dmax_overlap, &
523 dtemp, dummy
524 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: sab_os, sab_shg
525 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: dsab_os, dsab_shg
526
527 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP", &
528 l_val=test_overlap)
529 IF (test_overlap) THEN
530 !effectively switch off screening; makes no sense for the tests
531 oba%set_radius(:) = 1.0e+09_dp
532 obb%set_radius(:) = 1.0e+09_dp
533 oba%pgf_radius(:, :) = 1.0e+09_dp
534 obb%pgf_radius(:, :) = 1.0e+09_dp
535 nfa = oba%nsgf
536 nfb = obb%nsgf
537 dummy = 0.0_dp
538 dmax_overlap = 0.0_dp
539 ddmax_overlap = 0.0_dp
540 ALLOCATE (sab_shg(nfa, nfb), dsab_shg(nfa, nfb, 3))
541 ALLOCATE (sab_os(nfa, nfb), dsab_os(nfa, nfb, 3))
542 nab = SIZE(rab, 2)
543 DO irep = 1, nrep
544 DO iab = 1, nab
545 CALL int_overlap_ab_shg(sab_shg, dsab_shg, rab(:, iab), oba, obb, &
546 scona_shg, sconb_shg, calc_derivatives)
547 CALL int_overlap_ab_os(sab_os, dsab_os, rab(:, iab), oba, obb, &
548 calc_derivatives, debug=.false., dmax=dummy)
549 CALL calculate_deviation_ab(sab_shg, sab_os, dsab_shg, dsab_os, dtemp, ddtemp)
550 dmax_overlap = max(dmax_overlap, dtemp)
551 ddmax_overlap = max(ddmax_overlap, ddtemp)
552 END DO
553 END DO
554
555 IF (iw > 0) THEN
556 WRITE (iw, fmt="(/,T2,A)") "TEST INFO FOR 2-CENTER OVERLAP SHG and OS INTEGRALS:"
557 WRITE (iw, fmt="(T2,A)") "Maximal deviation between SHG and OS integrals and their derivatives"
558 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|b]", &
559 dmax_overlap, ddmax_overlap
560 END IF
561 IF (acc_check) THEN
562 IF ((dmax_overlap >= acc_param) .OR. (ddmax_overlap >= acc_param)) THEN
563 cpabort("[a|b]: Deviation larger than"//cp_to_string(acc_param))
564 END IF
565 END IF
566 DEALLOCATE (sab_shg, sab_os, dsab_shg, dsab_os)
567 END IF
568
569 END SUBROUTINE test_shg_overlap_integrals
570
571! **************************************************************************************************
572!> \brief tests two-center integrals of the type [a|(r-Ra)^(2m)|b]
573!> \param oba ...
574!> \param obb ...
575!> \param rab ...
576!> \param nrep ...
577!> \param scona_shg ...
578!> \param sconb_shg ...
579!> \param shg_integrals_test_section ...
580!> \param acc_check ...
581!> \param acc_param ...
582!> \param calc_derivatives ...
583!> \param iw ...
584! **************************************************************************************************
585 SUBROUTINE test_shg_ra2m_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
586 shg_integrals_test_section, acc_check, &
587 acc_param, calc_derivatives, iw)
588 TYPE(gto_basis_set_type), POINTER :: oba, obb
589 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: rab
590 INTEGER, INTENT(IN) :: nrep
591 REAL(kind=dp), DIMENSION(:, :, :), INTENT(IN) :: scona_shg, sconb_shg
592 TYPE(section_vals_type), INTENT(IN), POINTER :: shg_integrals_test_section
593 LOGICAL, INTENT(IN) :: acc_check
594 REAL(kind=dp), INTENT(IN) :: acc_param
595 LOGICAL, INTENT(IN) :: calc_derivatives
596 INTEGER, INTENT(IN) :: iw
597
598 INTEGER :: iab, irep, m, nab, nfa, nfb
599 LOGICAL :: test_ra2m
600 REAL(kind=dp) :: ddmax, ddtemp, dmax, dtemp
601 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: vab_os, vab_shg
602 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: dvab_os, dvab_shg
603 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :, :) :: scon_ra2m
604
605 CALL section_vals_val_get(shg_integrals_test_section, "TEST_RA2M", &
606 l_val=test_ra2m)
607 IF (test_ra2m) THEN
608 CALL section_vals_val_get(shg_integrals_test_section, "M", &
609 i_val=m)
610 nfa = oba%nsgf
611 nfb = obb%nsgf
612 dmax = 0.0_dp
613 ddmax = 0.0_dp
614 CALL contraction_matrix_shg_rx2m(oba, m, scona_shg, scon_ra2m)
615 ALLOCATE (vab_shg(nfa, nfb), dvab_shg(nfa, nfb, 3))
616 ALLOCATE (vab_os(nfa, nfb), dvab_os(nfa, nfb, 3))
617 nab = SIZE(rab, 2)
618 DO irep = 1, nrep
619 DO iab = 1, nab
620 CALL int_ra2m_ab_shg(vab_shg, dvab_shg, rab(:, iab), oba, obb, &
621 scon_ra2m, sconb_shg, m, calc_derivatives)
622 CALL int_ra2m_ab_os(vab_os, dvab_os, rab(:, iab), oba, obb, m, calc_derivatives)
623 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
624 dmax = max(dmax, dtemp)
625 ddmax = max(ddmax, ddtemp)
626 END DO
627 END DO
628 IF (iw > 0) THEN
629 WRITE (iw, fmt="(/,T2,A)") "TEST INFO FOR 2-CENTER RA2m SHG and OS INTEGRALS:"
630 WRITE (iw, fmt="(T2,A)") "Maximal deviation between SHG and OS integrals and their derivatives"
631 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|(r-Ra)^(2m)|b]", &
632 dmax, ddmax
633 END IF
634 IF (acc_check) THEN
635 IF ((dmax >= acc_param) .OR. (ddmax >= acc_param)) THEN
636 cpabort("[a|ra^(2m)|b]: Deviation larger than"//cp_to_string(acc_param))
637 END IF
638 END IF
639 DEALLOCATE (scon_ra2m)
640 DEALLOCATE (vab_shg, vab_os, dvab_shg, dvab_os)
641 END IF
642 END SUBROUTINE test_shg_ra2m_integrals
643
644! **************************************************************************************************
645!> \brief test overlap integrals [a|b|a] and [a|b|b]
646!> \param oba ...
647!> \param obb ...
648!> \param fba ...
649!> \param fbb ...
650!> \param rab ...
651!> \param nrep ...
652!> \param scon_oba ...
653!> \param scon_obb ...
654!> \param shg_integrals_test_section ...
655!> \param acc_check ...
656!> \param acc_param ...
657!> \param calc_derivatives ...
658!> \param iw ...
659! **************************************************************************************************
660 SUBROUTINE test_shg_overlap_aba_integrals(oba, obb, fba, fbb, rab, nrep, scon_oba, scon_obb, &
661 shg_integrals_test_section, acc_check, &
662 acc_param, calc_derivatives, iw)
663 TYPE(gto_basis_set_type), POINTER :: oba, obb, fba, fbb
664 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: rab
665 INTEGER, INTENT(IN) :: nrep
666 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: scon_oba, scon_obb
667 TYPE(section_vals_type), INTENT(IN), POINTER :: shg_integrals_test_section
668 LOGICAL, INTENT(IN) :: acc_check
669 REAL(kind=dp), INTENT(IN) :: acc_param
670 LOGICAL, INTENT(IN) :: calc_derivatives
671 INTEGER, INTENT(IN) :: iw
672
673 INTEGER :: iab, irep, la_max, lb_max, lbb_max, &
674 maxl_orb, maxl_ri, nab, nba, nbb, nfa, &
675 nfb
676 INTEGER, DIMENSION(:, :), POINTER :: ncg_none0
677 INTEGER, DIMENSION(:, :, :), POINTER :: cg_none0_list, fba_index, fbb_index, &
678 oba_index, obb_index
679 LOGICAL :: test_overlap_aba, test_overlap_abb
680 REAL(kind=dp) :: ddmax_overlap_aba, ddmax_overlap_abb, &
681 ddtemp, dmax_overlap_aba, &
682 dmax_overlap_abb, dtemp, dummy
683 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: saba_os, saba_shg, sabb_os, sabb_shg
684 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :, :) :: dsaba_os, dsaba_shg, dsabb_os, dsabb_shg
685 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: cg_coeff
686 REAL(kind=dp), DIMENSION(:, :, :, :), POINTER :: scona_mix, sconb_mix
687
688 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP_ABA", &
689 l_val=test_overlap_aba)
690 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP_ABB", &
691 l_val=test_overlap_abb)
692 IF (test_overlap_aba .OR. test_overlap_abb) THEN
693 !effectively switch off screening; makes no sense for the tests
694 oba%set_radius(:) = 1.0e+09_dp
695 obb%set_radius(:) = 1.0e+09_dp
696 oba%pgf_radius(:, :) = 1.0e+09_dp
697 obb%pgf_radius(:, :) = 1.0e+09_dp
698 nba = oba%nsgf
699 nbb = obb%nsgf
700 maxl_orb = max(maxval(oba%lmax), maxval(obb%lmax))
701 la_max = maxval(oba%lmax)
702 lb_max = maxval(obb%lmax)
703 IF (test_overlap_aba) THEN
704 fba%set_radius(:) = 1.0e+09_dp
705 fba%pgf_radius(:, :) = 1.0e+09_dp
706 nfa = fba%nsgf
707 maxl_ri = maxval(fba%lmax) + 1 ! + 1 to avoid fail for l=0
708 ALLOCATE (saba_shg(nba, nbb, nfa), dsaba_shg(nba, nbb, nfa, 3))
709 ALLOCATE (saba_os(nba, nbb, nfa), dsaba_os(nba, nbb, nfa, 3))
710 CALL contraction_matrix_shg_mix(oba, fba, oba_index, fba_index, scona_mix)
711 END IF
712 IF (test_overlap_abb) THEN
713 fbb%set_radius(:) = 1.0e+09_dp
714 fbb%pgf_radius(:, :) = 1.0e+09_dp
715 nfb = fbb%nsgf
716 maxl_ri = maxval(fbb%lmax) + 1
717 lbb_max = maxval(obb%lmax) + maxval(fbb%lmax)
718 ALLOCATE (sabb_shg(nba, nbb, nfb), dsabb_shg(nba, nbb, nfb, 3))
719 ALLOCATE (sabb_os(nba, nbb, nfb), dsabb_os(nba, nbb, nfb, 3))
720 CALL contraction_matrix_shg_mix(obb, fbb, obb_index, fbb_index, sconb_mix)
721 END IF
722 dummy = 0.0_dp
723 dmax_overlap_aba = 0.0_dp
724 ddmax_overlap_aba = 0.0_dp
725 dmax_overlap_abb = 0.0_dp
726 ddmax_overlap_abb = 0.0_dp
727 CALL get_clebsch_gordon_coefficients(cg_coeff, cg_none0_list, ncg_none0, maxl_orb, maxl_ri)
728 nab = SIZE(rab, 2)
729 IF (test_overlap_aba) THEN
730 DO irep = 1, nrep
731 DO iab = 1, nab
732 CALL int_overlap_aba_shg(saba_shg, dsaba_shg, rab(:, iab), oba, obb, fba, &
733 scon_obb, scona_mix, oba_index, fba_index, &
734 cg_coeff, cg_none0_list, ncg_none0, &
735 calc_derivatives)
736 CALL int_overlap_aba_os(saba_os, dsaba_os, rab(:, iab), oba, obb, fba, &
737 calc_derivatives, debug=.false., dmax=dummy)
738 CALL calculate_deviation_abx(saba_shg, saba_os, dsaba_shg, dsaba_os, dtemp, ddtemp)
739 dmax_overlap_aba = max(dmax_overlap_aba, dtemp)
740 ddmax_overlap_aba = max(ddmax_overlap_aba, ddtemp)
741 END DO
742 END DO
743 DEALLOCATE (oba_index, fba_index, scona_mix)
744 DEALLOCATE (saba_shg, saba_os, dsaba_shg, dsaba_os)
745 END IF
746 IF (test_overlap_abb) THEN
747 DO irep = 1, nrep
748 DO iab = 1, nab
749 CALL int_overlap_abb_shg(sabb_shg, dsabb_shg, rab(:, iab), oba, obb, fbb, &
750 scon_oba, sconb_mix, obb_index, fbb_index, &
751 cg_coeff, cg_none0_list, ncg_none0, &
752 calc_derivatives)
753 CALL int_overlap_abb_os(sabb_os, dsabb_os, rab(:, iab), oba, obb, fbb, &
754 calc_derivatives, debug=.false., dmax=dummy)
755 CALL calculate_deviation_abx(sabb_shg, sabb_os, dsabb_shg, dsabb_os, dtemp, ddtemp)
756 dmax_overlap_abb = max(dmax_overlap_abb, dtemp)
757 ddmax_overlap_abb = max(ddmax_overlap_abb, ddtemp)
758 END DO
759 END DO
760 DEALLOCATE (obb_index, fbb_index, sconb_mix)
761 DEALLOCATE (sabb_shg, sabb_os, dsabb_shg, dsabb_os)
762 END IF
763 IF (iw > 0) THEN
764 WRITE (iw, fmt="(/,T2,A)") "TEST INFO [a|b|x] OVERLAP SHG and OS INTEGRALS:"
765 WRITE (iw, fmt="(T2,A)") "Maximal deviation between SHG and OS integrals and their derivatives"
766 IF (test_overlap_aba) THEN
767 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|b|a]", &
768 dmax_overlap_aba, ddmax_overlap_aba
769 END IF
770 IF (test_overlap_abb) THEN
771 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|b|b]", &
772 dmax_overlap_abb, ddmax_overlap_abb
773 END IF
774 END IF
775 IF (acc_check) THEN
776 IF ((dmax_overlap_aba >= acc_param) .OR. (ddmax_overlap_aba >= acc_param)) THEN
777 cpabort("[a|b|a]: Dev. larger than"//cp_to_string(acc_param))
778 END IF
779 IF ((dmax_overlap_abb >= acc_param) .OR. (ddmax_overlap_abb >= acc_param)) THEN
780 cpabort("[a|b|b]: Dev. larger than"//cp_to_string(acc_param))
781 END IF
782 END IF
783 DEALLOCATE (cg_coeff, cg_none0_list, ncg_none0)
784 END IF
785
786 END SUBROUTINE test_shg_overlap_aba_integrals
787
788! **************************************************************************************************
789!> \brief Calculation of the deviation between SHG and OS integrals
790!> \param vab_shg integral matrix obtained from the SHG scheme
791!> \param vab_os integral matrix obtained from the OS scheme
792!> \param dvab_shg derivative of the integrals, SHG
793!> \param dvab_os derivative of the integrals, OS
794!> \param dmax maximal deviation of vab matrices
795!> \param ddmax maximal deviation of dvab matrices
796! **************************************************************************************************
797 SUBROUTINE calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dmax, ddmax)
798
799 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: vab_shg, vab_os
800 REAL(kind=dp), DIMENSION(:, :, :), INTENT(IN) :: dvab_shg, dvab_os
801 REAL(kind=dp), INTENT(OUT) :: dmax, ddmax
802
803 INTEGER :: i, j, k
804 REAL(kind=dp) :: diff
805
806 dmax = 0.0_dp
807 ddmax = 0.0_dp
808
809 ! integrals vab
810 DO j = 1, SIZE(vab_shg, 2)
811 DO i = 1, SIZE(vab_shg, 1)
812 diff = abs(vab_shg(i, j) - vab_os(i, j))
813 dmax = max(dmax, diff)
814 END DO
815 END DO
816
817 ! derivatives dvab
818 DO k = 1, 3
819 DO j = 1, SIZE(dvab_shg, 2)
820 DO i = 1, SIZE(dvab_shg, 1)
821 diff = abs(dvab_shg(i, j, k) - dvab_os(i, j, k))
822 ddmax = max(ddmax, diff)
823 END DO
824 END DO
825 END DO
826
827 END SUBROUTINE calculate_deviation_ab
828
829! **************************************************************************************************
830!> \brief Calculation of the deviation between SHG and OS integrals
831!> \param vab_shg integral matrix obtained from the SHG scheme
832!> \param vab_os integral matrix obtained from the OS scheme
833!> \param dvab_shg derivative of the integrals, SHG
834!> \param dvab_os derivative of the integrals, OS
835!> \param dmax maximal deviation of vab matrices
836!> \param ddmax maximal deviation of dvab matrices
837! **************************************************************************************************
838 SUBROUTINE calculate_deviation_abx(vab_shg, vab_os, dvab_shg, dvab_os, dmax, ddmax)
839
840 REAL(kind=dp), DIMENSION(:, :, :), INTENT(IN) :: vab_shg, vab_os
841 REAL(kind=dp), DIMENSION(:, :, :, :), INTENT(IN) :: dvab_shg, dvab_os
842 REAL(kind=dp), INTENT(OUT) :: dmax, ddmax
843
844 INTEGER :: i, j, k, l
845 REAL(kind=dp) :: diff
846
847 dmax = 0.0_dp
848 ddmax = 0.0_dp
849
850 ! integrals vab
851 DO k = 1, SIZE(vab_shg, 3)
852 DO j = 1, SIZE(vab_shg, 2)
853 DO i = 1, SIZE(vab_shg, 1)
854 diff = abs(vab_shg(i, j, k) - vab_os(i, j, k))
855 dmax = max(dmax, diff)
856 END DO
857 END DO
858 END DO
859
860 ! derivatives dvab
861 DO l = 1, 3
862 DO k = 1, SIZE(dvab_shg, 3)
863 DO j = 1, SIZE(dvab_shg, 2)
864 DO i = 1, SIZE(dvab_shg, 1)
865 diff = abs(dvab_shg(i, j, k, l) - dvab_os(i, j, k, l))
866 ddmax = max(ddmax, diff)
867 END DO
868 END DO
869 END DO
870 END DO
871
872 END SUBROUTINE calculate_deviation_abx
873
874END MODULE shg_integrals_test
subroutine, public deallocate_gto_basis_set(gto_basis_set)
...
subroutine, public allocate_gto_basis_set(gto_basis_set)
...
subroutine, public init_orb_basis_set(gto_basis_set)
Initialise a Gaussian-type orbital (GTO) basis set data set.
constants for the different operators of the 2c-integrals
integer, parameter, public operator_gauss
integer, parameter, public operator_verf
integer, parameter, public operator_vgauss
integer, parameter, public operator_verfc
integer, parameter, public operator_coulomb
various routines to log and control the output. The idea is that decisions about where to log should ...
Calculation of contracted, spherical Gaussian integrals using the (OS) integral scheme....
subroutine, public int_overlap_aba_os(abaint, dabdaint, rab, oba, obb, fba, calculate_forces, debug, dmax)
calculate integrals (a,b,fa)
subroutine, public int_overlap_ab_os(sab, dsab, rab, fba, fbb, calculate_forces, debug, dmax)
calculate overlap integrals (a,b)
subroutine, public int_overlap_abb_os(abbint, dabbint, rab, oba, obb, fbb, calculate_forces, debug, dmax)
calculate integrals (a,b,fb)
subroutine, public int_operators_r12_ab_os(r12_operator, vab, dvab, rab, fba, fbb, omega, r_cutoff, calculate_forces)
Calcululates the two-center integrals of the type (a|O(r12)|b) using the OS scheme.
subroutine, public int_ra2m_ab_os(sab, dsab, rab, fba, fbb, m, calculate_forces)
calculate integrals (a|(r-Ra)^(2m)|b)
Initialization for solid harmonic Gaussian (SHG) integral scheme. Scheme for calculation of contracte...
subroutine, public contraction_matrix_shg_rx2m(basis, m, scon_shg, scon_rx2m)
...
subroutine, public contraction_matrix_shg_mix(orb_basis, ri_basis, orb_index, ri_index, scon_mix)
mixed contraction matrix for SHG integrals [aba] and [abb] for orbital and ri basis at the same atom
subroutine, public contraction_matrix_shg(basis, scon_shg)
contraction matrix for SHG integrals
subroutine, public get_clebsch_gordon_coefficients(my_cg, cg_none0_list, ncg_none0, maxl1, maxl2)
calculate the Clebsch-Gordon (CG) coefficients for expansion of the product of two spherical harmonic...
Calculation of contracted, spherical Gaussian integrals using the solid harmonic Gaussian (SHG) integ...
subroutine, public int_overlap_aba_shg(saba, dsaba, rab, oba, obb, fba, scon_obb, scona_mix, oba_index, fba_index, cg_coeff, cg_none0_list, ncg_none0, calculate_forces)
calculate integrals (a,b,fa)
subroutine, public int_overlap_ab_shg(vab, dvab, rab, fba, fbb, scona_shg, sconb_shg, calculate_forces)
calculate overlap integrals (a,b)
subroutine, public int_ra2m_ab_shg(vab, dvab, rab, fba, fbb, scon_ra2m, sconb_shg, m, calculate_forces)
Calcululates the two-center integrals of the type (a|(r-Ra)^(2m)|b) using the SHG scheme.
subroutine, public int_overlap_abb_shg(sabb, dsabb, rab, oba, obb, fbb, scon_oba, sconb_mix, obb_index, fbb_index, cg_coeff, cg_none0_list, ncg_none0, calculate_forces)
calculate integrals (a,b,fb)
subroutine, public int_operators_r12_ab_shg(r12_operator, vab, dvab, rab, fba, fbb, scona_shg, sconb_shg, omega, calculate_forces)
Calcululates the two-center integrals of the type (a|O(r12)|b) using the SHG scheme.
builds the subsystem section of the input
subroutine, public create_basis_section(section)
Creates the &BASIS section.
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
subroutine, public section_add_subsection(section, subsection)
adds a subsection to the given section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
recursive subroutine, public section_release(section)
releases the given keyword list (see doc/ReferenceCounting.html)
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
a wrapper for basic fortran types.
integer, parameter, public real_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
Provides Cartesian and spherical orbital pointers and indices.
subroutine, public init_orbital_pointers(maxl)
Initialize or update the orbital pointers.
Calculation of the spherical harmonics and the corresponding orbital transformation matrices.
subroutine, public init_spherical_harmonics(maxl, output_unit)
Initialize or update the orbital transformation matrices.
Calculates 2-center integrals for different r12 operators comparing the Solid harmonic Gaussian integ...
subroutine, public shg_integrals_perf_acc_test(iw, shg_integrals_test_section)
Unit test for performance and accuracy of the SHG integrals.
subroutine, public create_shg_integrals_test_section(section)
Create input section for unit testing.
represent a keyword in the input
represent a section of the input file