(git:e0f0c17)
Loading...
Searching...
No Matches
qs_ks_reference.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 Calculate the KS reference potentials
10!> \par History
11!> 07.2022 created
12!> \author JGH
13! **************************************************************************************************
15 USE admm_types, ONLY: admm_type,&
19 USE cp_dbcsr_api, ONLY: dbcsr_p_type
28 USE kinds, ONLY: dp
30 USE pw_env_types, ONLY: pw_env_get,&
33 USE pw_methods, ONLY: pw_scale,&
39 USE pw_types, ONLY: pw_c1d_gs_type,&
55 USE qs_rho0_methods, ONLY: init_rho0
58 USE qs_rho_types, ONLY: qs_rho_get,&
60 USE qs_vxc, ONLY: qs_vxc_create
62 USE virial_types, ONLY: virial_type
63#include "./base/base_uses.f90"
64
65 IMPLICIT NONE
66
67 PRIVATE
68
69! *** Global parameters ***
70
71 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_ks_reference'
72
74
75! **************************************************************************************************
76
77CONTAINS
78
79! **************************************************************************************************
80!> \brief calculate the Kohn-Sham reference potential
81!> \param qs_env ...
82!> \param vh_rspace ...
83!> \param vxc_rspace ...
84!> \param vtau_rspace ...
85!> \param vadmm_rspace ...
86!> \param ehartree ...
87!> \param exc ...
88!> \param h_stress container for the stress tensor of the Hartree term
89!> \param vadmm_tau_rspace ADMM auxiliary tau potential
90!> \par History
91!> 10.2019 created [JGH]
92!> \author JGH
93! **************************************************************************************************
94 SUBROUTINE ks_ref_potential(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspace, &
95 ehartree, exc, h_stress, vadmm_tau_rspace)
96 TYPE(qs_environment_type), POINTER :: qs_env
97 TYPE(pw_r3d_rs_type), INTENT(INOUT) :: vh_rspace
98 TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rspace, vtau_rspace, vadmm_rspace
99 REAL(kind=dp), INTENT(OUT) :: ehartree, exc
100 REAL(kind=dp), DIMENSION(3, 3), INTENT(INOUT), &
101 OPTIONAL :: h_stress
102 TYPE(pw_r3d_rs_type), DIMENSION(:), OPTIONAL, &
103 POINTER :: vadmm_tau_rspace
104
105 CHARACTER(LEN=*), PARAMETER :: routinen = 'ks_ref_potential'
106
107 INTEGER :: handle, iab, ispin, nspins
108 REAL(dp) :: eadmm, eovrl, eself
109 REAL(kind=dp), DIMENSION(3, 3) :: virial_xc
110 TYPE(admm_type), POINTER :: admm_env
111 TYPE(dft_control_type), POINTER :: dft_control
112 TYPE(mp_para_env_type), POINTER :: para_env
113 TYPE(pw_c1d_gs_type) :: rho_tot_gspace, v_hartree_gspace
114 TYPE(pw_c1d_gs_type), POINTER :: rho_core
115 TYPE(pw_env_type), POINTER :: pw_env
116 TYPE(pw_grid_type), POINTER :: pw_grid
117 TYPE(pw_poisson_type), POINTER :: poisson_env
118 TYPE(pw_pool_type), POINTER :: auxbas_pw_pool
119 TYPE(pw_r3d_rs_type) :: v_hartree_rspace
120 TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_admm_rspace, v_admm_tau_rspace, &
121 v_rspace, v_tau_rspace
122 TYPE(qs_ks_env_type), POINTER :: ks_env
123 TYPE(qs_rho_type), POINTER :: rho, rho_xc
124 TYPE(section_vals_type), POINTER :: xc_section
125 TYPE(virial_type), POINTER :: virial
126
127 CALL timeset(routinen, handle)
128
129 ! get all information on the electronic density
130 NULLIFY (rho, ks_env)
131 CALL get_qs_env(qs_env=qs_env, rho=rho, dft_control=dft_control, &
132 para_env=para_env, ks_env=ks_env, rho_core=rho_core)
133
134 nspins = dft_control%nspins
135
136 NULLIFY (pw_env)
137 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env)
138 cpassert(ASSOCIATED(pw_env))
139
140 NULLIFY (auxbas_pw_pool, poisson_env)
141 ! gets the tmp grids
142 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, &
143 poisson_env=poisson_env)
144
145 ! Calculate the Hartree potential
146 CALL auxbas_pw_pool%create_pw(v_hartree_gspace)
147 CALL auxbas_pw_pool%create_pw(v_hartree_rspace)
148 CALL auxbas_pw_pool%create_pw(rho_tot_gspace)
149
150 ! Get the total density in g-space [ions + electrons]
151 CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho)
152
153 CALL pw_poisson_solve(poisson_env, rho_tot_gspace, ehartree, &
154 v_hartree_gspace, h_stress=h_stress, rho_core=rho_core)
155 CALL pw_transfer(v_hartree_gspace, v_hartree_rspace)
156 CALL pw_scale(v_hartree_rspace, v_hartree_rspace%pw_grid%dvol)
157
158 CALL auxbas_pw_pool%give_back_pw(v_hartree_gspace)
159 CALL auxbas_pw_pool%give_back_pw(rho_tot_gspace)
160 !
161 CALL calculate_ecore_self(qs_env, e_self_core=eself)
162 CALL calculate_ecore_overlap(qs_env, para_env, PRESENT(h_stress), e_overlap_core=eovrl)
163 ehartree = ehartree + eovrl + eself
164
165 ! v_rspace and v_tau_rspace are generated from the auxbas pool
166 IF (dft_control%do_admm) THEN
167 CALL get_qs_env(qs_env, admm_env=admm_env)
168 xc_section => admm_env%xc_section_primary
169 ELSE
170 xc_section => section_vals_get_subs_vals(qs_env%input, "DFT%XC")
171 END IF
172 NULLIFY (v_rspace, v_tau_rspace)
173 IF (dft_control%qs_control%gapw_xc) THEN
174 CALL get_qs_env(qs_env=qs_env, rho_xc=rho_xc)
175 CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho_xc, xc_section=xc_section, &
176 vxc_rho=v_rspace, vxc_tau=v_tau_rspace, exc=exc, just_energy=.false.)
177 ELSE
178 CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho, xc_section=xc_section, &
179 vxc_rho=v_rspace, vxc_tau=v_tau_rspace, exc=exc, just_energy=.false.)
180 END IF
181
182 NULLIFY (v_admm_rspace, v_admm_tau_rspace)
183 IF (dft_control%do_admm) THEN
184 IF (dft_control%admm_control%aux_exch_func /= do_admm_aux_exch_func_none) THEN
185 ! For the virial, we have to save the pv_xc component because it will be reset in qs_vxc_create
186 IF (PRESENT(h_stress)) THEN
187 CALL get_qs_env(qs_env, virial=virial)
188 virial_xc = virial%pv_xc
189 END IF
190 CALL get_admm_env(admm_env, rho_aux_fit=rho)
191 xc_section => admm_env%xc_section_aux
192 CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho, xc_section=xc_section, &
193 vxc_rho=v_admm_rspace, vxc_tau=v_admm_tau_rspace, exc=eadmm, just_energy=.false.)
194 IF (PRESENT(h_stress)) virial%pv_xc = virial%pv_xc + virial_xc
195 END IF
196 END IF
197
198 ! allocate potentials
199 IF (ASSOCIATED(vh_rspace%pw_grid)) THEN
200 CALL vh_rspace%release()
201 END IF
202 IF (ASSOCIATED(vxc_rspace)) THEN
203 DO iab = 1, SIZE(vxc_rspace)
204 CALL vxc_rspace(iab)%release()
205 END DO
206 ELSE
207 ALLOCATE (vxc_rspace(nspins))
208 END IF
209 IF (ASSOCIATED(v_tau_rspace)) THEN
210 IF (ASSOCIATED(vtau_rspace)) THEN
211 DO iab = 1, SIZE(vtau_rspace)
212 CALL vtau_rspace(iab)%release()
213 END DO
214 ELSE
215 ALLOCATE (vtau_rspace(nspins))
216 END IF
217 ELSE
218 NULLIFY (vtau_rspace)
219 END IF
220 IF (ASSOCIATED(v_admm_rspace)) THEN
221 IF (ASSOCIATED(vadmm_rspace)) THEN
222 DO iab = 1, SIZE(vadmm_rspace)
223 CALL vadmm_rspace(iab)%release()
224 END DO
225 ELSE
226 ALLOCATE (vadmm_rspace(nspins))
227 END IF
228 ELSE
229 NULLIFY (vadmm_rspace)
230 END IF
231 IF (PRESENT(vadmm_tau_rspace)) THEN
232 IF (ASSOCIATED(vadmm_tau_rspace)) THEN
233 DO iab = 1, SIZE(vadmm_tau_rspace)
234 CALL vadmm_tau_rspace(iab)%release()
235 END DO
236 END IF
237 IF (ASSOCIATED(v_admm_tau_rspace)) THEN
238 IF (.NOT. ASSOCIATED(vadmm_tau_rspace)) ALLOCATE (vadmm_tau_rspace(nspins))
239 ELSE
240 IF (ASSOCIATED(vadmm_tau_rspace)) DEALLOCATE (vadmm_tau_rspace)
241 NULLIFY (vadmm_tau_rspace)
242 END IF
243 END IF
244
245 pw_grid => v_hartree_rspace%pw_grid
246 CALL vh_rspace%create(pw_grid)
247 DO ispin = 1, nspins
248 CALL vxc_rspace(ispin)%create(pw_grid)
249 IF (ASSOCIATED(vtau_rspace)) THEN
250 CALL vtau_rspace(ispin)%create(pw_grid)
251 END IF
252 IF (ASSOCIATED(vadmm_rspace)) THEN
253 CALL vadmm_rspace(ispin)%create(pw_grid)
254 END IF
255 IF (PRESENT(vadmm_tau_rspace)) THEN
256 IF (ASSOCIATED(vadmm_tau_rspace)) CALL vadmm_tau_rspace(ispin)%create(pw_grid)
257 END IF
258 END DO
259 !
260 CALL pw_transfer(v_hartree_rspace, vh_rspace)
261 IF (ASSOCIATED(v_rspace)) THEN
262 DO ispin = 1, nspins
263 CALL pw_transfer(v_rspace(ispin), vxc_rspace(ispin))
264 CALL pw_scale(vxc_rspace(ispin), v_rspace(ispin)%pw_grid%dvol)
265 IF (ASSOCIATED(v_tau_rspace)) THEN
266 CALL pw_transfer(v_tau_rspace(ispin), vtau_rspace(ispin))
267 CALL pw_scale(vtau_rspace(ispin), v_tau_rspace(ispin)%pw_grid%dvol)
268 END IF
269 END DO
270 ELSE
271 DO ispin = 1, nspins
272 CALL pw_zero(vxc_rspace(ispin))
273 END DO
274 END IF
275 IF (ASSOCIATED(v_admm_rspace)) THEN
276 DO ispin = 1, nspins
277 CALL pw_transfer(v_admm_rspace(ispin), vadmm_rspace(ispin))
278 CALL pw_scale(vadmm_rspace(ispin), vadmm_rspace(ispin)%pw_grid%dvol)
279 END DO
280 END IF
281 IF (PRESENT(vadmm_tau_rspace)) THEN
282 IF (ASSOCIATED(v_admm_tau_rspace)) THEN
283 DO ispin = 1, nspins
284 CALL pw_transfer(v_admm_tau_rspace(ispin), vadmm_tau_rspace(ispin))
285 CALL pw_scale(vadmm_tau_rspace(ispin), vadmm_tau_rspace(ispin)%pw_grid%dvol)
286 END DO
287 END IF
288 END IF
289
290 ! return pw grids
291 CALL auxbas_pw_pool%give_back_pw(v_hartree_rspace)
292 IF (ASSOCIATED(v_rspace)) THEN
293 DO ispin = 1, nspins
294 CALL auxbas_pw_pool%give_back_pw(v_rspace(ispin))
295 IF (ASSOCIATED(v_tau_rspace)) THEN
296 CALL auxbas_pw_pool%give_back_pw(v_tau_rspace(ispin))
297 END IF
298 END DO
299 DEALLOCATE (v_rspace)
300 END IF
301 IF (ASSOCIATED(v_tau_rspace)) DEALLOCATE (v_tau_rspace)
302 IF (ASSOCIATED(v_admm_rspace)) THEN
303 DO ispin = 1, nspins
304 CALL auxbas_pw_pool%give_back_pw(v_admm_rspace(ispin))
305 END DO
306 DEALLOCATE (v_admm_rspace)
307 END IF
308 IF (ASSOCIATED(v_admm_tau_rspace)) THEN
309 DO ispin = 1, nspins
310 CALL auxbas_pw_pool%give_back_pw(v_admm_tau_rspace(ispin))
311 END DO
312 DEALLOCATE (v_admm_tau_rspace)
313 END IF
314
315 CALL timestop(handle)
316
317 END SUBROUTINE ks_ref_potential
318
319! **************************************************************************************************
320!> \brief calculate the Kohn-Sham GAPW reference potentials
321!> \param qs_env ...
322!> \param local_rho_set ...
323!> \param local_rho_set_admm ...
324!> \param v_hartree_rspace ...
325!> \par History
326!> 07.2022 created [JGH]
327!> \author JGH
328! **************************************************************************************************
329 SUBROUTINE ks_ref_potential_atom(qs_env, local_rho_set, local_rho_set_admm, v_hartree_rspace)
330 TYPE(qs_environment_type), POINTER :: qs_env
331 TYPE(local_rho_type), POINTER :: local_rho_set, local_rho_set_admm
332 TYPE(pw_r3d_rs_type), INTENT(IN) :: v_hartree_rspace
333
334 CHARACTER(LEN=*), PARAMETER :: routinen = 'ks_ref_potential_atom'
335
336 INTEGER :: handle, natom, nspins
337 LOGICAL :: gapw, gapw_xc
338 REAL(kind=dp) :: eh1c, exc1, exc1_admm
339 TYPE(admm_type), POINTER :: admm_env
340 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
341 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_aux, rho_ao_kp
342 TYPE(dft_control_type), POINTER :: dft_control
343 TYPE(hartree_local_type), POINTER :: hartree_local
344 TYPE(mp_para_env_type), POINTER :: para_env
345 TYPE(neighbor_list_set_p_type), DIMENSION(:), &
346 POINTER :: sab
347 TYPE(oce_matrix_type), POINTER :: oce
348 TYPE(pw_env_type), POINTER :: pw_env
349 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
350 TYPE(qs_rho_type), POINTER :: rho, rho_aux_fit
351 TYPE(section_vals_type), POINTER :: xc_section
352
353 CALL timeset(routinen, handle)
354
355 ! get all information on the electronic density
356 CALL get_qs_env(qs_env=qs_env, rho=rho, pw_env=pw_env, &
357 dft_control=dft_control, para_env=para_env)
358
359 nspins = dft_control%nspins
360 gapw = dft_control%qs_control%gapw
361 gapw_xc = dft_control%qs_control%gapw_xc
362
363 IF (gapw .OR. gapw_xc) THEN
364 NULLIFY (hartree_local, local_rho_set, local_rho_set_admm)
365 CALL get_qs_env(qs_env, &
366 atomic_kind_set=atomic_kind_set, &
367 qs_kind_set=qs_kind_set)
368 CALL local_rho_set_create(local_rho_set)
369 CALL allocate_rho_atom_internals(local_rho_set%rho_atom_set, atomic_kind_set, &
370 qs_kind_set, dft_control, para_env)
371 IF (gapw) THEN
372 CALL get_qs_env(qs_env, natom=natom)
373 CALL init_rho0(local_rho_set, qs_env, dft_control%qs_control%gapw_control)
374 CALL rho0_s_grid_create(pw_env, local_rho_set%rho0_mpole)
375 CALL hartree_local_create(hartree_local)
376 CALL init_coulomb_local(hartree_local, natom)
377 END IF
378
379 CALL get_qs_env(qs_env=qs_env, oce=oce, sab_orb=sab)
380 CALL qs_rho_get(rho, rho_ao_kp=rho_ao_kp)
381 CALL calculate_rho_atom_coeff(qs_env, rho_ao_kp, local_rho_set%rho_atom_set, &
382 qs_kind_set, oce, sab, para_env)
383 CALL prepare_gapw_den(qs_env, local_rho_set, do_rho0=gapw)
384
385 IF (dft_control%do_admm) THEN
386 CALL get_qs_env(qs_env, admm_env=admm_env)
387 xc_section => admm_env%xc_section_primary
388 ELSE
389 xc_section => section_vals_get_subs_vals(qs_env%input, "DFT%XC")
390 END IF
391 CALL calculate_vxc_atom(qs_env, .false., exc1=exc1, xc_section_external=xc_section, &
392 rho_atom_set_external=local_rho_set%rho_atom_set)
393
394 IF (gapw) THEN
395 CALL vh_1c_gg_integrals(qs_env, eh1c, hartree_local%ecoul_1c, local_rho_set, para_env, .false.)
396 CALL integrate_vhg0_rspace(qs_env, v_hartree_rspace, para_env, calculate_forces=.false., &
397 local_rho_set=local_rho_set)
398 END IF
399
400 IF (dft_control%do_admm) THEN
401 IF (admm_env%do_gapw) THEN
402 CALL local_rho_set_create(local_rho_set_admm)
403 CALL allocate_rho_atom_internals(local_rho_set_admm%rho_atom_set, atomic_kind_set, &
404 admm_env%admm_gapw_env%admm_kind_set, dft_control, para_env)
405 oce => admm_env%admm_gapw_env%oce
406 sab => admm_env%sab_aux_fit
407 CALL get_admm_env(admm_env, rho_aux_fit=rho_aux_fit)
408 CALL qs_rho_get(rho, rho_ao_kp=rho_ao_aux)
409 CALL calculate_rho_atom_coeff(qs_env, rho_ao_aux, local_rho_set_admm%rho_atom_set, &
410 admm_env%admm_gapw_env%admm_kind_set, oce, sab, para_env)
411 CALL prepare_gapw_den(qs_env, local_rho_set=local_rho_set_admm, &
412 do_rho0=.false., kind_set_external=admm_env%admm_gapw_env%admm_kind_set)
413 !compute the potential due to atomic densities
414 xc_section => admm_env%xc_section_aux
415 CALL calculate_vxc_atom(qs_env, energy_only=.false., exc1=exc1_admm, &
416 kind_set_external=admm_env%admm_gapw_env%admm_kind_set, &
417 xc_section_external=xc_section, &
418 rho_atom_set_external=local_rho_set_admm%rho_atom_set)
419 END IF
420 END IF
421
422 ! clean up
423 CALL hartree_local_release(hartree_local)
424
425 ELSE
426
427 NULLIFY (local_rho_set, local_rho_set_admm)
428
429 END IF
430
431 CALL timestop(handle)
432
433 END SUBROUTINE ks_ref_potential_atom
434
435! **************************************************************************************************
436
437END MODULE qs_ks_reference
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:593
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 init_coulomb_local(hartree_local, natom)
...
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...
subroutine, public hartree_local_release(hartree_local)
...
subroutine, public hartree_local_create(hartree_local)
...
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
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
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 the energies concerning the core charge distribution.
subroutine, public calculate_ecore_overlap(qs_env, para_env, calculate_forces, molecular, e_overlap_core, atecc)
Calculate the overlap energy of the core charge distribution.
subroutine, public calculate_ecore_self(qs_env, e_self_core, atecc)
Calculate the self energy of the core charge distribution.
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, 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.
subroutine, public prepare_gapw_den(qs_env, local_rho_set, do_rho0, kind_set_external, pw_env_sub)
...
Define the quickstep kind type and their sub types.
routines that build the Kohn-Sham matrix (i.e calculate the coulomb and xc parts
subroutine, public calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho, skip_nuclear_density)
...
Calculate the KS reference potentials.
subroutine, public ks_ref_potential_atom(qs_env, local_rho_set, local_rho_set_admm, v_hartree_rspace)
calculate the Kohn-Sham GAPW reference potentials
subroutine, public ks_ref_potential(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspace, ehartree, exc, h_stress, vadmm_tau_rspace)
calculate the Kohn-Sham reference potential
subroutine, public local_rho_set_create(local_rho_set)
...
Define the neighbor list data types and the corresponding functionality.
subroutine, public rho0_s_grid_create(pw_env, rho0_mpole)
...
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)
...
subroutine, public init_rho0(local_rho_set, qs_env, gapw_control, zcore)
...
subroutine, public allocate_rho_atom_internals(rho_atom_set, atomic_kind_set, qs_kind_set, dft_control, para_env)
...
subroutine, public calculate_rho_atom_coeff(qs_env, rho_ao, rho_atom_set, qs_kind_set, oce, sab, para_env)
...
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...
routines that build the integrals of the Vxc potential calculated for the atomic density in the basis...
Definition qs_vxc_atom.F:12
subroutine, public calculate_vxc_atom(qs_env, energy_only, exc1, adiabatic_rescale_factor, kind_set_external, rho_atom_set_external, xc_section_external)
...
Definition qs_vxc_atom.F:96
subroutine, public qs_vxc_create(ks_env, rho_struct, xc_section, vxc_rho, vxc_tau, exc, just_energy, edisp, dispersion_env, adiabatic_rescale_factor, pw_env_external, native_skala_atom_force)
calculates and allocates the xc potential, already reducing it to the dependence on rho and the one o...
Definition qs_vxc.F:102
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 ...
Provides all information about a quickstep kind.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
keeps the density in various representations, keeping track of which ones are valid.