22 #include "./base/base_uses.f90"
28 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'lri_optimize_ri_basis_types'
29 PUBLIC :: lri_opt_type
37 REAL(KIND=
dp),
DIMENSION(:, :, :),
POINTER :: gcc_orig
38 END TYPE lri_gcc_p_type
44 INTEGER,
DIMENSION(:),
POINTER :: ncont_l
45 END TYPE lri_subset_type
50 LOGICAL :: use_condition_number
51 LOGICAL :: use_geometric_seq
52 LOGICAL :: use_constraints
55 REAL(KIND=
dp) :: cond_weight
56 REAL(KIND=
dp) :: scale_exp
57 REAL(KIND=
dp) :: fermi_exp
58 REAL(KIND=
dp) :: rho_diff
60 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: x
62 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: zet_init
64 TYPE(lri_gcc_p_type),
DIMENSION(:),
POINTER :: ri_gcc_orig
65 TYPE(lri_subset_type),
DIMENSION(:),
POINTER :: subset
78 TYPE(lri_opt_type),
POINTER :: lri_opt
82 NULLIFY (lri_opt%ri_gcc_orig)
83 NULLIFY (lri_opt%subset)
85 NULLIFY (lri_opt%zet_init)
87 lri_opt%opt_exps = .false.
88 lri_opt%opt_coeffs = .false.
89 lri_opt%use_condition_number = .false.
90 lri_opt%use_geometric_seq = .false.
91 lri_opt%use_constraints = .false.
104 TYPE(lri_opt_type),
POINTER :: lri_opt
108 IF (
ASSOCIATED(lri_opt))
THEN
109 IF (
ASSOCIATED(lri_opt%subset))
THEN
110 DO i = 1,
SIZE(lri_opt%subset)
111 DEALLOCATE (lri_opt%subset(i)%ncont_l)
113 DEALLOCATE (lri_opt%subset)
115 IF (
ASSOCIATED(lri_opt%x))
THEN
116 DEALLOCATE (lri_opt%x)
118 IF (
ASSOCIATED(lri_opt%zet_init))
THEN
119 DEALLOCATE (lri_opt%zet_init)
121 IF (
ASSOCIATED(lri_opt%ri_gcc_orig))
THEN
122 DO i = 1,
SIZE(lri_opt%ri_gcc_orig)
123 DEALLOCATE (lri_opt%ri_gcc_orig(i)%gcc_orig)
125 DEALLOCATE (lri_opt%ri_gcc_orig)
141 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: gcc_orig
142 TYPE(gto_basis_set_type),
POINTER :: gto_basis_set
143 TYPE(lri_opt_type),
POINTER :: lri_opt
145 INTEGER :: il, ipgf, iset, ishell, l, maxpgf, &
147 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, ncont_l
148 REAL(kind=
dp) :: expzet, gcca, prefac, zeta
150 maxpgf =
SIZE(gto_basis_set%gcc, 1)
151 maxshell =
SIZE(gto_basis_set%gcc, 2)
152 nset =
SIZE(gto_basis_set%gcc, 3)
154 ALLOCATE (gcc_orig(maxpgf, maxshell, nset))
157 DO iset = 1, gto_basis_set%nset
158 DO ishell = 1, gto_basis_set%nshell(iset)
159 l = gto_basis_set%l(ishell, iset)
160 expzet = 0.25_dp*real(2*l + 3,
dp)
161 prefac = 2.0_dp**l*(2.0_dp/
pi)**0.75_dp
162 DO ipgf = 1, gto_basis_set%npgf(iset)
163 gcca = gto_basis_set%gcc(ipgf, ishell, iset)
164 zeta = gto_basis_set%zet(ipgf, iset)
165 gcc_orig(ipgf, ishell, iset) = gcca/(prefac*zeta**expzet)
170 IF (lri_opt%opt_coeffs)
THEN
173 lmax=lmax, lmin=lmin)
174 ALLOCATE (lri_opt%subset(nset))
175 DO iset = 1, gto_basis_set%nset
176 nl = lmax(iset) - lmin(iset) + 1
177 lri_opt%subset(iset)%nl = nl
179 ALLOCATE (lri_opt%subset(iset)%ncont_l(nl))
180 ncont_l => lri_opt%subset(iset)%ncont_l
182 DO ishell = 2, gto_basis_set%nshell(iset)
183 l = gto_basis_set%l(ishell, iset)
184 IF (l == gto_basis_set%l(ishell - 1, iset))
THEN
185 ncont_l(il) = ncont_l(il) + 1
204 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: gcc
205 TYPE(gto_basis_set_type),
POINTER :: gto_basis_set
206 TYPE(lri_opt_type),
POINTER :: lri_opt
208 INTEGER :: il, iset, ishell, ishell1, ishell2, &
210 INTEGER,
DIMENSION(:),
POINTER :: nshell
211 REAL(kind=
dp) :: gs_scale
217 DO il = 1, lri_opt%subset(iset)%nl
218 DO ishell1 = istart, istart + lri_opt%subset(iset)%ncont_l(il) - 2
219 DO ishell2 = ishell1 + 1, istart + lri_opt%subset(iset)%ncont_l(il) - 1
220 gs_scale = dot_product(gcc(:, ishell2, iset), gcc(:, ishell1, iset))/ &
221 dot_product(gcc(:, ishell1, iset), gcc(:, ishell1, iset))
222 gcc(:, ishell2, iset) = gcc(:, ishell2, iset) - &
223 gs_scale*gcc(:, ishell1, iset)
226 istart = istart + lri_opt%subset(iset)%ncont_l(il)
229 DO ishell = 1, gto_basis_set%nshell(iset)
230 gcc(:, ishell, iset) = gcc(:, ishell, iset)/ &
231 sqrt(dot_product(gcc(:, ishell, iset), gcc(:, ishell, iset)))
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)
...
Defines the basic variable types.
integer, parameter, public dp
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...
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi