(git:374b731)
Loading...
Searching...
No Matches
qs_tddfpt2_fprint.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
14 USE cp_fm_types, ONLY: cp_fm_create,&
22 USE cp_output_handling, ONLY: cp_p_file,&
26 USE dbcsr_api, ONLY: dbcsr_p_type
32 USE kinds, ONLY: dp
35 USE physcon, ONLY: evolt
55 USE qs_ks_types, ONLY: qs_ks_env_type,&
58 USE qs_p_env_types, ONLY: p_env_release,&
60 USE qs_scf, ONLY: scf
71#include "./base/base_uses.f90"
72
73 IMPLICIT NONE
74
75 PRIVATE
76
77 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_tddfpt2_fprint'
78
79 PUBLIC :: tddfpt_print_forces
80
81! **************************************************************************************************
82
83CONTAINS
84
85! **************************************************************************************************
86!> \brief Calculate and print forces of selected excited states.
87!> \param qs_env Information on Kinds and Particles
88!> \param evects TDDFPT trial vectors (SIZE(evects,1) -- number of spins;
89!> SIZE(evects,2) -- number of excited states to print)
90!> \param evals TDDFPT eigenvalues
91!> \param ostrength ...
92!> \param print_section ...
93!> \param gs_mos molecular orbitals optimised for the ground state
94!> \param kernel_env ...
95!> \param sub_env ...
96!> \param work_matrices ...
97!> \par History
98!> * 10.2022 created [JGH]
99! **************************************************************************************************
100 SUBROUTINE tddfpt_print_forces(qs_env, evects, evals, ostrength, print_section, &
101 gs_mos, kernel_env, sub_env, work_matrices)
102 TYPE(qs_environment_type), POINTER :: qs_env
103 TYPE(cp_fm_type), DIMENSION(:, :), INTENT(in) :: evects
104 REAL(kind=dp), DIMENSION(:), INTENT(in) :: evals, ostrength
105 TYPE(section_vals_type), POINTER :: print_section
106 TYPE(tddfpt_ground_state_mos), DIMENSION(:), &
107 POINTER :: gs_mos
108 TYPE(kernel_env_type) :: kernel_env
109 TYPE(tddfpt_subgroup_env_type) :: sub_env
110 TYPE(tddfpt_work_matrices) :: work_matrices
111
112 CHARACTER(LEN=*), PARAMETER :: routinen = 'tddfpt_print_forces'
113 LOGICAL, PARAMETER :: debug_forces = .false.
114
115 INTEGER :: handle, iounit, is, ispin, istate, iw, &
116 iwunit, kstate, natom, nspins, nstates
117 INTEGER, ALLOCATABLE, DIMENSION(:) :: alist, natom_of_kind, state_list
118 REAL(kind=dp) :: eener, threshold
119 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
120 TYPE(cp_fm_struct_type), POINTER :: matrix_struct
121 TYPE(cp_logger_type), POINTER :: logger
122 TYPE(dft_control_type), POINTER :: dft_control
123 TYPE(excited_energy_type), POINTER :: ex_env
124 TYPE(mp_para_env_type), POINTER :: para_env
125 TYPE(qs_force_type), DIMENSION(:), POINTER :: gs_force, ks_force, td_force
126 TYPE(qs_p_env_type) :: p_env
127 TYPE(section_vals_type), POINTER :: force_section, tdlr_section
128
129 CALL timeset(routinen, handle)
130
131 logger => cp_get_default_logger()
132 iounit = cp_logger_get_default_io_unit(logger)
133
134 IF (btest(cp_print_key_should_output(logger%iter_info, print_section, &
135 "FORCES"), cp_p_file)) THEN
136
137 IF (sub_env%is_split) THEN
138 CALL cp_abort(__location__, "Excited state forces not possible when states"// &
139 " are distributed to different CPU pools.")
140 END IF
141
142 nspins = SIZE(evects, 1)
143 nstates = SIZE(evects, 2)
144 IF (iounit > 0) THEN
145 WRITE (iounit, "(1X,A)") "", &
146 "-------------------------------------------------------------------------------", &
147 "- TDDFPT PROPERTIES: Nuclear Forces -", &
148 "-------------------------------------------------------------------------------"
149 END IF
150 force_section => section_vals_get_subs_vals(print_section, "FORCES")
151 CALL section_vals_val_get(force_section, "THRESHOLD", r_val=threshold)
152 tdlr_section => section_vals_get_subs_vals(qs_env%input, "PROPERTIES%TDDFPT%LINRES")
153 ALLOCATE (state_list(nstates))
154 CALL build_state_list(force_section, state_list)
155 ! screen with oscillator strength
156 ! Warning: if oscillator strength are not calculated they are set to zero and forces are
157 ! only calculated if threshold is also 0
158 DO istate = 1, nstates
159 IF (ostrength(istate) < threshold) state_list(istate) = 0
160 END DO
161 IF (iounit > 0) THEN
162 WRITE (iounit, "(1X,A,T61,E20.8)") " Screening threshold for oscillator strength ", threshold
163 ALLOCATE (alist(nstates))
164 is = 0
165 DO istate = 1, nstates
166 IF (state_list(istate) == 1) THEN
167 is = is + 1
168 alist(is) = istate
169 END IF
170 END DO
171 WRITE (iounit, "(1X,A,T71,I10)") " List of states requested for force calculation ", is
172 WRITE (iounit, "(16I5)") alist(1:is)
173 END IF
174
175 iwunit = cp_print_key_unit_nr(logger, force_section, "", &
176 extension=".tdfrc", file_status='REPLACE')
177
178 ! prepare force array
179 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, natom=natom)
180 CALL get_atomic_kind_set(atomic_kind_set=atomic_kind_set, natom_of_kind=natom_of_kind)
181 NULLIFY (td_force, gs_force)
182 CALL allocate_qs_force(gs_force, natom_of_kind)
183 CALL allocate_qs_force(td_force, natom_of_kind)
184 ! ground state forces
185 CALL gs_forces(qs_env, gs_force)
186 ! Swap force arrays
187 CALL get_qs_env(qs_env, force=ks_force)
188 CALL set_qs_env(qs_env, force=td_force)
189
190 CALL get_qs_env(qs_env, exstate_env=ex_env, para_env=para_env)
191 kstate = ex_env%state
192 eener = ex_env%evalue
193 ! Start force loop over states
194 DO istate = 1, nstates
195 IF (state_list(istate) == 1) THEN
196 IF (iounit > 0) THEN
197 WRITE (iounit, "(1X,A,I3,T30,F10.5,A,T50,A,T71,F10.7)") " STATE NR. ", istate, &
198 evals(istate)*evolt, " eV", "Oscillator strength:", ostrength(istate)
199 END IF
200 IF (iwunit > 0) THEN
201 WRITE (iwunit, "(1X,A,I3,T30,F10.5,A,T50,A,T71,F10.7)") " # STATE NR. ", istate, &
202 evals(istate)*evolt, " eV", "Oscillator strength:", ostrength(istate)
203 END IF
204 ex_env%state = istate
205 ex_env%evalue = evals(istate)
206 CALL cp_fm_release(ex_env%evect)
207 ALLOCATE (ex_env%evect(nspins))
208 DO ispin = 1, nspins
209 CALL cp_fm_get_info(matrix=evects(ispin, 1), matrix_struct=matrix_struct)
210 CALL cp_fm_create(ex_env%evect(ispin), matrix_struct)
211 CALL cp_fm_to_fm(evects(ispin, istate), ex_env%evect(ispin))
212 END DO
213 ! force array
214 CALL zero_qs_force(td_force)
215 !
216 CALL tddfpt_forces_main(qs_env, gs_mos, ex_env, kernel_env, sub_env, work_matrices)
217 !
218 IF (debug_forces) THEN
219 iw = iounit
220 ELSE
221 iw = -1
222 END IF
223 CALL response_equation(qs_env, p_env, ex_env%cpmos, iw, tdlr_section)
224 !
225 CALL get_qs_env(qs_env, dft_control=dft_control)
226 IF (dft_control%qs_control%semi_empirical) THEN
227 cpabort("Not available")
228 ELSEIF (dft_control%qs_control%dftb) THEN
229 cpabort("Not available")
230 ELSEIF (dft_control%qs_control%xtb) THEN
231 CALL response_force_xtb(qs_env, p_env, ex_env%matrix_hz, ex_env, debug=debug_forces)
232 ELSE
233 CALL response_force(qs_env=qs_env, vh_rspace=ex_env%vh_rspace, &
234 vxc_rspace=ex_env%vxc_rspace, vtau_rspace=ex_env%vtau_rspace, &
235 vadmm_rspace=ex_env%vadmm_rspace, matrix_hz=ex_env%matrix_hz, &
236 matrix_pz=ex_env%matrix_px1, matrix_pz_admm=p_env%p1_admm, &
237 matrix_wz=p_env%w1, p_env=p_env, ex_env=ex_env, debug=debug_forces)
238 END IF
239 CALL p_env_release(p_env)
240 !
241 CALL replicate_qs_force(td_force, para_env)
242 CALL sum_qs_force(td_force, gs_force)
243 CALL pforce(iwunit, td_force, atomic_kind_set, natom)
244 !
245 ELSE
246 IF (iwunit > 0) THEN
247 WRITE (iwunit, "(1X,A,I3,T30,F10.5,A,T50,A,T71,F10.7)") " # STATE NR. ", istate, &
248 evals(istate)*evolt, " eV", "Oscillator strength:", ostrength(istate)
249 END IF
250 END IF
251 END DO
252 CALL set_qs_env(qs_env, force=ks_force)
253 CALL deallocate_qs_force(gs_force)
254 CALL deallocate_qs_force(td_force)
255 DEALLOCATE (state_list)
256
257 ex_env%state = kstate
258 ex_env%evalue = eener
259
260 CALL cp_print_key_finished_output(iwunit, logger, force_section, "")
261
262 IF (iounit > 0) THEN
263 WRITE (iounit, "(1X,A)") &
264 "-------------------------------------------------------------------------------"
265 END IF
266
267 END IF
268
269 CALL timestop(handle)
270
271 END SUBROUTINE tddfpt_print_forces
272
273! **************************************************************************************************
274!> \brief Calculate the Quickstep forces. Adapted from qs_forces
275!> \param qs_env ...
276!> \param gs_force ...
277!> \date 11.2022
278!> \author JGH
279!> \version 1.0
280! **************************************************************************************************
281 SUBROUTINE gs_forces(qs_env, gs_force)
282
283 TYPE(qs_environment_type), POINTER :: qs_env
284 TYPE(qs_force_type), DIMENSION(:), POINTER :: gs_force
285
286 CHARACTER(len=*), PARAMETER :: routinen = 'gs_forces'
287
288 INTEGER :: handle
289 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_w_b, matrix_w_kp
290 TYPE(dft_control_type), POINTER :: dft_control
291 TYPE(lri_environment_type), POINTER :: lri_env
292 TYPE(mp_para_env_type), POINTER :: para_env
293 TYPE(qs_force_type), DIMENSION(:), POINTER :: force
294 TYPE(qs_ks_env_type), POINTER :: ks_env
295
296 CALL timeset(routinen, handle)
297
298 ! Swap froce arrays
299 CALL get_qs_env(qs_env, force=force)
300 CALL zero_qs_force(gs_force)
301 CALL set_qs_env(qs_env, force=gs_force)
302
303 ! Check for incompatible options
304 CALL get_qs_env(qs_env, dft_control=dft_control)
305 cpassert(.NOT. dft_control%qs_control%cdft)
306 cpassert(.NOT. qs_env%run_rtp)
307 cpassert(.NOT. dft_control%qs_control%mulliken_restraint)
308 cpassert(.NOT. dft_control%dft_plus_u)
309 cpassert(.NOT. qs_env%energy_correction)
310 IF (ASSOCIATED(qs_env%mp2_env)) THEN
311 cpabort("TDDFPT| MP2 not available")
312 END IF
313
314 ! Save current W matrix
315 CALL get_qs_env(qs_env=qs_env, matrix_w_kp=matrix_w_b)
316 NULLIFY (matrix_w_kp)
317 CALL get_qs_env(qs_env=qs_env, ks_env=ks_env)
318 CALL set_ks_env(ks_env, matrix_w_kp=matrix_w_kp)
319
320 ! recalculate energy with forces
321 cpassert(.NOT. dft_control%qs_control%do_ls_scf)
322 cpassert(.NOT. dft_control%qs_control%do_almo_scf)
323 CALL qs_env_rebuild_pw_env(qs_env)
324 CALL qs_energies_init(qs_env, .true.)
325 CALL scf(qs_env)
326 CALL qs_energies_compute_matrix_w(qs_env, .true.)
327
328 NULLIFY (para_env)
329 CALL get_qs_env(qs_env, para_env=para_env)
330 IF (dft_control%qs_control%semi_empirical) THEN
331 cpabort("TDDFPT| SE not available")
332 ELSEIF (dft_control%qs_control%dftb) THEN
333 cpabort("TDDFPT| DFTB not available")
334 ELSEIF (dft_control%qs_control%xtb) THEN
335 CALL build_xtb_matrices(qs_env=qs_env, para_env=para_env, &
336 calculate_forces=.true.)
337 CALL build_xtb_ks_matrix(qs_env, calculate_forces=.true., just_energy=.false.)
338 ELSE
339 CALL build_core_hamiltonian_matrix(qs_env=qs_env, calculate_forces=.true.)
340 CALL calculate_ecore_self(qs_env)
341 CALL calculate_ecore_overlap(qs_env, para_env, calculate_forces=.true.)
342 CALL calculate_ecore_efield(qs_env, calculate_forces=.true.)
343 CALL external_e_potential(qs_env)
344 IF (.NOT. dft_control%qs_control%gapw) THEN
345 CALL external_c_potential(qs_env, calculate_forces=.true.)
346 END IF
347 IF (dft_control%qs_control%rigpw) THEN
348 CALL get_qs_env(qs_env=qs_env, lri_env=lri_env)
349 CALL build_ri_matrices(lri_env, qs_env, calculate_forces=.true.)
350 END IF
351 CALL qs_ks_build_kohn_sham_matrix(qs_env, calculate_forces=.true., just_energy=.false.)
352 END IF
353
354 ! replicate forces (get current pointer)
355 NULLIFY (gs_force)
356 CALL get_qs_env(qs_env=qs_env, force=gs_force)
357 CALL replicate_qs_force(gs_force, para_env)
358 ! Swap back force array
359 CALL set_qs_env(qs_env=qs_env, force=force)
360
361 ! deallocate W Matrix and bring back saved one
362 CALL get_qs_env(qs_env=qs_env, matrix_w_kp=matrix_w_kp)
363 CALL dbcsr_deallocate_matrix_set(matrix_w_kp)
364 NULLIFY (matrix_w_kp)
365 CALL get_qs_env(qs_env=qs_env, ks_env=ks_env)
366 CALL set_ks_env(ks_env, matrix_w_kp=matrix_w_b)
367
368 CALL timestop(handle)
369
370 END SUBROUTINE gs_forces
371
372! **************************************************************************************************
373!> \brief building a state list
374!> \param section input section
375!> \param state_list ...
376! **************************************************************************************************
377 SUBROUTINE build_state_list(section, state_list)
378
379 TYPE(section_vals_type), POINTER :: section
380 INTEGER, DIMENSION(:), INTENT(OUT) :: state_list
381
382 INTEGER :: i, is, k, n_rep, nstate
383 INTEGER, DIMENSION(:), POINTER :: indexes
384 LOGICAL :: explicit
385
386 nstate = SIZE(state_list)
387
388 CALL section_vals_val_get(section, "LIST", explicit=explicit, n_rep_val=n_rep)
389 IF (explicit) THEN
390 state_list = 0
391 DO i = 1, n_rep
392 CALL section_vals_val_get(section, "LIST", i_rep_val=i, i_vals=indexes)
393 DO is = 1, SIZE(indexes)
394 k = indexes(is)
395 IF (k <= 0 .OR. k > nstate) THEN
396 CALL cp_warn(__location__, "State List contains invalid state.")
397 cpabort("TDDFPT Print Forces: Invalid State")
398 END IF
399 state_list(k) = 1
400 END DO
401 END DO
402 ELSE
403 state_list = 1
404 END IF
405
406 END SUBROUTINE build_state_list
407
408! **************************************************************************************************
409!> \brief ...
410!> \param iwunit ...
411!> \param td_force ...
412!> \param atomic_kind_set ...
413!> \param natom ...
414! **************************************************************************************************
415 SUBROUTINE pforce(iwunit, td_force, atomic_kind_set, natom)
416 INTEGER, INTENT(IN) :: iwunit
417 TYPE(qs_force_type), DIMENSION(:), POINTER :: td_force
418 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
419 INTEGER, INTENT(IN) :: natom
420
421 INTEGER :: iatom
422 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: force
423
424 ALLOCATE (force(3, natom))
425 CALL total_qs_force(force, td_force, atomic_kind_set)
426
427 IF (iwunit > 0) THEN
428 WRITE (iwunit, *) natom
429 WRITE (iwunit, *)
430 DO iatom = 1, natom
431 WRITE (iwunit, "(3F24.14)") - force(1:3, iatom)
432 END DO
433 END IF
434 DEALLOCATE (force)
435
436 END SUBROUTINE pforce
437
438END MODULE qs_tddfpt2_fprint
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
DBCSR operations in CP2K.
represent the structure of a full matrix
represent a full matrix distributed on many processors
Definition cp_fm_types.F:15
subroutine, public cp_fm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
all routins needed for a nonperiodic electric field
subroutine, public calculate_ecore_efield(qs_env, calculate_forces)
Computes the force and the energy due to a efield on the cores Note: In the velocity gauge,...
Types for excited states potential energies.
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_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
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...
Interface to the message passing library MPI.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public evolt
Definition physcon.F:183
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.
Calculation of the core Hamiltonian integral matrix <a|H|b> over Cartesian Gaussian-type functions.
subroutine, public build_core_hamiltonian_matrix(qs_env, calculate_forces)
Cosntruction of the QS Core Hamiltonian Matrix.
Utility subroutine for qs energy calculation.
subroutine, public qs_energies_init(qs_env, calc_forces)
Refactoring of qs_energies_scf. Driver routine for the initial setup and calculations for a qs energy...
qs_environment methods that use many other modules
subroutine, public qs_env_rebuild_pw_env(qs_env)
rebuilds the pw_env in the given qs_env, allocating it if necessary
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, ewald_env, ewald_pw, mpools, rho_external, external_vxc, mask, scf_control, rel_control, qs_charges, ks_env, ks_qmmm_env, wf_history, scf_env, active_space, input, oce, rho_atom_set, rho0_atom_set, rho0_mpole, run_rtp, rtp, rhoz_set, rhoz_tot, ecoul_1c, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, efield, linres_control, xas_env, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, ls_scf_env, do_transport, transport_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, gcp_env, mp2_env, bs_env, kg_env, force, kpoints, wanniercentres, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, rhs)
Set the QUICKSTEP environment.
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.
Routines to handle an external electrostatic field The external field can be generic and is provided ...
subroutine, public external_c_potential(qs_env, calculate_forces)
Computes the force and the energy due to the external potential on the cores.
subroutine, public external_e_potential(qs_env)
Computes the external potential on the grid.
subroutine, public sum_qs_force(qs_force_out, qs_force_in)
Sum up two qs_force entities qs_force_out = qs_force_out + qs_force_in.
subroutine, public replicate_qs_force(qs_force, para_env)
Replicate and sum up the force.
subroutine, public deallocate_qs_force(qs_force)
Deallocate a Quickstep force data structure.
subroutine, public zero_qs_force(qs_force)
Initialize a Quickstep force data structure.
subroutine, public allocate_qs_force(qs_force, natom_of_kind)
Allocate a Quickstep force data structure.
subroutine, public total_qs_force(force, qs_force, atomic_kind_set)
Get current total force.
routines that build the Kohn-Sham matrix (i.e calculate the coulomb and xc parts
subroutine, public qs_ks_build_kohn_sham_matrix(qs_env, calculate_forces, just_energy, print_active, ext_ks_matrix)
routine where the real calculations are made: the KS matrix is calculated
subroutine, public set_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, complex_ks, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_ks_im_kp, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, kpoints, sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, task_list, task_list_soft, subsys, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env)
...
Utility subroutine for qs energy calculation.
Definition qs_matrix_w.F:14
subroutine, public qs_energies_compute_matrix_w(qs_env, calc_forces)
Refactoring of qs_energies_scf. Moves computation of matrix_w into separate subroutine.
Definition qs_matrix_w.F:62
basis types for the calculation of the perturbation of density theory.
subroutine, public p_env_release(p_env)
relases the given p_env (see doc/ReferenceCounting.html)
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:201
subroutine, public tddfpt_forces_main(qs_env, gs_mos, ex_env, kernel_env, sub_env, work_matrices)
Perform TDDFPT gradient calculation.
subroutine, public tddfpt_print_forces(qs_env, evects, evals, ostrength, print_section, gs_mos, kernel_env, sub_env, work_matrices)
Calculate and print forces of selected excited states.
Calculate the CPKS equation and the resulting forces.
subroutine, public response_force_xtb(qs_env, p_env, matrix_hz, ex_env, debug)
...
subroutine, public response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspace, matrix_hz, matrix_pz, matrix_pz_admm, matrix_wz, zehartree, zexc, zexc_aux_fit, rhopz_r, p_env, ex_env, debug)
...
subroutine, public response_equation(qs_env, p_env, cpmos, iounit, lr_section)
Initializes vectors for MO-coefficient based linear response solver and calculates response density,...
Calculates integral matrices for RIGPW method.
subroutine, public build_ri_matrices(lri_env, qs_env, calculate_forces)
creates and initializes an lri_env
Calculation of Overlap and Hamiltonian matrices in xTB Reference: Stefan Grimme, Christoph Bannwarth,...
subroutine, public build_xtb_matrices(qs_env, para_env, calculate_forces)
...
subroutine, public build_xtb_ks_matrix(qs_env, calculate_forces, just_energy, ext_ks_matrix)
...
Provides all information about an atomic kind.
keeps the information about the structure of a full matrix
represent a full matrix
type of a logger, at the moment it contains just a print level starting at which level it should be l...
Contains information on the excited states energy.
stores all the informations relevant to an mpi environment
Type to hold environments for the different kernels.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
Represent a qs system that is perturbed. Can calculate the linear operator and the rhs of the system ...
Ground state molecular orbitals.
Set of temporary ("work") matrices.