77#include "./base/base_uses.f90"
85 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'lri_optimize_ri_basis'
102 INTEGER :: iunit, nkind
114 NULLIFY (atomic_kind_set, dft_section, lri_density, lri_env, &
115 lri_opt, lri_optbas_section, rho_struct)
116 NULLIFY (input, logger, para_env)
118 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, input=input, &
119 lri_env=lri_env, lri_density=lri_density, nkind=nkind, &
120 para_env=para_env, rho=rho_struct)
123 CALL qs_rho_get(rho_struct, rho_ao_kp=pmatrix)
128 "DFT%QS%OPTIMIZE_LRI_BASIS")
133 WRITE (iunit,
'(/," POWELL| Start optimization procedure")')
138 CALL init_optimization(lri_env, lri_opt, lri_optbas_section, &
139 opt_state, lri_opt%x, lri_opt%zet_init, nkind, iunit)
141 CALL calculate_lri_overlap_aabb(lri_env, qs_env)
146 IF (opt_state%state == 2)
THEN
147 CALL calc_lri_integrals_get_objective(lri_env, lri_density, qs_env, &
148 lri_opt, opt_state, pmatrix, para_env, &
151 CALL set_qs_env(qs_env, lri_density=lri_density)
154 IF (opt_state%state == -1)
EXIT
157 CALL update_exponents(lri_env, lri_opt, lri_opt%x, lri_opt%zet_init, nkind)
158 CALL print_optimization_update(opt_state, lri_opt, iunit)
165 CALL update_exponents(lri_env, lri_opt, lri_opt%x, lri_opt%zet_init, nkind)
167 CALL write_optimized_lri_basis(lri_env, dft_section, nkind, lri_opt, &
171 WRITE (iunit,
'(" POWELL| Number of function evaluations",T71,I10)') opt_state%nf
172 WRITE (iunit,
'(" POWELL| Final value of function",T61,F20.10)') opt_state%fopt
173 WRITE (iunit,
'(/," Printed optimized lri basis set to file")')
177 "PRINT%PROGRAM_RUN_INFO")
189 SUBROUTINE calculate_lri_overlap_aabb(lri_env, qs_env)
194 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_lri_overlap_aabb'
196 INTEGER :: handle, iac, iatom, ikind, ilist, jatom, &
197 jkind, jneighbor, nba, nbb, nkind, &
200 REAL(kind=
dp),
DIMENSION(3) :: rab
206 DIMENSION(:),
POINTER :: nl_iterator
211 CALL timeset(routinen, handle)
212 NULLIFY (cell, lriir, lri_ints_rho, nl_iterator, obasa, obasb, &
213 particle_set, soo_list)
215 IF (
ASSOCIATED(lri_env%soo_list))
THEN
216 soo_list => lri_env%soo_list
218 CALL get_qs_env(qs_env=qs_env, nkind=nkind, particle_set=particle_set, &
221 IF (
ASSOCIATED(lri_env%lri_ints_rho))
THEN
226 lri_ints_rho => lri_env%lri_ints_rho
232 nlist=nlist, ilist=ilist, nnode=nneighbor, inode=jneighbor, &
233 iatom=iatom, jatom=jatom, r=rab)
235 iac = ikind + nkind*(jkind - 1)
236 dab = sqrt(sum(rab*rab))
238 obasa => lri_env%orb_basis(ikind)%gto_basis_set
239 obasb => lri_env%orb_basis(jkind)%gto_basis_set
240 IF (.NOT.
ASSOCIATED(obasa)) cycle
241 IF (.NOT.
ASSOCIATED(obasb)) cycle
243 lriir => lri_ints_rho%lri_atom(iac)%lri_node(ilist)%lri_int_rho(jneighbor)
258 CALL timestop(handle)
260 END SUBROUTINE calculate_lri_overlap_aabb
274 SUBROUTINE init_optimization(lri_env, lri_opt, lri_optbas_section, opt_state, &
275 x, zet_init, nkind, iunit)
281 REAL(kind=
dp),
DIMENSION(:),
POINTER :: x, zet_init
282 INTEGER,
INTENT(IN) :: nkind, iunit
284 INTEGER :: ikind, iset, ishell, n, nset
285 INTEGER,
DIMENSION(:),
POINTER :: npgf, nshell
286 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: zet
287 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: gcc_orig
290 NULLIFY (fbas, gcc_orig, npgf, nshell, zet)
292 ALLOCATE (lri_opt%ri_gcc_orig(nkind))
295 CALL get_optimization_parameter(lri_opt, lri_optbas_section, &
301 opt_state%unit = iunit
304 IF (lri_opt%opt_exps)
THEN
307 fbas => lri_env%ri_basis(ikind)%gto_basis_set
309 npgf=npgf, nset=nset, zet=zet)
311 IF (lri_opt%use_geometric_seq .AND. npgf(iset) > 2)
THEN
312 opt_state%nvar = opt_state%nvar + 2
314 x(n + 1) = maxval(zet(1:npgf(iset), iset))
315 x(n + 2) = minval(zet(1:npgf(iset), iset))
318 opt_state%nvar = opt_state%nvar + npgf(iset)
320 x(n + 1:n + npgf(iset)) = zet(1:npgf(iset), iset)
323 lri_opt%nexp = lri_opt%nexp + npgf(iset)
328 IF (lri_opt%use_constraints)
THEN
329 ALLOCATE (zet_init(
SIZE(x)))
338 fbas => lri_env%ri_basis(ikind)%gto_basis_set
344 IF (lri_opt%opt_coeffs)
THEN
346 fbas => lri_env%ri_basis(ikind)%gto_basis_set
347 gcc_orig => lri_opt%ri_gcc_orig(ikind)%gcc_orig
349 npgf=npgf, nset=nset, nshell=nshell, zet=zet)
354 DO ishell = 1, nshell(iset)
355 opt_state%nvar = opt_state%nvar + npgf(iset)
357 x(n + 1:n + npgf(iset)) = gcc_orig(1:npgf(iset), ishell, iset)
358 lri_opt%ncoeff = lri_opt%ncoeff + npgf(iset)
366 WRITE (iunit,
'(/," POWELL| Accuracy",T69,ES12.5)') opt_state%rhoend
367 WRITE (iunit,
'(" POWELL| Initial step size",T69,ES12.5)') opt_state%rhobeg
368 WRITE (iunit,
'(" POWELL| Maximum number of evaluations",T71,I10)') &
370 WRITE (iunit,
'(" POWELL| Total number of parameters",T71,I10)') &
374 END SUBROUTINE init_optimization
382 SUBROUTINE get_optimization_parameter(lri_opt, lri_optbas_section, &
389 INTEGER :: degree_freedom
392 NULLIFY (constrain_exp_section)
396 r_val=opt_state%rhoend)
398 r_val=opt_state%rhobeg)
400 i_val=opt_state%maxfun)
404 i_val=degree_freedom)
406 SELECT CASE (degree_freedom)
408 lri_opt%opt_coeffs = .true.
409 lri_opt%opt_exps = .true.
411 lri_opt%opt_coeffs = .true.
413 lri_opt%opt_exps = .true.
415 cpabort(
"No initialization available?????")
420 l_val=lri_opt%use_condition_number)
422 r_val=lri_opt%cond_weight)
424 l_val=lri_opt%use_geometric_seq)
428 "CONSTRAIN_EXPONENTS")
429 CALL section_vals_get(constrain_exp_section, explicit=lri_opt%use_constraints)
431 IF (lri_opt%use_constraints)
THEN
433 r_val=lri_opt%scale_exp)
435 r_val=lri_opt%fermi_exp)
438 END SUBROUTINE get_optimization_parameter
448 SUBROUTINE update_exponents(lri_env, lri_opt, x, zet_init, nkind)
452 REAL(kind=
dp),
DIMENSION(:),
POINTER :: x, zet_init
453 INTEGER,
INTENT(IN) :: nkind
455 INTEGER :: ikind, iset, ishell, n, nset, nvar_exp
456 INTEGER,
DIMENSION(:),
POINTER :: npgf, nshell
457 REAL(kind=
dp) :: zet_max, zet_min
458 REAL(kind=
dp),
DIMENSION(:),
POINTER :: zet, zet_trans
459 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: gcc_orig
462 NULLIFY (fbas, gcc_orig, npgf, nshell, zet_trans, zet)
465 nvar_exp =
SIZE(x) - lri_opt%ncoeff
466 ALLOCATE (zet_trans(nvar_exp))
469 IF (lri_opt%opt_exps)
THEN
470 IF (lri_opt%use_constraints)
THEN
472 CALL transfer_exp(lri_opt, zet, zet_init, zet_trans, nvar_exp)
474 zet_trans(:) = x(1:nvar_exp)**2.0_dp
478 fbas => lri_env%ri_basis(ikind)%gto_basis_set
481 IF (lri_opt%use_geometric_seq .AND. npgf(iset) > 2)
THEN
482 zet_max = maxval(zet_trans(n + 1:n + 2))
483 zet_min = minval(zet_trans(n + 1:n + 2))
484 zet => fbas%zet(1:npgf(iset), iset)
485 CALL geometric_progression(zet, zet_max, zet_min, npgf(iset))
488 fbas%zet(1:npgf(iset), iset) = zet_trans(n + 1:n + npgf(iset))
496 IF (lri_opt%opt_coeffs)
THEN
499 fbas => lri_env%ri_basis(ikind)%gto_basis_set
500 gcc_orig => lri_opt%ri_gcc_orig(ikind)%gcc_orig
502 nshell=nshell, npgf=npgf, nset=nset)
504 DO ishell = 1, nshell(iset)
505 gcc_orig(1:npgf(iset), ishell, iset) = x(n + 1:n + npgf(iset))
514 DEALLOCATE (zet_trans)
515 END SUBROUTINE update_exponents
525 SUBROUTINE transfer_exp(lri_opt, zet, zet_init, zet_trans, nvar)
528 REAL(kind=
dp),
DIMENSION(:),
POINTER :: zet, zet_init, zet_trans
529 INTEGER,
INTENT(IN) :: nvar
532 REAL(kind=
dp),
DIMENSION(:),
POINTER :: zet_max, zet_min
534 ALLOCATE (zet_max(nvar), zet_min(nvar))
536 zet_min(:) = zet_init(:)*(1.0_dp - lri_opt%scale_exp)
537 zet_max(:) = zet_init(:)*(1.0_dp + lri_opt%scale_exp)
539 a = lri_opt%fermi_exp
541 zet_trans = zet_min + (zet_max - zet_min)/(1 + exp(-a*(zet - zet_init)))
543 DEALLOCATE (zet_max, zet_min)
545 END SUBROUTINE transfer_exp
554 SUBROUTINE geometric_progression(zet, zet_max, zet_min, nexp)
556 REAL(kind=
dp),
DIMENSION(:),
POINTER :: zet
557 REAL(kind=
dp),
INTENT(IN) :: zet_max, zet_min
558 INTEGER,
INTENT(IN) :: nexp
565 q = (zet_min/zet_max)**(1._dp/real(n,
dp))
568 zet(i) = zet_max*q**(i - 1)
571 END SUBROUTINE geometric_progression
585 SUBROUTINE calc_lri_integrals_get_objective(lri_env, lri_density, qs_env, &
586 lri_opt, opt_state, pmatrix, para_env, &
596 INTEGER,
INTENT(IN) :: nkind
598 INTEGER :: ikind, nset
599 INTEGER,
DIMENSION(:),
POINTER :: npgf
600 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
606 lri_env%store_integrals = .true.
608 fbas => lri_env%ri_basis(ikind)%gto_basis_set
611 fbas%gcc = lri_opt%ri_gcc_orig(ikind)%gcc_orig
617 IF (lri_opt%use_condition_number)
THEN
620 CALL calculate_objective(lri_env, lri_density, lri_opt, pmatrix, para_env, &
623 END SUBROUTINE calc_lri_integrals_get_objective
636 SUBROUTINE calculate_objective(lri_env, lri_density, lri_opt, pmatrix, para_env, &
644 REAL(kind=
dp),
INTENT(OUT) :: fobj
646 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_objective'
648 INTEGER :: handle, iac, iatom, ikind, ilist, isgfa, ispin, jatom, jkind, jneighbor, jsgfa, &
649 ksgfb, lsgfb, mepos, nba, nbb, nfa, nfb, nkind, nlist, nn, nneighbor, nspin, nthread
650 LOGICAL :: found, trans
651 REAL(kind=
dp) :: obj_ab, rhoexact_sq, rhofit_sq, rhomix
652 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: pbij
659 DIMENSION(:),
POINTER :: nl_iterator
663 CALL timeset(routinen, handle)
664 NULLIFY (lrii, lriir, lri_rho, lrho, nl_iterator, pmat, soo_list)
666 IF (
ASSOCIATED(lri_env%soo_list))
THEN
667 soo_list => lri_env%soo_list
669 nkind = lri_env%lri_ints%nkind
670 nspin =
SIZE(pmatrix, 1)
671 cpassert(
SIZE(pmatrix, 2) == 1)
676 lri_opt%rho_diff = 0._dp
680 pmat => pmatrix(ispin, 1)%matrix
681 lri_rho => lri_density%lri_rhos(ispin)%lri_list
694 CALL get_iterator_info(nl_iterator, mepos=mepos, ikind=ikind, jkind=jkind, iatom=iatom, &
695 jatom=jatom, nlist=nlist, ilist=ilist, nnode=nneighbor, inode=jneighbor)
697 iac = ikind + nkind*(jkind - 1)
699 IF (.NOT.
ASSOCIATED(lri_env%lri_ints%lri_atom(iac)%lri_node)) cycle
701 lrii => lri_env%lri_ints%lri_atom(iac)%lri_node(ilist)%lri_int(jneighbor)
702 lriir => lri_env%lri_ints_rho%lri_atom(iac)%lri_node(ilist)%lri_int_rho(jneighbor)
703 lrho => lri_rho%lri_atom(iac)%lri_node(ilist)%lri_rhoab(jneighbor)
716 IF (iatom <= jatom)
THEN
717 CALL dbcsr_get_block_p(matrix=pmat, row=iatom, col=jatom, block=pbij, found=found)
720 CALL dbcsr_get_block_p(matrix=pmat, row=jatom, col=iatom, block=pbij, found=found)
731 rhoexact_sq = rhoexact_sq + pbij(ksgfb, isgfa)*pbij(lsgfb, jsgfa) &
732 *lriir%soaabb(isgfa, jsgfa, ksgfb, lsgfb)
742 rhoexact_sq = rhoexact_sq + pbij(isgfa, ksgfb)*pbij(jsgfa, lsgfb) &
743 *lriir%soaabb(isgfa, jsgfa, ksgfb, lsgfb)
753 rhofit_sq = rhofit_sq + lrho%avec(isgfa)*lrho%avec(jsgfa) &
754 *lri_env%bas_prop(ikind)%ri_ovlp(isgfa, jsgfa)
757 IF (iatom /= jatom)
THEN
760 rhofit_sq = rhofit_sq + lrho%avec(nfa + ksgfb)*lrho%avec(nfa + lsgfb) &
761 *lri_env%bas_prop(jkind)%ri_ovlp(ksgfb, lsgfb)
766 rhofit_sq = rhofit_sq + 2._dp*lrho%avec(isgfa)*lrho%avec(nfa + ksgfb) &
767 *lrii%sab(isgfa, ksgfb)
773 IF (iatom == jatom)
THEN
774 rhomix = sum(lrho%avec(1:nfa)*lrho%tvec(1:nfa))
776 rhomix = sum(lrho%avec(1:nn)*lrho%tvec(1:nn))
781 IF (iatom == jatom)
THEN
782 obj_ab = rhoexact_sq - 2._dp*rhomix + rhofit_sq
784 obj_ab = 2.0_dp*(rhoexact_sq - 2._dp*rhomix + rhofit_sq)
788 IF (lri_opt%use_condition_number)
THEN
789 fobj = fobj + obj_ab + lri_opt%cond_weight*log(lrii%cond_num)
790 lri_opt%rho_diff = lri_opt%rho_diff + obj_ab
802 CALL para_env%sum(fobj)
806 CALL timestop(handle)
808 END SUBROUTINE calculate_objective
818 CHARACTER(LEN=*),
PARAMETER :: routinen =
'get_condition_number_of_overlap'
820 INTEGER :: handle, iac, iatom, ikind, ilist, info, &
821 jatom, jkind, jneighbor, lwork, mepos, &
822 nfa, nfb, nkind, nlist, nn, nneighbor, &
824 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: diag, off_diag, tau
825 REAL(kind=
dp),
DIMENSION(:),
POINTER :: work
826 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: smat
829 DIMENSION(:),
POINTER :: nl_iterator
833 CALL timeset(routinen, handle)
834 NULLIFY (lrii, nl_iterator, smat, soo_list)
836 soo_list => lri_env%soo_list
838 nkind = lri_env%lri_ints%nkind
852 CALL get_iterator_info(nl_iterator, mepos=mepos, ikind=ikind, jkind=jkind, iatom=iatom, &
853 jatom=jatom, nlist=nlist, ilist=ilist, nnode=nneighbor, inode=jneighbor)
855 iac = ikind + nkind*(jkind - 1)
856 IF (.NOT.
ASSOCIATED(lri_env%lri_ints%lri_atom(iac)%lri_node)) cycle
857 lrii => lri_env%lri_ints%lri_atom(iac)%lri_node(ilist)%lri_int(jneighbor)
864 IF (iatom == jatom)
THEN
865 ALLOCATE (smat(nfa, nfa))
867 ALLOCATE (smat(nn, nn))
869 smat(1:nfa, 1:nfa) = lri_env%bas_prop(ikind)%ri_ovlp(1:nfa, 1:nfa)
870 IF (iatom /= jatom)
THEN
872 smat(1:nfa, nfa + 1:nn) = lrii%sab(1:nfa, 1:nfb)
873 smat(nfa + 1:nn, 1:nfa) = transpose(lrii%sab(1:nfa, 1:nfb))
874 smat(nfa + 1:nn, nfa + 1:nn) = lri_env%bas_prop(jkind)%ri_ovlp(1:nfb, 1:nfb)
877 IF (iatom == jatom) nn = nfa
878 ALLOCATE (diag(nn), off_diag(nn - 1), tau(nn - 1), work(1))
885 CALL dsytrd(
'U', nn, smat, nn, diag, off_diag, tau, work, lwork, info)
889 CALL dsytrd(
'U', nn, smat, nn, diag, off_diag, tau, work, lwork, info)
890 CALL dsterf(nn, diag, off_diag, info)
892 lrii%cond_num = maxval(abs(diag))/minval(abs(diag))
894 DEALLOCATE (diag, off_diag, smat, tau, work)
900 CALL timestop(handle)
910 SUBROUTINE print_optimization_update(opt_state, lri_opt, iunit)
914 INTEGER,
INTENT(IN) :: iunit
918 n10 = max(opt_state%maxfun/100, 1)
920 IF (opt_state%nf == 2 .AND. opt_state%state == 2 .AND. iunit > 0)
THEN
921 WRITE (iunit,
'(/," POWELL| Initial value of function",T61,F20.10)') opt_state%f
923 IF (mod(opt_state%nf, n10) == 0 .AND. opt_state%nf > 1 .AND. iunit > 0)
THEN
924 WRITE (iunit,
'(" POWELL| Reached",i4,"% of maximal function calls",T61,F20.10)') &
925 int(real(opt_state%nf,
dp)/real(opt_state%maxfun,
dp)*100._dp), opt_state%fopt
927 IF (lri_opt%use_condition_number)
THEN
928 IF (mod(opt_state%nf, n10) == 0 .AND. opt_state%nf > 1 .AND. iunit > 0)
THEN
929 WRITE (iunit,
'(" POWELL| Recent value of function without condition nr.",T61,F20.10)') &
934 END SUBROUTINE print_optimization_update
944 SUBROUTINE write_optimized_lri_basis(lri_env, dft_section, nkind, lri_opt, &
949 INTEGER,
INTENT(IN) :: nkind
953 CHARACTER(LEN=default_path_length) :: filename
954 INTEGER :: cc_l, ikind, ipgf, iset, ishell, nset, &
956 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, nshell
957 INTEGER,
DIMENSION(:, :),
POINTER :: l
958 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: zet
959 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: gcc_orig
964 NULLIFY (fbas, gcc_orig, l, lmax, lmin, logger, npgf, nshell, print_key, zet)
968 "PRINT%OPTIMIZE_LRI_BASIS")
971 dft_section,
"PRINT%OPTIMIZE_LRI_BASIS"), &
974 "PRINT%OPTIMIZE_LRI_BASIS", &
976 file_status=
"REPLACE", &
977 file_action=
"WRITE", &
978 file_form=
"FORMATTED")
980 IF (output_file > 0)
THEN
983 print_key, extension=
".opt", &
987 fbas => lri_env%ri_basis(ikind)%gto_basis_set
988 gcc_orig => lri_opt%ri_gcc_orig(ikind)%gcc_orig
990 l=l, lmax=lmax, lmin=lmin, &
991 npgf=npgf, nshell=nshell, &
993 WRITE (output_file,
'(T1,A2,T5,A)') trim(atomic_kind_set(ikind)%name), &
995 WRITE (output_file,
'(T1,I4)') nset
997 WRITE (output_file,
'(4(1X,I0))', advance=
'no') 2, lmin(iset), &
998 lmax(iset), npgf(iset)
1000 DO ishell = 1, nshell(iset)
1001 IF (ishell /= nshell(iset))
THEN
1002 IF (l(ishell, iset) == l(ishell + 1, iset))
THEN
1005 WRITE (output_file,
'(1X,I0)', advance=
'no') cc_l
1009 WRITE (output_file,
'(1X,I0)') cc_l
1012 DO ipgf = 1, npgf(iset)
1013 WRITE (output_file,
'(F18.12)', advance=
'no') zet(ipgf, iset)
1014 DO ishell = 1, nshell(iset)
1015 IF (ishell == nshell(iset))
THEN
1016 WRITE (output_file,
'(T5,F18.12)') gcc_orig(ipgf, ishell, iset)
1018 WRITE (output_file,
'(T5,F18.12)', advance=
'no') gcc_orig(ipgf, ishell, iset)
1028 "PRINT%OPTIMIZE_LRI_BASIS")
1031 END SUBROUTINE write_optimized_lri_basis
Define the atomic kind types and their sub types.
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum)
...
subroutine, public init_orb_basis_set(gto_basis_set)
Initialise a Gaussian-type orbital (GTO) basis set data set.
Handles all functions related to the CELL.
subroutine, public dbcsr_get_block_p(matrix, row, col, block, found, row_size, col_size)
...
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
character(len=default_path_length) function, public cp_print_key_generate_filename(logger, print_key, middle_name, extension, my_local)
Utility function that returns a unit number to write the print key. Might open a file with a unique f...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
Calculation of contracted, spherical Gaussian integrals using the (OS) integral scheme....
subroutine, public int_overlap_aabb_os(saabb, oba, obb, rab, debug, dmax)
calculate overlap integrals (aa,bb)
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_path_length
initializes the environment for lri lri : local resolution of the identity
subroutine, public lri_basis_init(lri_env)
initializes the lri basis: calculates the norm, self-overlap and integral of the ri basis
Calculates integral matrices for LRIGPW method lri : local resolution of the identity.
subroutine, public calculate_lri_integrals(lri_env, qs_env)
calculates integrals needed for the LRI density fitting, integrals are calculated once,...
subroutine, public calculate_avec_lri(lri_env, lri_density, pmatrix, cell_to_index, response_density)
performs the fitting of the density; solves the linear system of equations; yield the expansion coeff...
contains the types and subroutines for dealing with the lri_env lri : local resolution of the identit...
subroutine, public allocate_lri_ints_rho(lri_env, lri_ints_rho, nkind)
allocate lri_ints_rho, storing integral for the exact density
subroutine, public deallocate_lri_ints_rho(lri_ints_rho)
deallocates the given lri_ints_rho
sets the environment for optimization of exponents and contraction coefficients of the lri auxiliary ...
subroutine, public orthonormalize_gcc(gcc, gto_basis_set, lri_opt)
orthonormalize contraction coefficients using Gram-Schmidt
subroutine, public create_lri_opt(lri_opt)
creates lri_opt
subroutine, public deallocate_lri_opt(lri_opt)
deallocates lri_opt
subroutine, public get_original_gcc(gcc_orig, gto_basis_set, lri_opt)
primitive Cartesian Gaussian functions are normalized. The normalization factor is included in the Ga...
Optimizes exponents and contraction coefficients of the lri auxiliary basis sets using the UOBYQA min...
subroutine, public get_condition_number_of_overlap(lri_env)
get condition number of overlap matrix
subroutine, public optimize_lri_basis(qs_env)
optimizes the lri basis set
Utility routines for the memory handling.
Interface to the message passing library MPI.
Define the data structure for the particle information.
subroutine, public powell_optimize(n, x, optstate)
...
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Get the QUICKSTEP environment.
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, ewald_env, ewald_pw, mpools, rho_external, external_vxc, mask, scf_control, rel_control, qs_charges, ks_env, ks_qmmm_env, wf_history, scf_env, active_space, input, oce, rho_atom_set, rho0_atom_set, rho0_mpole, run_rtp, rtp, rhoz_set, rhoz_tot, ecoul_1c, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, efield, linres_control, xas_env, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, ls_scf_env, do_transport, transport_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, harris_env, gcp_env, mp2_env, bs_env, kg_env, force, kpoints, wanniercentres, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Set the QUICKSTEP environment.
Define the neighbor list data types and the corresponding functionality.
subroutine, public neighbor_list_iterator_create(iterator_set, nl, search, nthread)
Neighbor list iterator functions.
subroutine, public neighbor_list_iterator_release(iterator_set)
...
integer function, public neighbor_list_iterate(iterator_set, mepos)
...
subroutine, public get_iterator_info(iterator_set, mepos, ikind, jkind, nkind, ilist, nlist, inode, nnode, iatom, jatom, r, cell)
...
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
keeps the density in various representations, keeping track of which ones are valid.