(git:123285f)
Loading...
Searching...
No Matches
qs_kpp1_env_methods.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 module that builds the second order perturbation kernel
10!> kpp1 = delta_rho|_P delta_rho|_P E drho(P1) drho
11!> \par History
12!> 07.2002 created [fawzi]
13!> \author Fawzi Mohamed
14! **************************************************************************************************
16 USE admm_types, ONLY: admm_type,&
20 USE cp_dbcsr_api, ONLY: dbcsr_add,&
29 USE kahan_sum, ONLY: accurate_sum
30 USE kinds, ONLY: dp
36 USE pw_env_types, ONLY: pw_env_get,&
38 USE pw_methods, ONLY: pw_axpy,&
39 pw_copy,&
41 pw_scale,&
47 USE pw_types, ONLY: pw_c1d_gs_type,&
52 USE qs_fxc, ONLY: qs_fxc_apply,&
55 USE qs_integrate_potential, ONLY: integrate_v_rspace,&
56 integrate_v_rspace_diagonal,&
57 integrate_v_rspace_one_center
59 USE qs_ks_atom, ONLY: update_ks_atom
63 USE qs_rho_types, ONLY: qs_rho_get,&
65#include "./base/base_uses.f90"
66
67 IMPLICIT NONE
68
69 PRIVATE
70
71 LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
72 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_kpp1_env_methods'
73
75
76CONTAINS
77
78! **************************************************************************************************
79!> \brief allocates and initializes a kpp1_env
80!> \param kpp1_env the environment to initialize
81!> \par History
82!> 07.2002 created [fawzi]
83!> \author Fawzi Mohamed
84! **************************************************************************************************
85 SUBROUTINE kpp1_create(kpp1_env)
86 TYPE(qs_kpp1_env_type) :: kpp1_env
87
88 NULLIFY (kpp1_env%v_ao)
89
90 END SUBROUTINE kpp1_create
91
92! **************************************************************************************************
93!> \brief ...
94!> \param rho1_xc ...
95!> \param rho1 ...
96!> \param xc_section ...
97!> \param lrigpw ...
98!> \param qs_env ...
99!> \param p_env ...
100!> \param calc_forces ...
101!> \param calc_virial ...
102!> \param virial ...
103! **************************************************************************************************
104 SUBROUTINE calc_kpp1(rho1_xc, rho1, xc_section, lrigpw, qs_env, p_env, &
105 calc_forces, calc_virial, virial)
106
107 TYPE(qs_rho_type), POINTER :: rho1_xc, rho1
108 TYPE(section_vals_type), POINTER :: xc_section
109 LOGICAL, INTENT(IN) :: lrigpw
110 TYPE(qs_environment_type), POINTER :: qs_env
111 TYPE(qs_p_env_type) :: p_env
112 LOGICAL, INTENT(IN), OPTIONAL :: calc_forces, calc_virial
113 REAL(kind=dp), DIMENSION(3, 3), INTENT(INOUT), &
114 OPTIONAL :: virial
115
116 CHARACTER(len=*), PARAMETER :: routinen = 'calc_kpp1'
117
118 INTEGER :: handle, ikind, ispin, nkind, ns, nspins
119 LOGICAL :: do_onecenter, gapw, gapw_xc, &
120 my_calc_forces
121 REAL(kind=dp) :: alpha, energy_hartree, energy_hartree_1c
122 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
123 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: k1mat, rho_ao
124 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: ksmat, psmat
125 TYPE(dft_control_type), POINTER :: dft_control
126 TYPE(lri_density_type), POINTER :: lri_density
127 TYPE(lri_environment_type), POINTER :: lri_env
128 TYPE(lri_kind_type), DIMENSION(:), POINTER :: lri_v_int
129 TYPE(mp_para_env_type), POINTER :: para_env
130 TYPE(pw_c1d_gs_type) :: rho1_tot_gspace
131 TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g
132 TYPE(pw_env_type), POINTER :: pw_env
133 TYPE(pw_poisson_type), POINTER :: poisson_env
134 TYPE(pw_pool_type), POINTER :: auxbas_pw_pool
135 TYPE(pw_r3d_rs_type) :: v_hartree_rspace
136 TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho0_r, rho1_r, v_rspace_new, v_xc, &
137 v_xc_tau
138 TYPE(qs_kpp1_env_type), POINTER :: kpp1_env
139 TYPE(qs_rho_type), POINTER :: rho, rho0_fxc, rho1_fxc
140 TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho1_atom_set, rho_atom_set
141
142 CALL timeset(routinen, handle)
143
144 cpassert(ASSOCIATED(p_env%kpp1))
145 cpassert(ASSOCIATED(p_env%kpp1_env))
146 cpassert(ASSOCIATED(rho1))
147
148 my_calc_forces = .false.
149 IF (PRESENT(calc_forces)) my_calc_forces = calc_forces
150
151 CALL get_qs_env(qs_env, &
152 pw_env=pw_env, &
153 dft_control=dft_control, &
154 para_env=para_env, &
155 rho=rho)
156
157 IF (lrigpw) THEN
158 CALL get_qs_env(qs_env, &
159 lri_env=lri_env, &
160 lri_density=lri_density, &
161 atomic_kind_set=atomic_kind_set)
162 END IF
163
164 gapw = dft_control%qs_control%gapw
165 gapw_xc = dft_control%qs_control%gapw_xc
166 IF (gapw_xc) THEN
167 cpassert(ASSOCIATED(rho1_xc))
168 END IF
169 do_onecenter = gapw .OR. gapw_xc
170 nspins = dft_control%nspins
171
172 kpp1_env => p_env%kpp1_env
173 CALL kpp1_check_i_alloc(kpp1_env, qs_env, xc_section)
174
175 CALL qs_rho_get(rho, rho_ao=rho_ao)
176 CALL qs_rho_get(rho1, rho_g=rho1_g)
177
178 ! gets the tmp grids
179 cpassert(ASSOCIATED(pw_env))
180 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, &
181 poisson_env=poisson_env)
182 CALL auxbas_pw_pool%create_pw(v_hartree_rspace)
183
184 IF (gapw .OR. gapw_xc) THEN
185 CALL prepare_gapw_den(qs_env, p_env%local_rho_set, do_rho0=(.NOT. gapw_xc))
186 END IF
187
188 ! *** calculate the hartree potential on the total density ***
189 CALL auxbas_pw_pool%create_pw(rho1_tot_gspace)
190 CALL pw_zero(rho1_tot_gspace)
191 DO ispin = 1, nspins
192 CALL pw_axpy(rho1_g(ispin), rho1_tot_gspace)
193 END DO
194 IF (gapw) THEN
195 CALL pw_axpy(p_env%local_rho_set%rho0_mpole%rho0_s_gs, rho1_tot_gspace)
196 IF (ASSOCIATED(p_env%local_rho_set%rho0_mpole%rhoz_cneo_s_gs)) THEN
197 CALL pw_axpy(p_env%local_rho_set%rho0_mpole%rhoz_cneo_s_gs, rho1_tot_gspace)
198 END IF
199 END IF
200 !
201 block
202 TYPE(pw_c1d_gs_type) :: v_hartree_gspace
203 CALL auxbas_pw_pool%create_pw(v_hartree_gspace)
204 CALL pw_poisson_solve(poisson_env, rho1_tot_gspace, &
205 energy_hartree, &
206 v_hartree_gspace)
207 CALL pw_transfer(v_hartree_gspace, v_hartree_rspace)
208 CALL auxbas_pw_pool%give_back_pw(v_hartree_gspace)
209 END block
210 !
211 CALL pw_scale(v_hartree_rspace, v_hartree_rspace%pw_grid%dvol)
212
213 CALL auxbas_pw_pool%give_back_pw(rho1_tot_gspace)
214
215 ! *** calculate the xc potential ***
216 NULLIFY (v_xc, v_xc_tau)
217 IF (gapw_xc) THEN
218 CALL get_qs_env(qs_env, rho_xc=rho0_fxc)
219 rho1_fxc => rho1_xc
220 ELSE
221 CALL get_qs_env(qs_env, rho=rho0_fxc)
222 rho1_fxc => rho1
223 END IF
224
225 NULLIFY (rho_atom_set, rho1_atom_set)
226 IF (do_onecenter) THEN
227 CALL get_qs_env(qs_env, rho_atom_set=rho_atom_set)
228 rho1_atom_set => p_env%local_rho_set%rho_atom_set
229 END IF
230 CALL qs_fxc_apply(qs_env, kpp1_env%deriv_set, kpp1_env%rho_set, &
231 rho1_fxc, rho_atom_set, xc_section, &
232 do_onecenter, v_xc, v_xc_tau, rho1_atom_set, &
233 compute_virial=calc_virial, virial_xc=virial)
234 ! nl-vdW
235 CALL qs_rho_get(rho0_fxc, rho_r=rho0_r)
236 CALL qs_rho_get(rho1_fxc, rho_r=rho1_r)
237 CALL qs_fxc_nlvdw_apply(qs_env, xc_section, qs_env%dispersion_env, &
238 rho0_r, rho1_r, v_xc)
239
240 DO ispin = 1, nspins
241 CALL pw_scale(v_xc(ispin), v_xc(ispin)%pw_grid%dvol)
242 END DO
243 v_rspace_new => v_xc
244 IF (SIZE(v_xc) /= nspins) THEN
245 CALL auxbas_pw_pool%give_back_pw(v_xc(2))
246 END IF
247 NULLIFY (v_xc)
248 IF (ASSOCIATED(v_xc_tau)) THEN
249 DO ispin = 1, nspins
250 CALL pw_scale(v_xc_tau(ispin), v_xc_tau(ispin)%pw_grid%dvol)
251 END DO
252 IF (SIZE(v_xc_tau) /= nspins) THEN
253 CALL auxbas_pw_pool%give_back_pw(v_xc_tau(2))
254 END IF
255 END IF
256
257 alpha = 1.0_dp
258 IF (nspins == 1) alpha = 2.0_dp
259
260 !-------------------------------!
261 ! Add both hartree and xc terms !
262 !-------------------------------!
263 DO ispin = 1, nspins
264 CALL dbcsr_set(kpp1_env%v_ao(ispin)%matrix, 0.0_dp)
265
266 IF (gapw_xc) THEN
267 ! XC and Hartree are integrated separatedly
268 ! XC uses the soft basis set only
269 CALL integrate_v_rspace(v_rspace=v_rspace_new(ispin), &
270 pmat=rho_ao(ispin), &
271 hmat=kpp1_env%v_ao(ispin), &
272 qs_env=qs_env, &
273 calculate_forces=my_calc_forces, gapw=gapw_xc)
274 IF (ASSOCIATED(v_xc_tau)) THEN
275 CALL integrate_v_rspace(v_rspace=v_xc_tau(ispin), &
276 pmat=rho_ao(ispin), &
277 hmat=kpp1_env%v_ao(ispin), &
278 qs_env=qs_env, &
279 compute_tau=.true., &
280 calculate_forces=my_calc_forces, gapw=gapw_xc)
281 END IF
282 ! add Hartree for SINGLETS
283 CALL pw_copy(v_hartree_rspace, v_rspace_new(1))
284 CALL integrate_v_rspace(v_rspace=v_rspace_new(ispin), &
285 pmat=rho_ao(ispin), &
286 hmat=kpp1_env%v_ao(ispin), &
287 qs_env=qs_env, &
288 calculate_forces=my_calc_forces, gapw=gapw)
289 ELSE
290 CALL pw_axpy(v_hartree_rspace, v_rspace_new(ispin))
291 IF (lrigpw) THEN
292 IF (ASSOCIATED(v_xc_tau)) cpabort("Meta-GGA functionals not supported with LRI!")
293
294 lri_v_int => lri_density%lri_coefs(ispin)%lri_kinds
295 CALL get_qs_env(qs_env, nkind=nkind)
296 DO ikind = 1, nkind
297 lri_v_int(ikind)%v_int = 0.0_dp
298 END DO
299 CALL integrate_v_rspace_one_center(v_rspace_new(ispin), qs_env, &
300 lri_v_int, .false., "LRI_AUX")
301 DO ikind = 1, nkind
302 CALL para_env%sum(lri_v_int(ikind)%v_int)
303 END DO
304 ALLOCATE (k1mat(1))
305 k1mat(1)%matrix => kpp1_env%v_ao(ispin)%matrix
306 IF (lri_env%exact_1c_terms) THEN
307 CALL integrate_v_rspace_diagonal(v_rspace_new(ispin), k1mat(1)%matrix, &
308 rho_ao(ispin)%matrix, qs_env, my_calc_forces, "ORB")
309 END IF
310 CALL calculate_lri_ks_matrix(lri_env, lri_v_int, k1mat, atomic_kind_set)
311 DEALLOCATE (k1mat)
312 ELSE
313 CALL integrate_v_rspace(v_rspace=v_rspace_new(ispin), &
314 pmat=rho_ao(ispin), &
315 hmat=kpp1_env%v_ao(ispin), &
316 qs_env=qs_env, &
317 calculate_forces=my_calc_forces, gapw=gapw)
318 IF (ASSOCIATED(v_xc_tau)) THEN
319 CALL integrate_v_rspace(v_rspace=v_xc_tau(ispin), &
320 pmat=rho_ao(ispin), &
321 hmat=kpp1_env%v_ao(ispin), &
322 qs_env=qs_env, &
323 compute_tau=.true., &
324 calculate_forces=my_calc_forces, gapw=gapw)
325 END IF
326 END IF
327 END IF
328
329 CALL dbcsr_add(p_env%kpp1(ispin)%matrix, kpp1_env%v_ao(ispin)%matrix, 1.0_dp, alpha)
330 END DO
331
332 IF (gapw) THEN
333 CALL vh_1c_gg_integrals(qs_env, energy_hartree_1c, &
334 p_env%hartree_local%ecoul_1c, &
335 p_env%local_rho_set, &
336 para_env, tddft=.true., core_2nd=.true.)
337 CALL integrate_vhg0_rspace(qs_env, v_hartree_rspace, para_env, &
338 calculate_forces=my_calc_forces, &
339 local_rho_set=p_env%local_rho_set)
340 ! *** Add single atom contributions to the KS matrix ***
341 ! remap pointer
342 ns = SIZE(p_env%kpp1)
343 ksmat(1:ns, 1:1) => p_env%kpp1(1:ns)
344 ns = SIZE(rho_ao)
345 psmat(1:ns, 1:1) => rho_ao(1:ns)
346 CALL update_ks_atom(qs_env, ksmat, psmat, forces=my_calc_forces, tddft=.true., &
347 rho_atom_external=p_env%local_rho_set%rho_atom_set)
348 ELSE IF (gapw_xc) THEN
349 ns = SIZE(p_env%kpp1)
350 ksmat(1:ns, 1:1) => p_env%kpp1(1:ns)
351 ns = SIZE(rho_ao)
352 psmat(1:ns, 1:1) => rho_ao(1:ns)
353 CALL update_ks_atom(qs_env, ksmat, psmat, forces=my_calc_forces, tddft=.true., &
354 rho_atom_external=p_env%local_rho_set%rho_atom_set)
355 END IF
356
357 CALL auxbas_pw_pool%give_back_pw(v_hartree_rspace)
358 DO ispin = 1, SIZE(v_rspace_new)
359 CALL auxbas_pw_pool%give_back_pw(v_rspace_new(ispin))
360 END DO
361 DEALLOCATE (v_rspace_new)
362 IF (ASSOCIATED(v_xc_tau)) THEN
363 DO ispin = 1, SIZE(v_xc_tau)
364 CALL auxbas_pw_pool%give_back_pw(v_xc_tau(ispin))
365 END DO
366 DEALLOCATE (v_xc_tau)
367 END IF
368
369 CALL timestop(handle)
370
371 END SUBROUTINE calc_kpp1
372
373! **************************************************************************************************
374!> \brief checks that the intenal storage is allocated, and allocs it if needed
375!> \param kpp1_env the environment to check
376!> \param qs_env the qs environment this kpp1_env lives in
377!> \param xc_section ...
378!> \author Fawzi Mohamed
379!> \note
380!> private routine
381! **************************************************************************************************
382 SUBROUTINE kpp1_check_i_alloc(kpp1_env, qs_env, xc_section)
383
384 TYPE(qs_kpp1_env_type) :: kpp1_env
385 TYPE(qs_environment_type), INTENT(IN), POINTER :: qs_env
386 TYPE(section_vals_type), POINTER :: xc_section
387
388 INTEGER :: ispin, nspins
389 TYPE(admm_type), POINTER :: admm_env
390 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_s
391 TYPE(dft_control_type), POINTER :: dft_control
392 TYPE(pw_env_type), POINTER :: pw_env
393 TYPE(qs_rho_type), POINTER :: rho
394 TYPE(section_vals_type), POINTER :: admm_xc_section
395
396! ------------------------------------------------------------------
397
398 CALL get_qs_env(qs_env, pw_env=pw_env, matrix_s=matrix_s, &
399 admm_env=admm_env, dft_control=dft_control)
400
401 nspins = dft_control%nspins
402
403 IF (.NOT. ASSOCIATED(kpp1_env%v_ao)) THEN
404 CALL dbcsr_allocate_matrix_set(kpp1_env%v_ao, nspins)
405 DO ispin = 1, nspins
406 ALLOCATE (kpp1_env%v_ao(ispin)%matrix)
407 CALL dbcsr_copy(kpp1_env%v_ao(ispin)%matrix, matrix_s(1)%matrix, &
408 name="kpp1%v_ao-"//adjustl(cp_to_string(ispin)))
409 END DO
410 END IF
411
412 IF (.NOT. ASSOCIATED(kpp1_env%deriv_set)) THEN
413 IF (dft_control%qs_control%gapw_xc) THEN
414 CALL get_qs_env(qs_env, rho_xc=rho)
415 ELSE
416 CALL get_qs_env(qs_env, rho=rho)
417 END IF
418 ALLOCATE (kpp1_env%deriv_set, kpp1_env%rho_set)
419 CALL qs_fxc_prep(qs_env, rho, &
420 kpp1_env%rho_set, kpp1_env%deriv_set, &
421 xc_section, pw_env, is_triplet=.false.)
422 END IF
423
424 ! ADMM Correction
425 IF (dft_control%do_admm) THEN
426 IF (admm_env%aux_exch_func /= do_admm_aux_exch_func_none) THEN
427 IF (.NOT. ASSOCIATED(kpp1_env%deriv_set_admm)) THEN
428 ALLOCATE (kpp1_env%deriv_set_admm, kpp1_env%rho_set_admm)
429 admm_xc_section => admm_env%xc_section_aux
430 CALL get_admm_env(admm_env, rho_aux_fit=rho)
431 CALL qs_fxc_prep(qs_env, rho, kpp1_env%rho_set_admm, kpp1_env%deriv_set_admm, &
432 admm_xc_section, pw_env, is_triplet=.false.)
433 END IF
434 END IF
435 END IF
436
437 END SUBROUTINE kpp1_check_i_alloc
438! **************************************************************************************************
439!> \brief ...
440!> \param rho1 ...
441!> \param rho1_tot_gspace ...
442!> \param out_unit ...
443! **************************************************************************************************
444 SUBROUTINE print_densities(rho1, rho1_tot_gspace, out_unit)
445
446 TYPE(qs_rho_type), POINTER :: rho1
447 TYPE(pw_c1d_gs_type), INTENT(IN) :: rho1_tot_gspace
448 INTEGER :: out_unit
449
450 REAL(kind=dp) :: total_rho_gspace
451 REAL(kind=dp), DIMENSION(:), POINTER :: tot_rho1_r
452
453 NULLIFY (tot_rho1_r)
454
455 total_rho_gspace = pw_integrate_function(rho1_tot_gspace, isign=-1)
456 IF (out_unit > 0) THEN
457 CALL qs_rho_get(rho1, tot_rho_r=tot_rho1_r)
458 WRITE (unit=out_unit, fmt="(T3,A,T60,F20.10)") &
459 "KPP1 total charge density (r-space):", &
460 accurate_sum(tot_rho1_r), &
461 "KPP1 total charge density (g-space):", &
462 total_rho_gspace
463 END IF
464
465 END SUBROUTINE print_densities
466
467END MODULE qs_kpp1_env_methods
Types and set/get functions for auxiliary density matrix methods.
Definition admm_types.F:15
subroutine, public get_admm_env(admm_env, mo_derivs_aux_fit, mos_aux_fit, sab_aux_fit, sab_aux_fit_asymm, sab_aux_fit_vs_orb, matrix_s_aux_fit, matrix_s_aux_fit_kp, matrix_s_aux_fit_vs_orb, matrix_s_aux_fit_vs_orb_kp, task_list_aux_fit, matrix_ks_aux_fit, matrix_ks_aux_fit_kp, matrix_ks_aux_fit_im, matrix_ks_aux_fit_dft, matrix_ks_aux_fit_hfx, matrix_ks_aux_fit_dft_kp, matrix_ks_aux_fit_hfx_kp, rho_aux_fit, rho_aux_fit_buffer, admm_dm)
Get routine for the ADMM env.
Definition admm_types.F:599
Define the atomic kind types and their sub types.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
DBCSR operations in CP2K.
various routines to log and control the output. The idea is that decisions about where to log should ...
subroutine, public vh_1c_gg_integrals(qs_env, energy_hartree_1c, ecoul_1c, local_rho_set, para_env, tddft, local_rho_set_2nd, core_2nd)
Calculates one center GAPW Hartree energies and matrix elements Hartree potentials are input Takes po...
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_admm_aux_exch_func_none
objects that represent the structure of input sections and the data contained in an input section
sums arrays of real/complex numbers with much reduced round-off as compared to a naive implementation...
Definition kahan_sum.F:29
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
contains the types and subroutines for dealing with the lri_env lri : local resolution of the identit...
routines that build the Kohn-Sham matrix for the LRIGPW and xc parts
subroutine, public calculate_lri_ks_matrix(lri_env, lri_v_int, h_matrix, atomic_kind_set, cell_to_index)
update of LRIGPW KS matrix
Interface to the message passing library MPI.
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
functions related to the poisson solver on regular grids
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Calculation of non local dispersion functionals Some routines adapted from: Copyright (C) 2001-2009 Q...
subroutine, public qs_fxc_nlvdw_apply(qs_env, xc_section, dispersion_env, rho0_r, rho1_r, fxc_rho)
Second derivative of nl-vdW potential.
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, mimic, 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, sab_cneo, 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, matrix_vhxc, 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, xcint_weights, 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, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_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, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
Setup Routine for Fxc Potentials.
Definition qs_fxc.F:15
subroutine, public qs_fxc_apply(qs_env, xc_deriv_set, xc_rho_set, rho1_struct, rho0_atom_set, xc_section, do_onecenter, fxc_rho, fxc_tau, rho1_atom_set, do_scale, is_triplet, spinflip, pw_env_ext, kind_set_external, para_env_external, compute_virial, virial_xc)
...
Definition qs_fxc.F:714
subroutine, public qs_fxc_prep(qs_env, rho0_struct, xc_rho_set, xc_deriv_set, xc_section, pw_env_ext, is_triplet)
...
Definition qs_fxc.F:539
subroutine, public prepare_gapw_den(qs_env, local_rho_set, do_rho0, kind_set_external, pw_env_sub)
...
Integrate single or product functions over a potential on a RS grid.
module that builds the second order perturbation kernel kpp1 = delta_rho|_P delta_rho|_P E drho(P1) d...
subroutine, public kpp1_check_i_alloc(kpp1_env, qs_env, xc_section)
checks that the intenal storage is allocated, and allocs it if needed
subroutine, public calc_kpp1(rho1_xc, rho1, xc_section, lrigpw, qs_env, p_env, calc_forces, calc_virial, virial)
...
subroutine, public kpp1_create(kpp1_env)
allocates and initializes a kpp1_env
basis types for the calculation of the perturbation of density theory.
routines that build the Kohn-Sham matrix contributions coming from local atomic densities
Definition qs_ks_atom.F:12
subroutine, public update_ks_atom(qs_env, ksmat, pmat, forces, tddft, rho_atom_external, kind_set_external, oce_external, sab_external, kscale, kintegral, kforce, fscale)
The correction to the KS matrix due to the GAPW local terms to the hartree and XC contributions is he...
Definition qs_ks_atom.F:110
basis types for the calculation of the perturbation of density theory.
subroutine, public integrate_vhg0_rspace(qs_env, v_rspace, para_env, calculate_forces, local_rho_set, local_rho_set_2nd, atener, kforce, my_pools, my_rs_descs)
...
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...
stores some data used in wavefunction fitting
Definition admm_types.F:120
Provides all information about an atomic kind.
stores all the informations relevant to an mpi environment
contained for different pw related things
environment for the poisson solver
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
environment that keeps the informations and temporary val to build the kpp1 kernel matrix
Represent a qs system that is perturbed. Can calculate the linear operator and the rhs of the system ...
keeps the density in various representations, keeping track of which ones are valid.