(git:e966546)
Loading...
Searching...
No Matches
qs_energy_utils.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Utility subroutine for qs energy calculation
10!> \par History
11!> none
12!> \author MK (29.10.2002)
13! **************************************************************************************************
21 USE cp_dbcsr_api, ONLY: dbcsr_copy,&
33 USE kinds, ONLY: dp
35 USE mulliken, ONLY: atom_trace
37 USE pw_env_types, ONLY: pw_env_get,&
39 USE pw_methods, ONLY: pw_axpy,&
42 USE pw_types, ONLY: pw_r3d_rs_type
48 USE qs_integrate_potential, ONLY: integrate_v_core_rspace,&
49 integrate_v_rspace
51 USE qs_ks_atom, ONLY: update_ks_atom
59 USE qs_rho_types, ONLY: qs_rho_get,&
61 USE qs_scf, ONLY: scf
62 USE qs_tddfpt2_methods, ONLY: tddfpt
63 USE qs_vxc, ONLY: qs_xc_density
65 USE rixs_methods, ONLY: rixs
67 USE xas_methods, ONLY: xas
68 USE xas_tdp_methods, ONLY: xas_tdp
71#include "./base/base_uses.f90"
72
73 IMPLICIT NONE
74
75 PRIVATE
76
77! *** Global parameters ***
78
79 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_energy_utils'
80
82
83CONTAINS
84
85! **************************************************************************************************
86!> \brief Refactoring of qs_energies_scf. Moves computation of properties
87!> into separate subroutine. Calculates energy and if calc_forces then the response vector
88!> and some contributions to the force
89!> \param qs_env ...
90!> \param calc_forces ...
91!> \par History
92!> 05.2013 created [Florian Schiffmann]
93! **************************************************************************************************
94
95 SUBROUTINE qs_energies_properties(qs_env, calc_forces)
96 TYPE(qs_environment_type), POINTER :: qs_env
97 LOGICAL, INTENT(IN) :: calc_forces
98
99 CHARACTER(len=*), PARAMETER :: routinen = 'qs_energies_properties'
100
101 INTEGER :: handle, natom
102 LOGICAL :: do_et, do_et_proj, &
103 do_post_scf_bandstructure, do_tip_scan
104 REAL(kind=dp) :: ekts
105 TYPE(atprop_type), POINTER :: atprop
106 TYPE(dft_control_type), POINTER :: dft_control
107 TYPE(mp_para_env_type), POINTER :: para_env
108 TYPE(pw_env_type), POINTER :: pw_env
109 TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace
110 TYPE(qs_energy_type), POINTER :: energy
111 TYPE(section_vals_type), POINTER :: input, post_scf_bands_section, &
112 proj_section, rest_b_section, &
113 tip_scan_section
114
115 NULLIFY (atprop, energy, pw_env)
116 CALL timeset(routinen, handle)
117
118 ! atomic energies using Mulliken partition
119 CALL get_qs_env(qs_env, &
120 dft_control=dft_control, &
121 input=input, &
122 atprop=atprop, &
123 energy=energy, &
124 v_hartree_rspace=v_hartree_rspace, &
125 para_env=para_env, &
126 pw_env=pw_env)
127 IF (atprop%energy) THEN
128 CALL qs_energies_mulliken(qs_env)
129 CALL get_qs_env(qs_env, natom=natom)
130 IF (.NOT. dft_control%qs_control%semi_empirical .AND. &
131 .NOT. dft_control%qs_control%xtb .AND. &
132 .NOT. dft_control%qs_control%dftb) THEN
133 ! Nuclear charge correction
134 CALL integrate_v_core_rspace(v_hartree_rspace, qs_env)
135 IF (.NOT. ASSOCIATED(atprop%ateb)) THEN
136 CALL atprop_array_init(atprop%ateb, natom)
137 END IF
138 ! Kohn-Sham Functional corrections
139 CALL ks_xc_correction(qs_env)
140 END IF
141 CALL atprop_array_add(atprop%atener, atprop%ateb)
142 CALL atprop_array_add(atprop%atener, atprop%ateself)
143 CALL atprop_array_add(atprop%atener, atprop%atexc)
144 CALL atprop_array_add(atprop%atener, atprop%atecoul)
145 CALL atprop_array_add(atprop%atener, atprop%atevdw)
146 CALL atprop_array_add(atprop%atener, atprop%ategcp)
147 CALL atprop_array_add(atprop%atener, atprop%atecc)
148 CALL atprop_array_add(atprop%atener, atprop%ate1c)
149 ! entropic energy
150 ekts = energy%kts/real(natom, kind=dp)/real(para_env%num_pe, kind=dp)
151 atprop%atener(:) = atprop%atener(:) + ekts
152 END IF
153
154 ! ET coupling - projection-operator approach
155 NULLIFY (proj_section)
156 proj_section => &
157 section_vals_get_subs_vals(input, "PROPERTIES%ET_COUPLING%PROJECTION")
158 CALL section_vals_get(proj_section, explicit=do_et_proj)
159 IF (do_et_proj) THEN
160 CALL calc_et_coupling_proj(qs_env)
161 END IF
162
163 ! ********** Calculate the electron transfer coupling elements********
164 do_et = .false.
165 do_et = dft_control%qs_control%et_coupling_calc
166 IF (do_et) THEN
167 qs_env%et_coupling%energy = energy%total
168 qs_env%et_coupling%keep_matrix = .true.
169 qs_env%et_coupling%first_run = .true.
170 CALL qs_ks_update_qs_env(qs_env, calculate_forces=.false., just_energy=.true.)
171 qs_env%et_coupling%first_run = .false.
172 IF (dft_control%qs_control%ddapc_restraint) THEN
173 rest_b_section => section_vals_get_subs_vals(input, "PROPERTIES%ET_COUPLING%DDAPC_RESTRAINT_B")
174 CALL read_ddapc_section(qs_control=dft_control%qs_control, &
175 ddapc_restraint_section=rest_b_section)
176 END IF
177 CALL scf(qs_env=qs_env)
178 qs_env%et_coupling%keep_matrix = .true.
179
180 CALL qs_ks_update_qs_env(qs_env, calculate_forces=.false., just_energy=.true.)
181 CALL calc_et_coupling(qs_env)
182 END IF
183
184 !Properties
185
186 IF (dft_control%do_xas_calculation) THEN
187 CALL xas(qs_env, dft_control)
188 END IF
189
190 IF (dft_control%do_xas_tdp_calculation) THEN
191 CALL xas_tdp(qs_env)
192 END IF
193
194 ! Compute Linear Response properties as post-scf
195 ! Initialization of TDDFPT calculation
196 IF (.NOT. qs_env%linres_run) THEN
197 CALL linres_calculation_low(qs_env)
198 END IF
199
200 ! Calculates the energy, response vector and some contributions to the force
201 IF (dft_control%tddfpt2_control%enabled) THEN
202 CALL tddfpt(qs_env, calc_forces)
203 END IF
204
205 ! stand-alone RIXS, does not depend on previous xas_tdp and/or tddfpt2 calculations
206 IF (qs_env%do_rixs) CALL rixs(qs_env)
207
208 ! post-SCF bandstructure calculation from higher level methods
209 NULLIFY (post_scf_bands_section)
210 post_scf_bands_section => section_vals_get_subs_vals(qs_env%input, "PROPERTIES%BANDSTRUCTURE")
211 CALL section_vals_get(post_scf_bands_section, explicit=do_post_scf_bandstructure)
212 IF (do_post_scf_bandstructure) THEN
213 CALL post_scf_bandstructure(qs_env, post_scf_bands_section)
214 END IF
215
216 ! tip scan
217 NULLIFY (tip_scan_section)
218 tip_scan_section => section_vals_get_subs_vals(input, "PROPERTIES%TIP_SCAN")
219 CALL section_vals_get(tip_scan_section, explicit=do_tip_scan)
220 IF (do_tip_scan) THEN
221 CALL tip_scanning(qs_env, tip_scan_section)
222 END IF
223
224 CALL timestop(handle)
225
226 END SUBROUTINE qs_energies_properties
227
228! **************************************************************************************************
229!> \brief Use a simple Mulliken-like energy decomposition
230!> \param qs_env ...
231!> \date 07.2011
232!> \author JHU
233!> \version 1.0
234! **************************************************************************************************
235 SUBROUTINE qs_energies_mulliken(qs_env)
236
237 TYPE(qs_environment_type), POINTER :: qs_env
238
239 INTEGER :: ispin, natom, nspin
240 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: atcore
241 TYPE(atprop_type), POINTER :: atprop
242 TYPE(dbcsr_p_type), ALLOCATABLE, DIMENSION(:), &
243 TARGET :: core_mat
244 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_h, matrix_ks, rho_ao
245 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: math, matp
246 TYPE(dft_control_type), POINTER :: dft_control
247 TYPE(qs_rho_type), POINTER :: rho
248
249 CALL get_qs_env(qs_env=qs_env, atprop=atprop)
250 IF (atprop%energy) THEN
251 CALL get_qs_env(qs_env=qs_env, matrix_ks=matrix_ks, matrix_h=matrix_h, rho=rho)
252 CALL qs_rho_get(rho, rho_ao=rho_ao)
253 ! E = 0.5*Tr(H*P+F*P)
254 atprop%atener = 0._dp
255 nspin = SIZE(rho_ao)
256 DO ispin = 1, nspin
257 CALL atom_trace(matrix_h(1)%matrix, rho_ao(ispin)%matrix, &
258 0.5_dp, atprop%atener)
259 CALL atom_trace(matrix_ks(ispin)%matrix, rho_ao(ispin)%matrix, &
260 0.5_dp, atprop%atener)
261 END DO
262 !
263 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control)
264 IF (.NOT. dft_control%qs_control%semi_empirical .AND. &
265 .NOT. dft_control%qs_control%xtb .AND. &
266 .NOT. dft_control%qs_control%dftb) THEN
267 CALL get_qs_env(qs_env=qs_env, natom=natom)
268 ALLOCATE (atcore(natom))
269 atcore = 0.0_dp
270 ALLOCATE (core_mat(1))
271 ALLOCATE (core_mat(1)%matrix)
272 CALL dbcsr_create(core_mat(1)%matrix, template=matrix_h(1)%matrix)
273 CALL dbcsr_copy(core_mat(1)%matrix, matrix_h(1)%matrix)
274 CALL dbcsr_set(core_mat(1)%matrix, 0.0_dp)
275 math(1:1, 1:1) => core_mat(1:1)
276 matp(1:nspin, 1:1) => rho_ao(1:nspin)
277 CALL core_matrices(qs_env, math, matp, .false., 0, atcore=atcore)
278 atprop%atener = atprop%atener + 0.5_dp*atcore
279 DO ispin = 1, nspin
280 CALL atom_trace(core_mat(1)%matrix, rho_ao(ispin)%matrix, &
281 -0.5_dp, atprop%atener)
282 END DO
283 DEALLOCATE (atcore)
284 CALL dbcsr_release(core_mat(1)%matrix)
285 DEALLOCATE (core_mat(1)%matrix)
286 DEALLOCATE (core_mat)
287 END IF
288 END IF
289
290 END SUBROUTINE qs_energies_mulliken
291
292! **************************************************************************************************
293!> \brief ...
294!> \param qs_env ...
295! **************************************************************************************************
296 SUBROUTINE ks_xc_correction(qs_env)
297 TYPE(qs_environment_type), POINTER :: qs_env
298
299 CHARACTER(len=*), PARAMETER :: routinen = 'ks_xc_correction'
300
301 INTEGER :: handle, iatom, ispin, natom, nspins
302 LOGICAL :: gapw, gapw_xc
303 REAL(kind=dp) :: eh1, exc1
304 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
305 TYPE(atprop_type), POINTER :: atprop
306 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_s, rho_ao, xcmat
307 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_p
308 TYPE(dft_control_type), POINTER :: dft_control
309 TYPE(ecoul_1center_type), DIMENSION(:), POINTER :: ecoul_1c
310 TYPE(local_rho_type), POINTER :: local_rho_set
311 TYPE(mp_para_env_type), POINTER :: para_env
312 TYPE(pw_env_type), POINTER :: pw_env
313 TYPE(pw_pool_type), POINTER :: auxbas_pw_pool
314 TYPE(pw_r3d_rs_type) :: xc_den
315 TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: vtau, vxc
316 TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace
317 TYPE(qs_dispersion_type), POINTER :: dispersion_env
318 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
319 TYPE(qs_ks_env_type), POINTER :: ks_env
320 TYPE(qs_rho_type), POINTER :: rho_struct
321 TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho_atom_set
322 TYPE(section_vals_type), POINTER :: xc_fun_section, xc_section
323 TYPE(xc_rho_cflags_type) :: needs
324
325 CALL timeset(routinen, handle)
326
327 CALL get_qs_env(qs_env, ks_env=ks_env, dft_control=dft_control, pw_env=pw_env, atprop=atprop)
328
329 IF (atprop%energy) THEN
330
331 nspins = dft_control%nspins
332 xc_section => section_vals_get_subs_vals(qs_env%input, "DFT%XC")
333 xc_fun_section => section_vals_get_subs_vals(xc_section, "XC_FUNCTIONAL")
334 needs = xc_functionals_get_needs(xc_fun_section, (nspins == 2), .true.)
335 gapw = dft_control%qs_control%gapw
336 gapw_xc = dft_control%qs_control%gapw_xc
337
338 ! Nuclear charge correction
339 CALL get_qs_env(qs_env, v_hartree_rspace=v_hartree_rspace)
340 IF (gapw .OR. gapw_xc) THEN
341 CALL get_qs_env(qs_env=qs_env, local_rho_set=local_rho_set, &
342 rho_atom_set=rho_atom_set, ecoul_1c=ecoul_1c, &
343 natom=natom, para_env=para_env)
344 CALL zero_rho_atom_integrals(rho_atom_set)
345 CALL calculate_vxc_atom(qs_env, .false., exc1)
346 IF (gapw) THEN
347 CALL vh_1c_gg_integrals(qs_env, eh1, ecoul_1c, local_rho_set, para_env, tddft=.false.)
348 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, qs_kind_set=qs_kind_set)
349 CALL integrate_vhg0_rspace(qs_env, v_hartree_rspace, para_env, calculate_forces=.false., &
350 local_rho_set=local_rho_set, atener=atprop%ateb)
351 END IF
352 END IF
353
354 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
355 CALL auxbas_pw_pool%create_pw(xc_den)
356 ALLOCATE (vxc(nspins))
357 DO ispin = 1, nspins
358 CALL auxbas_pw_pool%create_pw(vxc(ispin))
359 END DO
360 IF (needs%tau .OR. needs%tau_spin) THEN
361 ALLOCATE (vtau(nspins))
362 DO ispin = 1, nspins
363 CALL auxbas_pw_pool%create_pw(vtau(ispin))
364 END DO
365 END IF
366
367 IF (gapw_xc) THEN
368 CALL get_qs_env(qs_env, rho_xc=rho_struct, dispersion_env=dispersion_env)
369 ELSE
370 CALL get_qs_env(qs_env, rho=rho_struct, dispersion_env=dispersion_env)
371 END IF
372 IF (needs%tau .OR. needs%tau_spin) THEN
373 CALL qs_xc_density(ks_env, rho_struct, xc_section, dispersion_env=dispersion_env, &
374 xc_den=xc_den, vxc=vxc, vtau=vtau)
375 ELSE
376 CALL qs_xc_density(ks_env, rho_struct, xc_section, dispersion_env=dispersion_env, &
377 xc_den=xc_den, vxc=vxc)
378 END IF
379 CALL get_qs_env(qs_env, rho=rho_struct)
380 CALL qs_rho_get(rho_struct, rho_ao=rho_ao)
381 CALL get_qs_env(qs_env, natom=natom, matrix_s=matrix_s)
382 CALL atprop_array_init(atprop%atexc, natom)
383 ALLOCATE (xcmat(nspins))
384 DO ispin = 1, nspins
385 ALLOCATE (xcmat(ispin)%matrix)
386 CALL dbcsr_create(xcmat(ispin)%matrix, template=matrix_s(1)%matrix)
387 CALL dbcsr_copy(xcmat(ispin)%matrix, matrix_s(1)%matrix)
388 CALL dbcsr_set(xcmat(ispin)%matrix, 0.0_dp)
389 CALL pw_scale(vxc(ispin), -0.5_dp)
390 CALL pw_axpy(xc_den, vxc(ispin))
391 CALL pw_scale(vxc(ispin), vxc(ispin)%pw_grid%dvol)
392 CALL integrate_v_rspace(qs_env=qs_env, v_rspace=vxc(ispin), hmat=xcmat(ispin), &
393 calculate_forces=.false., gapw=(gapw .OR. gapw_xc))
394 IF (needs%tau .OR. needs%tau_spin) THEN
395 CALL pw_scale(vtau(ispin), -0.5_dp*vtau(ispin)%pw_grid%dvol)
396 CALL integrate_v_rspace(qs_env=qs_env, v_rspace=vtau(ispin), &
397 hmat=xcmat(ispin), calculate_forces=.false., &
398 gapw=(gapw .OR. gapw_xc), compute_tau=.true.)
399 END IF
400 END DO
401 IF (gapw .OR. gapw_xc) THEN
402 ! remove one-center potential matrix part
403 CALL qs_rho_get(rho_struct, rho_ao_kp=matrix_p)
404 CALL update_ks_atom(qs_env, xcmat, matrix_p, forces=.false., kscale=-0.5_dp)
405 CALL get_qs_env(qs_env=qs_env, rho_atom_set=rho_atom_set)
406 CALL atprop_array_init(atprop%ate1c, natom)
407 atprop%ate1c = 0.0_dp
408 DO iatom = 1, natom
409 atprop%ate1c(iatom) = atprop%ate1c(iatom) + &
410 rho_atom_set(iatom)%exc_h - rho_atom_set(iatom)%exc_s
411 END DO
412 IF (gapw) THEN
413 CALL get_qs_env(qs_env=qs_env, ecoul_1c=ecoul_1c)
414 DO iatom = 1, natom
415 atprop%ate1c(iatom) = atprop%ate1c(iatom) + &
416 ecoul_1c(iatom)%ecoul_1_h - ecoul_1c(iatom)%ecoul_1_s + &
417 ecoul_1c(iatom)%ecoul_1_z - ecoul_1c(iatom)%ecoul_1_0
418 END DO
419 END IF
420 END IF
421 DO ispin = 1, nspins
422 CALL atom_trace(xcmat(ispin)%matrix, rho_ao(ispin)%matrix, 1.0_dp, atprop%atexc)
423 CALL dbcsr_release(xcmat(ispin)%matrix)
424 DEALLOCATE (xcmat(ispin)%matrix)
425 END DO
426 DEALLOCATE (xcmat)
427
428 CALL auxbas_pw_pool%give_back_pw(xc_den)
429 DO ispin = 1, nspins
430 CALL auxbas_pw_pool%give_back_pw(vxc(ispin))
431 END DO
432 IF (needs%tau .OR. needs%tau_spin) THEN
433 DO ispin = 1, nspins
434 CALL auxbas_pw_pool%give_back_pw(vtau(ispin))
435 END DO
436 END IF
437
438 END IF
439
440 CALL timestop(handle)
441
442 END SUBROUTINE ks_xc_correction
443
444END MODULE qs_energy_utils
Define the atomic kind types and their sub types.
Holds information on atomic properties.
subroutine, public atprop_array_add(array_a, array_b)
...
subroutine, public atprop_array_init(atarray, natom)
...
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Utilities to set up the control types.
subroutine, public read_ddapc_section(qs_control, qs_section, ddapc_restraint_section)
reads the input parameters needed for ddapc.
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
calculates the electron transfer coupling elements by projection-operator approach Kondov et al....
subroutine, public calc_et_coupling_proj(qs_env)
calculates the electron transfer coupling elements by projection-operator approach Kondov et al....
calculates the electron transfer coupling elements Wu, Van Voorhis, JCP 125, 164105 (2006)
Definition et_coupling.F:13
subroutine, public calc_et_coupling(qs_env)
...
Definition et_coupling.F:63
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...
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
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Interface to the message passing library MPI.
compute mulliken charges we (currently) define them as c_i = 1/2 [ (PS)_{ii} + (SP)_{ii} ]
Definition mulliken.F:13
subroutine, public atom_trace(amat, bmat, factor, atrace)
Compute partial trace of product of two matrices.
Definition mulliken.F:915
subroutine, public post_scf_bandstructure(qs_env, post_scf_bandstructure_section)
Perform post-SCF band structure calculations from higher level methods.
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
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Calculation of the core Hamiltonian integral matrix <a|H|b> over Cartesian Gaussian-type functions.
subroutine, public core_matrices(qs_env, matrix_h, matrix_p, calculate_forces, nder, ec_env, dcdr_env, ec_env_matrices, basis_type, debug_forces, debug_stress, atcore)
...
Definition of disperson types for DFT calculations.
Utility subroutine for qs energy calculation.
subroutine, public qs_energies_properties(qs_env, calc_forces)
Refactoring of qs_energies_scf. Moves computation of properties into separate subroutine....
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, 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, 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.
Integrate single or product functions over a potential on a RS grid.
Define the quickstep kind type and their sub types.
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
routines that build the Kohn-Sham matrix (i.e calculate the coulomb and xc parts
subroutine, public qs_ks_update_qs_env(qs_env, calculate_forces, just_energy, print_active)
updates the Kohn Sham matrix of the given qs_env (facility method)
Contains the setup for the calculation of properties by linear response by the application of second ...
subroutine, public linres_calculation_low(qs_env)
Linear response can be called as run type or as post scf calculation Initialize the perturbation envi...
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 zero_rho_atom_integrals(rho_atom_set)
...
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 for the Quickstep SCF run.
Definition qs_scf.F:47
subroutine, public scf(qs_env, has_converged, total_scf_steps)
perform an scf procedure in the given qs_env
Definition qs_scf.F:203
subroutine, public tddfpt(qs_env, calc_forces, rixs_env)
Perform TDDFPT calculation. If calc_forces then it also builds the response vector for the Z-vector m...
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:86
subroutine, public qs_xc_density(ks_env, rho_struct, xc_section, dispersion_env, xc_ener, xc_den, vxc, vtau)
calculates the XC density: E_xc(r) - V_xc(r)*rho(r) or E_xc(r)/rho(r)
Definition qs_vxc.F:573
Methods for Resonant Inelastic XRAY Scattering (RIXS) calculations.
subroutine, public rixs(qs_env)
Driver for RIXS calculations.
subroutine, public tip_scanning(qs_env, input_section)
Perform tip scanning calculation.
driver for the xas calculation and xas_scf for the tp method
Definition xas_methods.F:15
subroutine, public xas(qs_env, dft_control)
Driver for xas calculations The initial mos are prepared A loop on the atoms to be excited is started...
Methods for X-Ray absorption spectroscopy (XAS) using TDDFPT.
subroutine, public xas_tdp(qs_env, rixs_env)
Driver for XAS TDDFT calculations.
type(xc_rho_cflags_type) function, public xc_functionals_get_needs(functionals, lsd, calc_potential)
...
contains the structure
Provides all information about an atomic kind.
type for the atomic properties
stores all the informations relevant to an mpi environment
contained for different pw related things
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.
contains a flag for each component of xc_rho_set, so that you can use it to tell which components you...