53 #include "./base/base_uses.f90"
61 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'shg_integrals_test'
72 TYPE(section_type),
INTENT(INOUT),
POINTER :: section
74 TYPE(keyword_type),
POINTER :: keyword
75 TYPE(section_type),
POINTER :: subsection
77 NULLIFY (keyword, subsection)
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)
90 name=
"_SECTION_PARAMETERS_", &
91 description=
"Controls the activation the SHG integral test. ", &
92 default_l_val=.false., &
93 lone_keyword_l_val=.true.)
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)
105 description=
"Minimum number of atomic distances to consider. ", &
111 description=
"Number of repeated calculation of each integral. ", &
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.)
123 CALL keyword_create(keyword, __location__, name=
"ACCURACY_LEVEL", &
124 description=
"Level of accuracy for comparison of SHG and OS "// &
126 default_r_val=1.0e-8_dp)
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.)
137 description=
"Calculates the integrals (a|b).", &
138 default_l_val=.false., lone_keyword_l_val=.true.)
144 description=
"Calculates the integrals (a|1/r12|b).", &
145 default_l_val=.false., lone_keyword_l_val=.true.)
150 description=
"Calculates the integrals (a|erf(omega*r12)/r12|b).", &
151 default_l_val=.false., lone_keyword_l_val=.true.)
156 description=
"Calculates the integrals (a|erfc(omega*r12)/r12|b).", &
157 default_l_val=.false., lone_keyword_l_val=.true.)
162 description=
"Calculates the integrals (a|exp(omega*r12^2)/r12|b).", &
163 default_l_val=.false., lone_keyword_l_val=.true.)
168 description=
"Calculates the integrals (a|exp(omega*r12^2)|b).", &
169 default_l_val=.false., lone_keyword_l_val=.true.)
174 description=
"Calculates the integrals (a|(r-Ra)^(2m)|b).", &
175 default_l_val=.false., lone_keyword_l_val=.true.)
180 description=
"Exponent in integral (a|(r-Ra)^(2m)|b).", &
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.)
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.)
205 INTEGER,
INTENT(IN) :: iw
206 TYPE(section_vals_type),
INTENT(INOUT),
POINTER :: shg_integrals_test_section
208 CHARACTER(len=*),
PARAMETER :: routinen =
'shg_integrals_perf_acc_test'
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
223 CALL timeset(routinen, handle)
224 NULLIFY (oba, obb, fba, fbb, basis_section, cell_par)
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)
237 IF (.NOT. (nrep_bas == 2 .OR. nrep_bas == 3))
THEN
238 CALL cp_abort(__location__, &
239 "Provide basis sets")
242 CALL read_gto_basis_set(trim(
"A"), basis_type, oba, basis_section, irep=1)
243 lamax = maxval(oba%lmax)
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
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)
254 IF (test_overlap_abb)
THEN
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)
260 IF (test_overlap_aba .AND. test_overlap_abb)
THEN
261 lmax = max(max(lamax + lcamax, lbmax), max(lamax, lbmax + lcbmax))
270 IF (test_overlap_aba)
THEN
274 IF (test_overlap_abb)
THEN
284 nab_xyz = ceiling(real(nab_min, kind=
dp)**(1.0_dp/3.0_dp) - 1.0e-06)
287 ALLOCATE (rab(3, nab))
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
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)
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)
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)
315 DEALLOCATE (scona_shg, sconb_shg, rab)
321 CALL timestop(handle)
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
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
366 test_any = (test_coulomb .OR. test_verf .OR. test_verfc .OR. test_vgauss .OR. test_gauss)
371 ALLOCATE (vab_shg(nfa, nfb), dvab_shg(nfa, nfb, 3))
372 ALLOCATE (vab_os(nfa, nfb), dvab_os(nfa, nfb, 3))
374 dmax_coulomb = 0.0_dp
375 ddmax_coulomb = 0.0_dp
381 ddmax_vgauss = 0.0_dp
389 IF (test_coulomb)
THEN
391 oba, obb, scona_shg, sconb_shg, &
392 calculate_forces=calc_derivatives)
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)
402 oba, obb, scona_shg, sconb_shg, omega, &
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)
413 oba, obb, scona_shg, sconb_shg, omega, &
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)
422 IF (test_vgauss)
THEN
424 oba, obb, scona_shg, sconb_shg, omega, &
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)
435 oba, obb, scona_shg, sconb_shg, omega, &
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)
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
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
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
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
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
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))
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))
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))
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))
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))
488 DEALLOCATE (vab_shg, vab_os, dvab_shg, dvab_os)
491 END SUBROUTINE test_shg_operator12_integrals
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
520 INTEGER :: iab, irep, nab, nfa, nfb
521 LOGICAL :: test_overlap
522 REAL(kind=
dp) :: ddmax_overlap, ddtemp, dmax_overlap, &
524 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: sab_os, sab_shg
525 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: dsab_os, dsab_shg
529 IF (test_overlap)
THEN
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
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))
546 scona_shg, sconb_shg, calc_derivatives)
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)
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
562 IF ((dmax_overlap >= acc_param) .OR. (ddmax_overlap >= acc_param))
THEN
563 cpabort(
"[a|b]: Deviation larger than"//cp_to_string(acc_param))
566 DEALLOCATE (sab_shg, sab_os, dsab_shg, dsab_os)
569 END SUBROUTINE test_shg_overlap_integrals
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
598 INTEGER :: iab, irep, m, nab, nfa, nfb
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
615 ALLOCATE (vab_shg(nfa, nfb), dvab_shg(nfa, nfb, 3))
616 ALLOCATE (vab_os(nfa, nfb), dvab_os(nfa, nfb, 3))
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)
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]", &
635 IF ((dmax >= acc_param) .OR. (ddmax >= acc_param))
THEN
636 cpabort(
"[a|ra^(2m)|b]: Deviation larger than"//cp_to_string(acc_param))
639 DEALLOCATE (scon_ra2m)
640 DEALLOCATE (vab_shg, vab_os, dvab_shg, dvab_os)
642 END SUBROUTINE test_shg_ra2m_integrals
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
673 INTEGER :: iab, irep, la_max, lb_max, lbb_max, &
674 maxl_orb, maxl_ri, nab, nba, nbb, nfa, &
676 INTEGER,
DIMENSION(:, :),
POINTER :: ncg_none0
677 INTEGER,
DIMENSION(:, :, :),
POINTER :: cg_none0_list, fba_index, fbb_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
689 l_val=test_overlap_aba)
691 l_val=test_overlap_abb)
692 IF (test_overlap_aba .OR. test_overlap_abb)
THEN
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
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
707 maxl_ri = maxval(fba%lmax) + 1
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))
712 IF (test_overlap_abb)
THEN
713 fbb%set_radius(:) = 1.0e+09_dp
714 fbb%pgf_radius(:, :) = 1.0e+09_dp
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))
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
729 IF (test_overlap_aba)
THEN
733 scon_obb, scona_mix, oba_index, fba_index, &
734 cg_coeff, cg_none0_list, ncg_none0, &
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)
743 DEALLOCATE (oba_index, fba_index, scona_mix)
744 DEALLOCATE (saba_shg, saba_os, dsaba_shg, dsaba_os)
746 IF (test_overlap_abb)
THEN
750 scon_oba, sconb_mix, obb_index, fbb_index, &
751 cg_coeff, cg_none0_list, ncg_none0, &
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)
760 DEALLOCATE (obb_index, fbb_index, sconb_mix)
761 DEALLOCATE (sabb_shg, sabb_os, dsabb_shg, dsabb_os)
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
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
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))
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))
783 DEALLOCATE (cg_coeff, cg_none0_list, ncg_none0)
786 END SUBROUTINE test_shg_overlap_aba_integrals
797 SUBROUTINE calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dmax, ddmax)
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
804 REAL(kind=
dp) :: diff
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)
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)
827 END SUBROUTINE calculate_deviation_ab
838 SUBROUTINE calculate_deviation_abx(vab_shg, vab_os, dvab_shg, dvab_os, dmax, ddmax)
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
844 INTEGER :: i, j, k, l
845 REAL(kind=
dp) :: diff
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)
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)
872 END SUBROUTINE calculate_deviation_abx
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.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Provides Cartesian and spherical orbital pointers and indices.
subroutine, public init_orbital_pointers(maxl)
Initialize or update the orbital pointers.
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.