(git:6344619)
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-2026 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 REAL(kind=dp), PARAMETER :: d_nab = 1.0e-06_dp
210
211 CHARACTER(LEN=default_string_length) :: basis_type
212 INTEGER :: count_ab, handle, iab, jab, kab, lamax, &
213 lbmax, lcamax, lcbmax, lmax, nab, &
214 nab_min, nab_xyz, nrep, nrep_bas
215 LOGICAL :: acc_check, calc_derivatives, &
216 test_overlap_aba, test_overlap_abb
217 REAL(kind=dp) :: acc_param
218 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: rab
219 REAL(kind=dp), DIMENSION(:), POINTER :: cell_par
220 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: scona_shg, sconb_shg
221 TYPE(gto_basis_set_type), POINTER :: fba, fbb, oba, obb
222 TYPE(section_vals_type), POINTER :: basis_section
223
224 CALL timeset(routinen, handle)
225 NULLIFY (oba, obb, fba, fbb, basis_section, cell_par)
226 CALL section_vals_val_get(shg_integrals_test_section, "ABC", r_vals=cell_par)
227 CALL section_vals_val_get(shg_integrals_test_section, "NAB_MIN", i_val=nab_min)
228 CALL section_vals_val_get(shg_integrals_test_section, "NREP", i_val=nrep)
229 CALL section_vals_val_get(shg_integrals_test_section, "CHECK_ACCURACY", l_val=acc_check)
230 CALL section_vals_val_get(shg_integrals_test_section, "ACCURACY_LEVEL", r_val=acc_param)
231 CALL section_vals_val_get(shg_integrals_test_section, "CALCULATE_DERIVATIVES", l_val=calc_derivatives)
232 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP_ABA", l_val=test_overlap_aba)
233 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP_ABB", l_val=test_overlap_abb)
234
235 !*** Read the basis set information
236 basis_section => section_vals_get_subs_vals(shg_integrals_test_section, "BASIS")
237 CALL section_vals_get(basis_section, n_repetition=nrep_bas)
238 IF (.NOT. (nrep_bas == 2 .OR. nrep_bas == 3)) THEN
239 CALL cp_abort(__location__, &
240 "Provide basis sets")
241 END IF
242 CALL allocate_gto_basis_set(oba)
243 CALL read_gto_basis_set(trim("A"), basis_type, oba, basis_section, irep=1)
244 lamax = maxval(oba%lmax)
245 CALL allocate_gto_basis_set(obb)
246 CALL read_gto_basis_set(trim("B"), basis_type, obb, basis_section, irep=2)
247 lbmax = maxval(obb%lmax)
248 lmax = max(lamax, lbmax)
249 IF (test_overlap_aba) THEN
250 CALL allocate_gto_basis_set(fba)
251 CALL read_gto_basis_set(trim("CA"), basis_type, fba, basis_section, irep=3)
252 lcamax = maxval(fba%lmax)
253 lmax = max(lamax + lcamax, lbmax)
254 END IF
255 IF (test_overlap_abb) THEN
256 CALL allocate_gto_basis_set(fbb)
257 CALL read_gto_basis_set(trim("CB"), basis_type, fbb, basis_section, irep=3)
258 lcbmax = maxval(fbb%lmax)
259 lmax = max(lamax, lbmax + lcbmax)
260 END IF
261 IF (test_overlap_aba .AND. test_overlap_abb) THEN
262 lmax = max(max(lamax + lcamax, lbmax), max(lamax, lbmax + lcbmax))
263 END IF
264 !*** Initialize basis set information
265 CALL init_orbital_pointers(lmax + 1)
266 CALL init_spherical_harmonics(lmax, output_unit=-100)
267 oba%norm_type = 2
268 CALL init_orb_basis_set(oba)
269 obb%norm_type = 2
270 CALL init_orb_basis_set(obb)
271 IF (test_overlap_aba) THEN
272 fba%norm_type = 2
273 CALL init_orb_basis_set(fba)
274 END IF
275 IF (test_overlap_abb) THEN
276 fbb%norm_type = 2
277 CALL init_orb_basis_set(fbb)
278 END IF
279 ! if shg integrals are later actually used in the code, contraction_matrix_shg should be
280 ! moved to init_orb_basis_set and scon_shg should become an element of gto_basis_set_type
281 CALL contraction_matrix_shg(oba, scona_shg)
282 CALL contraction_matrix_shg(obb, sconb_shg)
283
284 !*** Create range of rab (atomic distances) to be tested
285 nab_xyz = ceiling(real(nab_min, kind=dp)**(1.0_dp/3.0_dp) - d_nab)
286 nab = nab_xyz**3
287
288 ALLOCATE (rab(3, nab))
289 count_ab = 0
290 DO iab = 1, nab_xyz
291 DO jab = 1, nab_xyz
292 DO kab = 1, nab_xyz
293 count_ab = count_ab + 1
294 rab(:, count_ab) = [iab*abs(cell_par(1)), jab*abs(cell_par(2)), kab*abs(cell_par(3))]/nab_xyz
295 END DO
296 END DO
297 END DO
298
299 !*** Calculate the SHG integrals
300
301 CALL test_shg_operator12_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
302 shg_integrals_test_section, acc_check, &
303 acc_param, calc_derivatives, iw)
304
305 CALL test_shg_overlap_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
306 shg_integrals_test_section, acc_check, &
307 acc_param, calc_derivatives, iw)
308 CALL test_shg_ra2m_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
309 shg_integrals_test_section, acc_check, &
310 acc_param, calc_derivatives, iw)
311
312 CALL test_shg_overlap_aba_integrals(oba, obb, fba, fbb, rab, nrep, scona_shg, sconb_shg, &
313 shg_integrals_test_section, acc_check, &
314 acc_param, calc_derivatives, iw)
315
316 DEALLOCATE (scona_shg, sconb_shg, rab)
319 IF (test_overlap_aba) CALL deallocate_gto_basis_set(fba)
320 IF (test_overlap_abb) CALL deallocate_gto_basis_set(fbb)
321
322 CALL timestop(handle)
323
324 END SUBROUTINE shg_integrals_perf_acc_test
325
326! **************************************************************************************************
327!> \brief tests two-center integrals of the type [a|O(r12)|b]
328!> \param oba basis set on a
329!> \param obb basis set on b
330!> \param rab distance between a and b
331!> \param nrep ...
332!> \param scona_shg SHG contraction matrix for a
333!> \param sconb_shg SHG contraction matrix for b
334!> \param shg_integrals_test_section ...
335!> \param acc_check if accuracy is checked
336!> \param acc_param accuracy level, if deviation larger abort
337!> \param calc_derivatives ...
338!> \param iw ...
339! **************************************************************************************************
340 SUBROUTINE test_shg_operator12_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
341 shg_integrals_test_section, acc_check, &
342 acc_param, calc_derivatives, iw)
343 TYPE(gto_basis_set_type), POINTER :: oba, obb
344 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: rab
345 INTEGER, INTENT(IN) :: nrep
346 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: scona_shg, sconb_shg
347 TYPE(section_vals_type), INTENT(IN), POINTER :: shg_integrals_test_section
348 LOGICAL, INTENT(IN) :: acc_check
349 REAL(kind=dp), INTENT(IN) :: acc_param
350 LOGICAL, INTENT(IN) :: calc_derivatives
351 INTEGER, INTENT(IN) :: iw
352
353 INTEGER :: iab, irep, nab, nfa, nfb
354 LOGICAL :: test_any, test_coulomb, test_gauss, &
355 test_verf, test_verfc, test_vgauss
356 REAL(kind=dp) :: ddmax_coulomb, ddmax_gauss, ddmax_verf, ddmax_verfc, ddmax_vgauss, ddtemp, &
357 dmax_coulomb, dmax_gauss, dmax_verf, dmax_verfc, dmax_vgauss, dtemp, omega
358 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: vab_os, vab_shg
359 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: dvab_os, dvab_shg
360
361 CALL section_vals_val_get(shg_integrals_test_section, "TEST_COULOMB", l_val=test_coulomb)
362 CALL section_vals_val_get(shg_integrals_test_section, "TEST_VERF", l_val=test_verf)
363 CALL section_vals_val_get(shg_integrals_test_section, "TEST_VERFC", l_val=test_verfc)
364 CALL section_vals_val_get(shg_integrals_test_section, "TEST_VGAUSS", l_val=test_vgauss)
365 CALL section_vals_val_get(shg_integrals_test_section, "TEST_GAUSS", l_val=test_gauss)
366
367 test_any = (test_coulomb .OR. test_verf .OR. test_verfc .OR. test_vgauss .OR. test_gauss)
368
369 IF (test_any) THEN
370 nfa = oba%nsgf
371 nfb = obb%nsgf
372 ALLOCATE (vab_shg(nfa, nfb), dvab_shg(nfa, nfb, 3))
373 ALLOCATE (vab_os(nfa, nfb), dvab_os(nfa, nfb, 3))
374 omega = 2.3_dp
375 dmax_coulomb = 0.0_dp
376 ddmax_coulomb = 0.0_dp
377 dmax_verf = 0.0_dp
378 ddmax_verf = 0.0_dp
379 dmax_verfc = 0.0_dp
380 ddmax_verfc = 0.0_dp
381 dmax_vgauss = 0.0_dp
382 ddmax_vgauss = 0.0_dp
383 dmax_gauss = 0.0_dp
384 ddmax_gauss = 0.0_dp
385
386 nab = SIZE(rab, 2)
387 DO irep = 1, nrep
388 DO iab = 1, nab
389 !*** Coulomb: (a|1/r12|b)
390 IF (test_coulomb) THEN
391 CALL int_operators_r12_ab_shg(operator_coulomb, vab_shg, dvab_shg, rab(:, iab), &
392 oba, obb, scona_shg, sconb_shg, &
393 calculate_forces=calc_derivatives)
394 CALL int_operators_r12_ab_os(operator_coulomb, vab_os, dvab_os, rab(:, iab), &
395 oba, obb, calculate_forces=calc_derivatives)
396 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
397 dmax_coulomb = max(dmax_coulomb, dtemp)
398 ddmax_coulomb = max(ddmax_coulomb, ddtemp)
399 END IF
400 !*** verf: (a|erf(omega*r12)/r12|b)
401 IF (test_verf) THEN
402 CALL int_operators_r12_ab_shg(operator_verf, vab_shg, dvab_shg, rab(:, iab), &
403 oba, obb, scona_shg, sconb_shg, omega, &
404 calc_derivatives)
405 CALL int_operators_r12_ab_os(operator_verf, vab_os, dvab_os, rab(:, iab), &
406 oba, obb, omega=omega, calculate_forces=calc_derivatives)
407 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
408 dmax_verf = max(dmax_verf, dtemp)
409 ddmax_verf = max(ddmax_verf, ddtemp)
410 END IF
411 !*** verfc: (a|erfc(omega*r12)/r12|b)
412 IF (test_verfc) THEN
413 CALL int_operators_r12_ab_shg(operator_verfc, vab_shg, dvab_shg, rab(:, iab), &
414 oba, obb, scona_shg, sconb_shg, omega, &
415 calc_derivatives)
416 CALL int_operators_r12_ab_os(operator_verfc, vab_os, dvab_os, rab(:, iab), &
417 oba, obb, omega=omega, calculate_forces=calc_derivatives)
418 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
419 dmax_verfc = max(dmax_verfc, dtemp)
420 ddmax_verfc = max(ddmax_verfc, ddtemp)
421 END IF
422 !*** vgauss: (a|exp(omega*r12^2)/r12|b)
423 IF (test_vgauss) THEN
424 CALL int_operators_r12_ab_shg(operator_vgauss, vab_shg, dvab_shg, rab(:, iab), &
425 oba, obb, scona_shg, sconb_shg, omega, &
426 calc_derivatives)
427 CALL int_operators_r12_ab_os(operator_vgauss, vab_os, dvab_os, rab(:, iab), &
428 oba, obb, omega=omega, calculate_forces=calc_derivatives)
429 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
430 dmax_vgauss = max(dmax_vgauss, dtemp)
431 ddmax_vgauss = max(ddmax_vgauss, ddtemp)
432 END IF
433 !*** gauss: (a|exp(omega*r12^2)|b)
434 IF (test_gauss) THEN
435 CALL int_operators_r12_ab_shg(operator_gauss, vab_shg, dvab_shg, rab(:, iab), &
436 oba, obb, scona_shg, sconb_shg, omega, &
437 calc_derivatives)
438 CALL int_operators_r12_ab_os(operator_gauss, vab_os, dvab_os, rab(:, iab), &
439 oba, obb, omega=omega, calculate_forces=calc_derivatives)
440 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
441 dmax_gauss = max(dmax_gauss, dtemp)
442 ddmax_gauss = max(ddmax_gauss, ddtemp)
443 END IF
444 END DO
445 END DO
446
447 IF (iw > 0) THEN
448 WRITE (iw, fmt="(/,T2,A)") "TEST INFO FOR 2-CENTER SHG and OS INTEGRALS:"
449 WRITE (iw, fmt="(T2,A)") "Maximal deviation between SHG and OS integrals and their derivatives"
450 IF (test_coulomb) THEN
451 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|1/r12|b]", &
452 dmax_coulomb, ddmax_coulomb
453 END IF
454 IF (test_verf) THEN
455 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|erf(omega*r12)/r12|b]", &
456 dmax_verf, ddmax_verf
457 END IF
458 IF (test_verfc) THEN
459 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|erfc(omega*r12)/r12|b]", &
460 dmax_verfc, ddmax_verfc
461 END IF
462 IF (test_vgauss) THEN
463 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|exp(-omega*r12^2)/r12|b]", &
464 dmax_vgauss, ddmax_vgauss
465 END IF
466 IF (test_gauss) THEN
467 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|exp(-omega*r12^2)|b]", &
468 dmax_gauss, ddmax_gauss
469 END IF
470
471 IF (acc_check) THEN
472 IF ((dmax_coulomb >= acc_param) .OR. (ddmax_coulomb >= acc_param)) THEN
473 cpabort("[a|1/r12|b]: Dev. larger than"//cp_to_string(acc_param))
474 END IF
475 IF ((dmax_verf >= acc_param) .OR. (ddmax_verf >= acc_param)) THEN
476 cpabort("[a|erf(omega*r12)/r12|b]: Dev. larger than"//cp_to_string(acc_param))
477 END IF
478 IF ((dmax_verfc >= acc_param) .OR. (ddmax_verfc >= acc_param)) THEN
479 cpabort("[a|erfc(omega*r12)/r12|b]: Dev. larger than"//cp_to_string(acc_param))
480 END IF
481 IF ((dmax_vgauss >= acc_param) .OR. (ddmax_vgauss >= acc_param)) THEN
482 cpabort("[a|exp(-omega*r12^2)/r12|b]: Dev. larger than"//cp_to_string(acc_param))
483 END IF
484 IF ((dmax_gauss >= acc_param) .OR. (ddmax_gauss >= acc_param)) THEN
485 cpabort("[a|exp(-omega*r12^2)|b]: Dev. larger than"//cp_to_string(acc_param))
486 END IF
487 END IF
488 END IF
489 DEALLOCATE (vab_shg, vab_os, dvab_shg, dvab_os)
490 END IF
491
492 END SUBROUTINE test_shg_operator12_integrals
493
494! **************************************************************************************************
495!> \brief tests two center overlap integrals [a|b]
496!> \param oba ...
497!> \param obb ...
498!> \param rab ...
499!> \param nrep ...
500!> \param scona_shg ...
501!> \param sconb_shg ...
502!> \param shg_integrals_test_section ...
503!> \param acc_check ...
504!> \param acc_param ...
505!> \param calc_derivatives ...
506!> \param iw ...
507! **************************************************************************************************
508 SUBROUTINE test_shg_overlap_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
509 shg_integrals_test_section, acc_check, &
510 acc_param, calc_derivatives, iw)
511 TYPE(gto_basis_set_type), POINTER :: oba, obb
512 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: rab
513 INTEGER, INTENT(IN) :: nrep
514 REAL(kind=dp), DIMENSION(:, :, :), INTENT(IN) :: scona_shg, sconb_shg
515 TYPE(section_vals_type), INTENT(IN), POINTER :: shg_integrals_test_section
516 LOGICAL, INTENT(IN) :: acc_check
517 REAL(kind=dp), INTENT(IN) :: acc_param
518 LOGICAL, INTENT(IN) :: calc_derivatives
519 INTEGER, INTENT(IN) :: iw
520
521 INTEGER :: iab, irep, nab, nfa, nfb
522 LOGICAL :: test_overlap
523 REAL(kind=dp) :: ddmax_overlap, ddtemp, dmax_overlap, &
524 dtemp, dummy
525 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: sab_os, sab_shg
526 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: dsab_os, dsab_shg
527
528 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP", &
529 l_val=test_overlap)
530 IF (test_overlap) THEN
531 !effectively switch off screening; makes no sense for the tests
532 oba%set_radius(:) = 1.0e+09_dp
533 obb%set_radius(:) = 1.0e+09_dp
534 oba%pgf_radius(:, :) = 1.0e+09_dp
535 obb%pgf_radius(:, :) = 1.0e+09_dp
536 nfa = oba%nsgf
537 nfb = obb%nsgf
538 dummy = 0.0_dp
539 dmax_overlap = 0.0_dp
540 ddmax_overlap = 0.0_dp
541 ALLOCATE (sab_shg(nfa, nfb), dsab_shg(nfa, nfb, 3))
542 ALLOCATE (sab_os(nfa, nfb), dsab_os(nfa, nfb, 3))
543 nab = SIZE(rab, 2)
544 DO irep = 1, nrep
545 DO iab = 1, nab
546 CALL int_overlap_ab_shg(sab_shg, dsab_shg, rab(:, iab), oba, obb, &
547 scona_shg, sconb_shg, calc_derivatives)
548 CALL int_overlap_ab_os(sab_os, dsab_os, rab(:, iab), oba, obb, &
549 calc_derivatives, debug=.false., dmax=dummy)
550 CALL calculate_deviation_ab(sab_shg, sab_os, dsab_shg, dsab_os, dtemp, ddtemp)
551 dmax_overlap = max(dmax_overlap, dtemp)
552 ddmax_overlap = max(ddmax_overlap, ddtemp)
553 END DO
554 END DO
555
556 IF (iw > 0) THEN
557 WRITE (iw, fmt="(/,T2,A)") "TEST INFO FOR 2-CENTER OVERLAP SHG and OS INTEGRALS:"
558 WRITE (iw, fmt="(T2,A)") "Maximal deviation between SHG and OS integrals and their derivatives"
559 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|b]", &
560 dmax_overlap, ddmax_overlap
561 END IF
562 IF (acc_check) THEN
563 IF ((dmax_overlap >= acc_param) .OR. (ddmax_overlap >= acc_param)) THEN
564 cpabort("[a|b]: Deviation larger than"//cp_to_string(acc_param))
565 END IF
566 END IF
567 DEALLOCATE (sab_shg, sab_os, dsab_shg, dsab_os)
568 END IF
569
570 END SUBROUTINE test_shg_overlap_integrals
571
572! **************************************************************************************************
573!> \brief tests two-center integrals of the type [a|(r-Ra)^(2m)|b]
574!> \param oba ...
575!> \param obb ...
576!> \param rab ...
577!> \param nrep ...
578!> \param scona_shg ...
579!> \param sconb_shg ...
580!> \param shg_integrals_test_section ...
581!> \param acc_check ...
582!> \param acc_param ...
583!> \param calc_derivatives ...
584!> \param iw ...
585! **************************************************************************************************
586 SUBROUTINE test_shg_ra2m_integrals(oba, obb, rab, nrep, scona_shg, sconb_shg, &
587 shg_integrals_test_section, acc_check, &
588 acc_param, calc_derivatives, iw)
589 TYPE(gto_basis_set_type), POINTER :: oba, obb
590 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: rab
591 INTEGER, INTENT(IN) :: nrep
592 REAL(kind=dp), DIMENSION(:, :, :), INTENT(IN) :: scona_shg, sconb_shg
593 TYPE(section_vals_type), INTENT(IN), POINTER :: shg_integrals_test_section
594 LOGICAL, INTENT(IN) :: acc_check
595 REAL(kind=dp), INTENT(IN) :: acc_param
596 LOGICAL, INTENT(IN) :: calc_derivatives
597 INTEGER, INTENT(IN) :: iw
598
599 INTEGER :: iab, irep, m, nab, nfa, nfb
600 LOGICAL :: test_ra2m
601 REAL(kind=dp) :: ddmax, ddtemp, dmax, dtemp
602 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: vab_os, vab_shg
603 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: dvab_os, dvab_shg
604 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :, :) :: scon_ra2m
605
606 CALL section_vals_val_get(shg_integrals_test_section, "TEST_RA2M", &
607 l_val=test_ra2m)
608 IF (test_ra2m) THEN
609 CALL section_vals_val_get(shg_integrals_test_section, "M", &
610 i_val=m)
611 nfa = oba%nsgf
612 nfb = obb%nsgf
613 dmax = 0.0_dp
614 ddmax = 0.0_dp
615 CALL contraction_matrix_shg_rx2m(oba, m, scona_shg, scon_ra2m)
616 ALLOCATE (vab_shg(nfa, nfb), dvab_shg(nfa, nfb, 3))
617 ALLOCATE (vab_os(nfa, nfb), dvab_os(nfa, nfb, 3))
618 nab = SIZE(rab, 2)
619 DO irep = 1, nrep
620 DO iab = 1, nab
621 CALL int_ra2m_ab_shg(vab_shg, dvab_shg, rab(:, iab), oba, obb, &
622 scon_ra2m, sconb_shg, m, calc_derivatives)
623 CALL int_ra2m_ab_os(vab_os, dvab_os, rab(:, iab), oba, obb, m, calc_derivatives)
624 CALL calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dtemp, ddtemp)
625 dmax = max(dmax, dtemp)
626 ddmax = max(ddmax, ddtemp)
627 END DO
628 END DO
629 IF (iw > 0) THEN
630 WRITE (iw, fmt="(/,T2,A)") "TEST INFO FOR 2-CENTER RA2m SHG and OS INTEGRALS:"
631 WRITE (iw, fmt="(T2,A)") "Maximal deviation between SHG and OS integrals and their derivatives"
632 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|(r-Ra)^(2m)|b]", &
633 dmax, ddmax
634 END IF
635 IF (acc_check) THEN
636 IF ((dmax >= acc_param) .OR. (ddmax >= acc_param)) THEN
637 cpabort("[a|ra^(2m)|b]: Deviation larger than"//cp_to_string(acc_param))
638 END IF
639 END IF
640 DEALLOCATE (scon_ra2m)
641 DEALLOCATE (vab_shg, vab_os, dvab_shg, dvab_os)
642 END IF
643 END SUBROUTINE test_shg_ra2m_integrals
644
645! **************************************************************************************************
646!> \brief test overlap integrals [a|b|a] and [a|b|b]
647!> \param oba ...
648!> \param obb ...
649!> \param fba ...
650!> \param fbb ...
651!> \param rab ...
652!> \param nrep ...
653!> \param scon_oba ...
654!> \param scon_obb ...
655!> \param shg_integrals_test_section ...
656!> \param acc_check ...
657!> \param acc_param ...
658!> \param calc_derivatives ...
659!> \param iw ...
660! **************************************************************************************************
661 SUBROUTINE test_shg_overlap_aba_integrals(oba, obb, fba, fbb, rab, nrep, scon_oba, scon_obb, &
662 shg_integrals_test_section, acc_check, &
663 acc_param, calc_derivatives, iw)
664 TYPE(gto_basis_set_type), POINTER :: oba, obb, fba, fbb
665 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: rab
666 INTEGER, INTENT(IN) :: nrep
667 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: scon_oba, scon_obb
668 TYPE(section_vals_type), INTENT(IN), POINTER :: shg_integrals_test_section
669 LOGICAL, INTENT(IN) :: acc_check
670 REAL(kind=dp), INTENT(IN) :: acc_param
671 LOGICAL, INTENT(IN) :: calc_derivatives
672 INTEGER, INTENT(IN) :: iw
673
674 INTEGER :: iab, irep, la_max, lb_max, lbb_max, &
675 maxl_orb, maxl_ri, nab, nba, nbb, nfa, &
676 nfb
677 INTEGER, DIMENSION(:, :), POINTER :: ncg_none0
678 INTEGER, DIMENSION(:, :, :), POINTER :: cg_none0_list, fba_index, fbb_index, &
679 oba_index, obb_index
680 LOGICAL :: test_overlap_aba, test_overlap_abb
681 REAL(kind=dp) :: ddmax_overlap_aba, ddmax_overlap_abb, &
682 ddtemp, dmax_overlap_aba, &
683 dmax_overlap_abb, dtemp, dummy
684 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: saba_os, saba_shg, sabb_os, sabb_shg
685 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :, :) :: dsaba_os, dsaba_shg, dsabb_os, dsabb_shg
686 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: cg_coeff
687 REAL(kind=dp), DIMENSION(:, :, :, :), POINTER :: scona_mix, sconb_mix
688
689 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP_ABA", &
690 l_val=test_overlap_aba)
691 CALL section_vals_val_get(shg_integrals_test_section, "TEST_OVERLAP_ABB", &
692 l_val=test_overlap_abb)
693 IF (test_overlap_aba .OR. test_overlap_abb) THEN
694 !effectively switch off screening; makes no sense for the tests
695 oba%set_radius(:) = 1.0e+09_dp
696 obb%set_radius(:) = 1.0e+09_dp
697 oba%pgf_radius(:, :) = 1.0e+09_dp
698 obb%pgf_radius(:, :) = 1.0e+09_dp
699 nba = oba%nsgf
700 nbb = obb%nsgf
701 maxl_orb = max(maxval(oba%lmax), maxval(obb%lmax))
702 la_max = maxval(oba%lmax)
703 lb_max = maxval(obb%lmax)
704 IF (test_overlap_aba) THEN
705 fba%set_radius(:) = 1.0e+09_dp
706 fba%pgf_radius(:, :) = 1.0e+09_dp
707 nfa = fba%nsgf
708 maxl_ri = maxval(fba%lmax) + 1 ! + 1 to avoid fail for l=0
709 ALLOCATE (saba_shg(nba, nbb, nfa), dsaba_shg(nba, nbb, nfa, 3))
710 ALLOCATE (saba_os(nba, nbb, nfa), dsaba_os(nba, nbb, nfa, 3))
711 CALL contraction_matrix_shg_mix(oba, fba, oba_index, fba_index, scona_mix)
712 END IF
713 IF (test_overlap_abb) THEN
714 fbb%set_radius(:) = 1.0e+09_dp
715 fbb%pgf_radius(:, :) = 1.0e+09_dp
716 nfb = fbb%nsgf
717 maxl_ri = maxval(fbb%lmax) + 1
718 lbb_max = maxval(obb%lmax) + maxval(fbb%lmax)
719 ALLOCATE (sabb_shg(nba, nbb, nfb), dsabb_shg(nba, nbb, nfb, 3))
720 ALLOCATE (sabb_os(nba, nbb, nfb), dsabb_os(nba, nbb, nfb, 3))
721 CALL contraction_matrix_shg_mix(obb, fbb, obb_index, fbb_index, sconb_mix)
722 END IF
723 dummy = 0.0_dp
724 dmax_overlap_aba = 0.0_dp
725 ddmax_overlap_aba = 0.0_dp
726 dmax_overlap_abb = 0.0_dp
727 ddmax_overlap_abb = 0.0_dp
728 CALL real_gaunt_coefficients(cg_coeff, maxl_orb, maxl_ri, maxl_orb + maxl_ri, &
729 cg_none0_list=cg_none0_list, ncg_none0=ncg_none0)
730 nab = SIZE(rab, 2)
731 IF (test_overlap_aba) THEN
732 DO irep = 1, nrep
733 DO iab = 1, nab
734 CALL int_overlap_aba_shg(saba_shg, dsaba_shg, rab(:, iab), oba, obb, fba, &
735 scon_obb, scona_mix, oba_index, fba_index, &
736 cg_coeff, cg_none0_list, ncg_none0, &
737 calc_derivatives)
738 CALL int_overlap_aba_os(saba_os, dsaba_os, rab(:, iab), oba, obb, fba, &
739 calc_derivatives, debug=.false., dmax=dummy)
740 CALL calculate_deviation_abx(saba_shg, saba_os, dsaba_shg, dsaba_os, dtemp, ddtemp)
741 dmax_overlap_aba = max(dmax_overlap_aba, dtemp)
742 ddmax_overlap_aba = max(ddmax_overlap_aba, ddtemp)
743 END DO
744 END DO
745 DEALLOCATE (oba_index, fba_index, scona_mix)
746 DEALLOCATE (saba_shg, saba_os, dsaba_shg, dsaba_os)
747 END IF
748 IF (test_overlap_abb) THEN
749 DO irep = 1, nrep
750 DO iab = 1, nab
751 CALL int_overlap_abb_shg(sabb_shg, dsabb_shg, rab(:, iab), oba, obb, fbb, &
752 scon_oba, sconb_mix, obb_index, fbb_index, &
753 cg_coeff, cg_none0_list, ncg_none0, &
754 calc_derivatives)
755 CALL int_overlap_abb_os(sabb_os, dsabb_os, rab(:, iab), oba, obb, fbb, &
756 calc_derivatives, debug=.false., dmax=dummy)
757 CALL calculate_deviation_abx(sabb_shg, sabb_os, dsabb_shg, dsabb_os, dtemp, ddtemp)
758 dmax_overlap_abb = max(dmax_overlap_abb, dtemp)
759 ddmax_overlap_abb = max(ddmax_overlap_abb, ddtemp)
760 END DO
761 END DO
762 DEALLOCATE (obb_index, fbb_index, sconb_mix)
763 DEALLOCATE (sabb_shg, sabb_os, dsabb_shg, dsabb_os)
764 END IF
765 IF (iw > 0) THEN
766 WRITE (iw, fmt="(/,T2,A)") "TEST INFO [a|b|x] OVERLAP SHG and OS INTEGRALS:"
767 WRITE (iw, fmt="(T2,A)") "Maximal deviation between SHG and OS integrals and their derivatives"
768 IF (test_overlap_aba) THEN
769 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|b|a]", &
770 dmax_overlap_aba, ddmax_overlap_aba
771 END IF
772 IF (test_overlap_abb) THEN
773 WRITE (iw, fmt="(T2,A,T53,ES12.5,4X,ES12.5)") "SHG_INTEGRALS | [a|b|b]", &
774 dmax_overlap_abb, ddmax_overlap_abb
775 END IF
776 END IF
777 IF (acc_check) THEN
778 IF ((dmax_overlap_aba >= acc_param) .OR. (ddmax_overlap_aba >= acc_param)) THEN
779 cpabort("[a|b|a]: Dev. larger than"//cp_to_string(acc_param))
780 END IF
781 IF ((dmax_overlap_abb >= acc_param) .OR. (ddmax_overlap_abb >= acc_param)) THEN
782 cpabort("[a|b|b]: Dev. larger than"//cp_to_string(acc_param))
783 END IF
784 END IF
785 DEALLOCATE (cg_coeff, cg_none0_list, ncg_none0)
786 END IF
787
788 END SUBROUTINE test_shg_overlap_aba_integrals
789
790! **************************************************************************************************
791!> \brief Calculation of the deviation between SHG and OS integrals
792!> \param vab_shg integral matrix obtained from the SHG scheme
793!> \param vab_os integral matrix obtained from the OS scheme
794!> \param dvab_shg derivative of the integrals, SHG
795!> \param dvab_os derivative of the integrals, OS
796!> \param dmax maximal deviation of vab matrices
797!> \param ddmax maximal deviation of dvab matrices
798! **************************************************************************************************
799 SUBROUTINE calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dmax, ddmax)
800
801 REAL(kind=dp), DIMENSION(:, :), INTENT(IN) :: vab_shg, vab_os
802 REAL(kind=dp), DIMENSION(:, :, :), INTENT(IN) :: dvab_shg, dvab_os
803 REAL(kind=dp), INTENT(OUT) :: dmax, ddmax
804
805 INTEGER :: i, j, k
806 REAL(kind=dp) :: diff
807
808 dmax = 0.0_dp
809 ddmax = 0.0_dp
810
811 ! integrals vab
812 DO j = 1, SIZE(vab_shg, 2)
813 DO i = 1, SIZE(vab_shg, 1)
814 diff = abs(vab_shg(i, j) - vab_os(i, j))
815 dmax = max(dmax, diff)
816 END DO
817 END DO
818
819 ! derivatives dvab
820 DO k = 1, 3
821 DO j = 1, SIZE(dvab_shg, 2)
822 DO i = 1, SIZE(dvab_shg, 1)
823 diff = abs(dvab_shg(i, j, k) - dvab_os(i, j, k))
824 ddmax = max(ddmax, diff)
825 END DO
826 END DO
827 END DO
828
829 END SUBROUTINE calculate_deviation_ab
830
831! **************************************************************************************************
832!> \brief Calculation of the deviation between SHG and OS integrals
833!> \param vab_shg integral matrix obtained from the SHG scheme
834!> \param vab_os integral matrix obtained from the OS scheme
835!> \param dvab_shg derivative of the integrals, SHG
836!> \param dvab_os derivative of the integrals, OS
837!> \param dmax maximal deviation of vab matrices
838!> \param ddmax maximal deviation of dvab matrices
839! **************************************************************************************************
840 SUBROUTINE calculate_deviation_abx(vab_shg, vab_os, dvab_shg, dvab_os, dmax, ddmax)
841
842 REAL(kind=dp), DIMENSION(:, :, :), INTENT(IN) :: vab_shg, vab_os
843 REAL(kind=dp), DIMENSION(:, :, :, :), INTENT(IN) :: dvab_shg, dvab_os
844 REAL(kind=dp), INTENT(OUT) :: dmax, ddmax
845
846 INTEGER :: i, j, k, l
847 REAL(kind=dp) :: diff
848
849 dmax = 0.0_dp
850 ddmax = 0.0_dp
851
852 ! integrals vab
853 DO k = 1, SIZE(vab_shg, 3)
854 DO j = 1, SIZE(vab_shg, 2)
855 DO i = 1, SIZE(vab_shg, 1)
856 diff = abs(vab_shg(i, j, k) - vab_os(i, j, k))
857 dmax = max(dmax, diff)
858 END DO
859 END DO
860 END DO
861
862 ! derivatives dvab
863 DO l = 1, 3
864 DO k = 1, SIZE(dvab_shg, 3)
865 DO j = 1, SIZE(dvab_shg, 2)
866 DO i = 1, SIZE(dvab_shg, 1)
867 diff = abs(dvab_shg(i, j, k, l) - dvab_os(i, j, k, l))
868 ddmax = max(ddmax, diff)
869 END DO
870 END DO
871 END DO
872 END DO
873
874 END SUBROUTINE calculate_deviation_abx
875
876END 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 ...
Expansion of the product of two real spherical harmonics in real spherical harmonics.
subroutine, public real_gaunt_coefficients(my_cg, maxl1, maxl2, llmax, cg_none0_list, ncg_none0)
Calculate the expansion of the product of two real spherical harmonics in real spherical harmonics,...
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
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, deprecation_notice)
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