53#include "./base/base_uses.f90"
61 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'shg_integrals_test'
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
208 CHARACTER(len=*),
PARAMETER :: routinen =
'shg_integrals_perf_acc_test'
209 REAL(kind=
dp),
PARAMETER :: d_nab = 1.0e-06_dp
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
224 CALL timeset(routinen, handle)
225 NULLIFY (oba, obb, fba, fbb, basis_section, cell_par)
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)
238 IF (.NOT. (nrep_bas == 2 .OR. nrep_bas == 3))
THEN
239 CALL cp_abort(__location__, &
240 "Provide basis sets")
244 lamax = maxval(oba%lmax)
247 lbmax = maxval(obb%lmax)
248 lmax = max(lamax, lbmax)
249 IF (test_overlap_aba)
THEN
252 lcamax = maxval(fba%lmax)
253 lmax = max(lamax + lcamax, lbmax)
255 IF (test_overlap_abb)
THEN
258 lcbmax = maxval(fbb%lmax)
259 lmax = max(lamax, lbmax + lcbmax)
261 IF (test_overlap_aba .AND. test_overlap_abb)
THEN
262 lmax = max(max(lamax + lcamax, lbmax), max(lamax, lbmax + lcbmax))
271 IF (test_overlap_aba)
THEN
275 IF (test_overlap_abb)
THEN
285 nab_xyz = ceiling(real(nab_min, kind=
dp)**(1.0_dp/3.0_dp) - d_nab)
288 ALLOCATE (rab(3, nab))
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
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)
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)
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)
316 DEALLOCATE (scona_shg, sconb_shg, rab)
322 CALL timestop(handle)
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)
344 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: rab
345 INTEGER,
INTENT(IN) :: nrep
346 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: scona_shg, sconb_shg
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
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
367 test_any = (test_coulomb .OR. test_verf .OR. test_verfc .OR. test_vgauss .OR. test_gauss)
372 ALLOCATE (vab_shg(nfa, nfb), dvab_shg(nfa, nfb, 3))
373 ALLOCATE (vab_os(nfa, nfb), dvab_os(nfa, nfb, 3))
375 dmax_coulomb = 0.0_dp
376 ddmax_coulomb = 0.0_dp
382 ddmax_vgauss = 0.0_dp
390 IF (test_coulomb)
THEN
392 oba, obb, scona_shg, sconb_shg, &
393 calculate_forces=calc_derivatives)
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)
403 oba, obb, scona_shg, sconb_shg, omega, &
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)
414 oba, obb, scona_shg, sconb_shg, omega, &
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)
423 IF (test_vgauss)
THEN
425 oba, obb, scona_shg, sconb_shg, omega, &
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)
436 oba, obb, scona_shg, sconb_shg, omega, &
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)
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
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
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
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
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
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))
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))
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))
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))
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))
489 DEALLOCATE (vab_shg, vab_os, dvab_shg, dvab_os)
492 END SUBROUTINE test_shg_operator12_integrals
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)
512 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: rab
513 INTEGER,
INTENT(IN) :: nrep
514 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(IN) :: scona_shg, sconb_shg
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
521 INTEGER :: iab, irep, nab, nfa, nfb
522 LOGICAL :: test_overlap
523 REAL(kind=
dp) :: ddmax_overlap, ddtemp, dmax_overlap, &
525 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: sab_os, sab_shg
526 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: dsab_os, dsab_shg
530 IF (test_overlap)
THEN
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
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))
547 scona_shg, sconb_shg, calc_derivatives)
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)
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
563 IF ((dmax_overlap >= acc_param) .OR. (ddmax_overlap >= acc_param))
THEN
564 cpabort(
"[a|b]: Deviation larger than"//
cp_to_string(acc_param))
567 DEALLOCATE (sab_shg, sab_os, dsab_shg, dsab_os)
570 END SUBROUTINE test_shg_overlap_integrals
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)
590 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: rab
591 INTEGER,
INTENT(IN) :: nrep
592 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(IN) :: scona_shg, sconb_shg
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
599 INTEGER :: iab, irep, m, nab, nfa, nfb
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
616 ALLOCATE (vab_shg(nfa, nfb), dvab_shg(nfa, nfb, 3))
617 ALLOCATE (vab_os(nfa, nfb), dvab_os(nfa, nfb, 3))
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)
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]", &
636 IF ((dmax >= acc_param) .OR. (ddmax >= acc_param))
THEN
637 cpabort(
"[a|ra^(2m)|b]: Deviation larger than"//
cp_to_string(acc_param))
640 DEALLOCATE (scon_ra2m)
641 DEALLOCATE (vab_shg, vab_os, dvab_shg, dvab_os)
643 END SUBROUTINE test_shg_ra2m_integrals
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)
665 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: rab
666 INTEGER,
INTENT(IN) :: nrep
667 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: scon_oba, scon_obb
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
674 INTEGER :: iab, irep, la_max, lb_max, lbb_max, &
675 maxl_orb, maxl_ri, nab, nba, nbb, nfa, &
677 INTEGER,
DIMENSION(:, :),
POINTER :: ncg_none0
678 INTEGER,
DIMENSION(:, :, :),
POINTER :: cg_none0_list, fba_index, fbb_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
690 l_val=test_overlap_aba)
692 l_val=test_overlap_abb)
693 IF (test_overlap_aba .OR. test_overlap_abb)
THEN
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
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
708 maxl_ri = maxval(fba%lmax) + 1
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))
713 IF (test_overlap_abb)
THEN
714 fbb%set_radius(:) = 1.0e+09_dp
715 fbb%pgf_radius(:, :) = 1.0e+09_dp
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))
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
729 cg_none0_list=cg_none0_list, ncg_none0=ncg_none0)
731 IF (test_overlap_aba)
THEN
735 scon_obb, scona_mix, oba_index, fba_index, &
736 cg_coeff, cg_none0_list, ncg_none0, &
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)
745 DEALLOCATE (oba_index, fba_index, scona_mix)
746 DEALLOCATE (saba_shg, saba_os, dsaba_shg, dsaba_os)
748 IF (test_overlap_abb)
THEN
752 scon_oba, sconb_mix, obb_index, fbb_index, &
753 cg_coeff, cg_none0_list, ncg_none0, &
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)
762 DEALLOCATE (obb_index, fbb_index, sconb_mix)
763 DEALLOCATE (sabb_shg, sabb_os, dsabb_shg, dsabb_os)
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
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
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))
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))
785 DEALLOCATE (cg_coeff, cg_none0_list, ncg_none0)
788 END SUBROUTINE test_shg_overlap_aba_integrals
799 SUBROUTINE calculate_deviation_ab(vab_shg, vab_os, dvab_shg, dvab_os, dmax, ddmax)
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
806 REAL(kind=
dp) :: diff
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)
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)
829 END SUBROUTINE calculate_deviation_ab
840 SUBROUTINE calculate_deviation_abx(vab_shg, vab_os, dvab_shg, dvab_os, dmax, ddmax)
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
846 INTEGER :: i, j, k, l
847 REAL(kind=
dp) :: diff
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)
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)
874 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 ...
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.
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.