(git:34ef472)
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-2024 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,&
17  USE atomic_kind_types, ONLY: atomic_kind_type
18  USE cp_control_types, ONLY: dft_control_type
19  USE dbcsr_api, ONLY: dbcsr_p_type
24  hartree_local_type
27  section_vals_type
28  USE kinds, ONLY: dp
29  USE message_passing, ONLY: mp_para_env_type
30  USE pw_env_types, ONLY: pw_env_get,&
31  pw_env_type
32  USE pw_grid_types, ONLY: pw_grid_type
33  USE pw_methods, ONLY: pw_scale,&
34  pw_transfer,&
35  pw_zero
36  USE pw_poisson_methods, ONLY: pw_poisson_solve
37  USE pw_poisson_types, ONLY: pw_poisson_type
38  USE pw_pool_types, ONLY: pw_pool_type
39  USE pw_types, ONLY: pw_c1d_gs_type,&
40  pw_r3d_rs_type
43  USE qs_environment_types, ONLY: get_qs_env,&
44  qs_environment_type
46  USE qs_kind_types, ONLY: qs_kind_type
48  USE qs_ks_types, ONLY: qs_ks_env_type
50  local_rho_type
51  USE qs_neighbor_list_types, ONLY: neighbor_list_set_p_type
52  USE qs_oce_types, ONLY: oce_matrix_type
55  USE qs_rho0_methods, ONLY: init_rho0
58  USE qs_rho_types, ONLY: qs_rho_get,&
59  qs_rho_type
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 
77 CONTAINS
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 !> \par History
90 !> 10.2019 created [JGH]
91 !> \author JGH
92 ! **************************************************************************************************
93  SUBROUTINE ks_ref_potential(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspace, &
94  ehartree, exc, h_stress)
95  TYPE(qs_environment_type), POINTER :: qs_env
96  TYPE(pw_r3d_rs_type), INTENT(INOUT) :: vh_rspace
97  TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rspace, vtau_rspace, vadmm_rspace
98  REAL(kind=dp), INTENT(OUT) :: ehartree, exc
99  REAL(kind=dp), DIMENSION(3, 3), INTENT(INOUT), &
100  OPTIONAL :: h_stress
101 
102  CHARACTER(LEN=*), PARAMETER :: routinen = 'ks_ref_potential'
103 
104  INTEGER :: handle, iab, ispin, nspins
105  REAL(dp) :: eadmm, eovrl, eself
106  REAL(kind=dp), DIMENSION(3, 3) :: virial_xc
107  TYPE(admm_type), POINTER :: admm_env
108  TYPE(dft_control_type), POINTER :: dft_control
109  TYPE(mp_para_env_type), POINTER :: para_env
110  TYPE(pw_c1d_gs_type) :: rho_tot_gspace, v_hartree_gspace
111  TYPE(pw_c1d_gs_type), POINTER :: rho_core
112  TYPE(pw_env_type), POINTER :: pw_env
113  TYPE(pw_grid_type), POINTER :: pw_grid
114  TYPE(pw_poisson_type), POINTER :: poisson_env
115  TYPE(pw_pool_type), POINTER :: auxbas_pw_pool
116  TYPE(pw_r3d_rs_type) :: v_hartree_rspace
117  TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_admm_rspace, v_admm_tau_rspace, &
118  v_rspace, v_tau_rspace
119  TYPE(qs_ks_env_type), POINTER :: ks_env
120  TYPE(qs_rho_type), POINTER :: rho, rho_xc
121  TYPE(section_vals_type), POINTER :: xc_section
122  TYPE(virial_type), POINTER :: virial
123 
124  CALL timeset(routinen, handle)
125 
126  ! get all information on the electronic density
127  NULLIFY (rho, ks_env)
128  CALL get_qs_env(qs_env=qs_env, rho=rho, dft_control=dft_control, &
129  para_env=para_env, ks_env=ks_env, rho_core=rho_core)
130 
131  nspins = dft_control%nspins
132 
133  NULLIFY (pw_env)
134  CALL get_qs_env(qs_env=qs_env, pw_env=pw_env)
135  cpassert(ASSOCIATED(pw_env))
136 
137  NULLIFY (auxbas_pw_pool, poisson_env)
138  ! gets the tmp grids
139  CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, &
140  poisson_env=poisson_env)
141 
142  ! Calculate the Hartree potential
143  CALL auxbas_pw_pool%create_pw(v_hartree_gspace)
144  CALL auxbas_pw_pool%create_pw(v_hartree_rspace)
145  CALL auxbas_pw_pool%create_pw(rho_tot_gspace)
146 
147  ! Get the total density in g-space [ions + electrons]
148  CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho)
149 
150  CALL pw_poisson_solve(poisson_env, rho_tot_gspace, ehartree, &
151  v_hartree_gspace, h_stress=h_stress, rho_core=rho_core)
152  CALL pw_transfer(v_hartree_gspace, v_hartree_rspace)
153  CALL pw_scale(v_hartree_rspace, v_hartree_rspace%pw_grid%dvol)
154 
155  CALL auxbas_pw_pool%give_back_pw(v_hartree_gspace)
156  CALL auxbas_pw_pool%give_back_pw(rho_tot_gspace)
157  !
158  CALL calculate_ecore_self(qs_env, e_self_core=eself)
159  CALL calculate_ecore_overlap(qs_env, para_env, PRESENT(h_stress), e_overlap_core=eovrl)
160  ehartree = ehartree + eovrl + eself
161 
162  ! v_rspace and v_tau_rspace are generated from the auxbas pool
163  IF (dft_control%do_admm) THEN
164  CALL get_qs_env(qs_env, admm_env=admm_env)
165  xc_section => admm_env%xc_section_primary
166  ELSE
167  xc_section => section_vals_get_subs_vals(qs_env%input, "DFT%XC")
168  END IF
169  NULLIFY (v_rspace, v_tau_rspace)
170  IF (dft_control%qs_control%gapw_xc) THEN
171  CALL get_qs_env(qs_env=qs_env, rho_xc=rho_xc)
172  CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho_xc, xc_section=xc_section, &
173  vxc_rho=v_rspace, vxc_tau=v_tau_rspace, exc=exc, just_energy=.false.)
174  ELSE
175  CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho, xc_section=xc_section, &
176  vxc_rho=v_rspace, vxc_tau=v_tau_rspace, exc=exc, just_energy=.false.)
177  END IF
178 
179  NULLIFY (v_admm_rspace, v_admm_tau_rspace)
180  IF (dft_control%do_admm) THEN
181  IF (dft_control%admm_control%aux_exch_func /= do_admm_aux_exch_func_none) THEN
182  ! For the virial, we have to save the pv_xc component because it will be reset in qs_vxc_create
183  IF (PRESENT(h_stress)) THEN
184  CALL get_qs_env(qs_env, virial=virial)
185  virial_xc = virial%pv_xc
186  END IF
187  CALL get_admm_env(admm_env, rho_aux_fit=rho)
188  xc_section => admm_env%xc_section_aux
189  CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho, xc_section=xc_section, &
190  vxc_rho=v_admm_rspace, vxc_tau=v_admm_tau_rspace, exc=eadmm, just_energy=.false.)
191  IF (PRESENT(h_stress)) virial%pv_xc = virial%pv_xc + virial_xc
192  END IF
193  END IF
194 
195  ! allocate potentials
196  IF (ASSOCIATED(vh_rspace%pw_grid)) THEN
197  CALL vh_rspace%release()
198  END IF
199  IF (ASSOCIATED(vxc_rspace)) THEN
200  DO iab = 1, SIZE(vxc_rspace)
201  CALL vxc_rspace(iab)%release()
202  END DO
203  ELSE
204  ALLOCATE (vxc_rspace(nspins))
205  END IF
206  IF (ASSOCIATED(v_tau_rspace)) THEN
207  IF (ASSOCIATED(vtau_rspace)) THEN
208  DO iab = 1, SIZE(vtau_rspace)
209  CALL vtau_rspace(iab)%release()
210  END DO
211  ELSE
212  ALLOCATE (vtau_rspace(nspins))
213  END IF
214  ELSE
215  NULLIFY (vtau_rspace)
216  END IF
217  IF (ASSOCIATED(v_admm_rspace)) THEN
218  IF (ASSOCIATED(vadmm_rspace)) THEN
219  DO iab = 1, SIZE(vadmm_rspace)
220  CALL vadmm_rspace(iab)%release()
221  END DO
222  ELSE
223  ALLOCATE (vadmm_rspace(nspins))
224  END IF
225  ELSE
226  NULLIFY (vadmm_rspace)
227  END IF
228 
229  pw_grid => v_hartree_rspace%pw_grid
230  CALL vh_rspace%create(pw_grid)
231  DO ispin = 1, nspins
232  CALL vxc_rspace(ispin)%create(pw_grid)
233  IF (ASSOCIATED(vtau_rspace)) THEN
234  CALL vtau_rspace(ispin)%create(pw_grid)
235  END IF
236  IF (ASSOCIATED(vadmm_rspace)) THEN
237  CALL vadmm_rspace(ispin)%create(pw_grid)
238  END IF
239  END DO
240  !
241  CALL pw_transfer(v_hartree_rspace, vh_rspace)
242  IF (ASSOCIATED(v_rspace)) THEN
243  DO ispin = 1, nspins
244  CALL pw_transfer(v_rspace(ispin), vxc_rspace(ispin))
245  CALL pw_scale(vxc_rspace(ispin), v_rspace(ispin)%pw_grid%dvol)
246  IF (ASSOCIATED(v_tau_rspace)) THEN
247  CALL pw_transfer(v_tau_rspace(ispin), vtau_rspace(ispin))
248  CALL pw_scale(vtau_rspace(ispin), v_tau_rspace(ispin)%pw_grid%dvol)
249  END IF
250  END DO
251  ELSE
252  DO ispin = 1, nspins
253  CALL pw_zero(vxc_rspace(ispin))
254  END DO
255  END IF
256  IF (ASSOCIATED(v_admm_rspace)) THEN
257  DO ispin = 1, nspins
258  CALL pw_transfer(v_admm_rspace(ispin), vadmm_rspace(ispin))
259  CALL pw_scale(vadmm_rspace(ispin), vadmm_rspace(ispin)%pw_grid%dvol)
260  END DO
261  END IF
262 
263  ! return pw grids
264  CALL auxbas_pw_pool%give_back_pw(v_hartree_rspace)
265  IF (ASSOCIATED(v_rspace)) THEN
266  DO ispin = 1, nspins
267  CALL auxbas_pw_pool%give_back_pw(v_rspace(ispin))
268  IF (ASSOCIATED(v_tau_rspace)) THEN
269  CALL auxbas_pw_pool%give_back_pw(v_tau_rspace(ispin))
270  END IF
271  END DO
272  DEALLOCATE (v_rspace)
273  END IF
274  IF (ASSOCIATED(v_tau_rspace)) DEALLOCATE (v_tau_rspace)
275  IF (ASSOCIATED(v_admm_rspace)) THEN
276  DO ispin = 1, nspins
277  CALL auxbas_pw_pool%give_back_pw(v_admm_rspace(ispin))
278  END DO
279  DEALLOCATE (v_admm_rspace)
280  END IF
281 
282  CALL timestop(handle)
283 
284  END SUBROUTINE ks_ref_potential
285 
286 ! **************************************************************************************************
287 !> \brief calculate the Kohn-Sham GAPW reference potentials
288 !> \param qs_env ...
289 !> \param local_rho_set ...
290 !> \param local_rho_set_admm ...
291 !> \param v_hartree_rspace ...
292 !> \par History
293 !> 07.2022 created [JGH]
294 !> \author JGH
295 ! **************************************************************************************************
296  SUBROUTINE ks_ref_potential_atom(qs_env, local_rho_set, local_rho_set_admm, v_hartree_rspace)
297  TYPE(qs_environment_type), POINTER :: qs_env
298  TYPE(local_rho_type), POINTER :: local_rho_set, local_rho_set_admm
299  TYPE(pw_r3d_rs_type), INTENT(IN) :: v_hartree_rspace
300 
301  CHARACTER(LEN=*), PARAMETER :: routinen = 'ks_ref_potential_atom'
302 
303  INTEGER :: handle, natom, nspins
304  LOGICAL :: gapw, gapw_xc
305  REAL(kind=dp) :: eh1c, exc1, exc1_admm
306  TYPE(admm_type), POINTER :: admm_env
307  TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
308  TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_aux, rho_ao_kp
309  TYPE(dft_control_type), POINTER :: dft_control
310  TYPE(hartree_local_type), POINTER :: hartree_local
311  TYPE(mp_para_env_type), POINTER :: para_env
312  TYPE(neighbor_list_set_p_type), DIMENSION(:), &
313  POINTER :: sab
314  TYPE(oce_matrix_type), POINTER :: oce
315  TYPE(pw_env_type), POINTER :: pw_env
316  TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
317  TYPE(qs_rho_type), POINTER :: rho, rho_aux_fit
318  TYPE(section_vals_type), POINTER :: xc_section
319 
320  CALL timeset(routinen, handle)
321 
322  ! get all information on the electronic density
323  CALL get_qs_env(qs_env=qs_env, rho=rho, pw_env=pw_env, &
324  dft_control=dft_control, para_env=para_env)
325 
326  nspins = dft_control%nspins
327  gapw = dft_control%qs_control%gapw
328  gapw_xc = dft_control%qs_control%gapw_xc
329 
330  IF (gapw .OR. gapw_xc) THEN
331  NULLIFY (hartree_local, local_rho_set, local_rho_set_admm)
332  CALL get_qs_env(qs_env, &
333  atomic_kind_set=atomic_kind_set, &
334  qs_kind_set=qs_kind_set)
335  CALL local_rho_set_create(local_rho_set)
336  CALL allocate_rho_atom_internals(local_rho_set%rho_atom_set, atomic_kind_set, &
337  qs_kind_set, dft_control, para_env)
338  IF (gapw) THEN
339  CALL get_qs_env(qs_env, natom=natom)
340  CALL init_rho0(local_rho_set, qs_env, dft_control%qs_control%gapw_control)
341  CALL rho0_s_grid_create(pw_env, local_rho_set%rho0_mpole)
342  CALL hartree_local_create(hartree_local)
343  CALL init_coulomb_local(hartree_local, natom)
344  END IF
345 
346  CALL get_qs_env(qs_env=qs_env, oce=oce, sab_orb=sab)
347  CALL qs_rho_get(rho, rho_ao_kp=rho_ao_kp)
348  CALL calculate_rho_atom_coeff(qs_env, rho_ao_kp, local_rho_set%rho_atom_set, &
349  qs_kind_set, oce, sab, para_env)
350  CALL prepare_gapw_den(qs_env, local_rho_set, do_rho0=gapw)
351 
352  IF (gapw) THEN
353  CALL vh_1c_gg_integrals(qs_env, eh1c, hartree_local%ecoul_1c, local_rho_set, para_env, .false.)
354  CALL integrate_vhg0_rspace(qs_env, v_hartree_rspace, para_env, calculate_forces=.false., &
355  local_rho_set=local_rho_set)
356  END IF
357  IF (dft_control%do_admm) THEN
358  CALL get_qs_env(qs_env, admm_env=admm_env)
359  xc_section => admm_env%xc_section_primary
360  ELSE
361  xc_section => section_vals_get_subs_vals(qs_env%input, "DFT%XC")
362  END IF
363  CALL calculate_vxc_atom(qs_env, .false., exc1=exc1, xc_section_external=xc_section, &
364  rho_atom_set_external=local_rho_set%rho_atom_set)
365 
366  IF (dft_control%do_admm) THEN
367  IF (admm_env%do_gapw) THEN
368  CALL local_rho_set_create(local_rho_set_admm)
369  CALL allocate_rho_atom_internals(local_rho_set_admm%rho_atom_set, atomic_kind_set, &
370  admm_env%admm_gapw_env%admm_kind_set, dft_control, para_env)
371  oce => admm_env%admm_gapw_env%oce
372  sab => admm_env%sab_aux_fit
373  CALL get_admm_env(admm_env, rho_aux_fit=rho_aux_fit)
374  CALL qs_rho_get(rho, rho_ao_kp=rho_ao_aux)
375  CALL calculate_rho_atom_coeff(qs_env, rho_ao_aux, local_rho_set_admm%rho_atom_set, &
376  admm_env%admm_gapw_env%admm_kind_set, oce, sab, para_env)
377  CALL prepare_gapw_den(qs_env, local_rho_set=local_rho_set_admm, &
378  do_rho0=.false., kind_set_external=admm_env%admm_gapw_env%admm_kind_set)
379  !compute the potential due to atomic densities
380  xc_section => admm_env%xc_section_aux
381  CALL calculate_vxc_atom(qs_env, energy_only=.false., exc1=exc1_admm, &
382  kind_set_external=admm_env%admm_gapw_env%admm_kind_set, &
383  xc_section_external=xc_section, &
384  rho_atom_set_external=local_rho_set_admm%rho_atom_set)
385  END IF
386  END IF
387 
388  ! clean up
389  CALL hartree_local_release(hartree_local)
390 
391  ELSE
392 
393  NULLIFY (local_rho_set, local_rho_set_admm)
394 
395  END IF
396 
397  CALL timestop(handle)
398 
399  END SUBROUTINE ks_ref_potential_atom
400 
401 ! **************************************************************************************************
402 
403 END 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
Definition: pw_env_types.F:14
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
Definition: pw_env_types.F:113
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 ...
Definition: pw_pool_types.F:24
Calculation of the energies concerning 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 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 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_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, 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, rhs)
Get the QUICKSTEP environment.
subroutine, public prepare_gapw_den(qs_env, local_rho_set, do_rho0, kind_set_external)
...
Define the quickstep kind type and their sub types.
Definition: qs_kind_types.F:23
routines that build the Kohn-Sham matrix (i.e calculate the coulomb and xc parts
Definition: qs_ks_methods.F:22
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(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspace, ehartree, exc, h_stress)
calculate the Kohn-Sham reference potential
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 local_rho_set_create(local_rho_set)
...
Define the neighbor list data types and the corresponding functionality.
subroutine, public integrate_vhg0_rspace(qs_env, v_rspace, para_env, calculate_forces, local_rho_set, local_rho_set_2nd, atener, kforce)
...
subroutine, public rho0_s_grid_create(pw_env, rho0_mpole)
...
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...
Definition: qs_rho_types.F:18
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...
Definition: qs_rho_types.F:229
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, gradient_atom_set, adiabatic_rescale_factor, kind_set_external, rho_atom_set_external, xc_section_external)
...
Definition: qs_vxc_atom.F:87
Definition: qs_vxc.F:16
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)
calculates and allocates the xc potential, already reducing it to the dependence on rho and the one o...
Definition: qs_vxc.F:98