(git:bb35279)
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-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
12 USE cp_dbcsr_api, ONLY: dbcsr_p_type
15 USE cp_fm_types, ONLY: cp_fm_create,&
23 USE cp_output_handling, ONLY: cp_p_file,&
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, SIZE(evects, 1)
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=p_env%p1, 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 pforce(iwunit, gs_force, atomic_kind_set, natom)
243 CALL pforce(iwunit, td_force, atomic_kind_set, natom)
244 CALL sum_qs_force(td_force, gs_force)
245 CALL pforce(iwunit, td_force, atomic_kind_set, natom)
246 !
247 ELSE
248 IF (iwunit > 0) THEN
249 WRITE (iwunit, "(1X,A,I3,T30,F10.5,A,T50,A,T71,F10.7)") " # STATE NR. ", istate, &
250 evals(istate)*evolt, " eV", "Oscillator strength:", ostrength(istate)
251 END IF
252 END IF
253 END DO
254 CALL set_qs_env(qs_env, force=ks_force)
255 CALL deallocate_qs_force(gs_force)
256 CALL deallocate_qs_force(td_force)
257 DEALLOCATE (state_list)
258
259 ex_env%state = kstate
260 ex_env%evalue = eener
261
262 CALL cp_print_key_finished_output(iwunit, logger, force_section, "")
263
264 IF (iounit > 0) THEN
265 WRITE (iounit, "(1X,A)") &
266 "-------------------------------------------------------------------------------"
267 END IF
268
269 END IF
270
271 CALL timestop(handle)
272
273 END SUBROUTINE tddfpt_print_forces
274
275! **************************************************************************************************
276!> \brief Calculate the Quickstep forces. Adapted from qs_forces
277!> \param qs_env ...
278!> \param gs_force ...
279!> \date 11.2022
280!> \author JGH
281!> \version 1.0
282! **************************************************************************************************
283 SUBROUTINE gs_forces(qs_env, gs_force)
284
285 TYPE(qs_environment_type), POINTER :: qs_env
286 TYPE(qs_force_type), DIMENSION(:), POINTER :: gs_force
287
288 CHARACTER(len=*), PARAMETER :: routinen = 'gs_forces'
289
290 INTEGER :: handle
291 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_w_b, matrix_w_kp
292 TYPE(dft_control_type), POINTER :: dft_control
293 TYPE(lri_environment_type), POINTER :: lri_env
294 TYPE(mp_para_env_type), POINTER :: para_env
295 TYPE(qs_force_type), DIMENSION(:), POINTER :: force
296 TYPE(qs_ks_env_type), POINTER :: ks_env
297
298 CALL timeset(routinen, handle)
299
300 ! Swap froce arrays
301 CALL get_qs_env(qs_env, force=force)
302 CALL zero_qs_force(gs_force)
303 CALL set_qs_env(qs_env, force=gs_force)
304
305 ! Check for incompatible options
306 CALL get_qs_env(qs_env, dft_control=dft_control)
307 cpassert(.NOT. dft_control%qs_control%cdft)
308 cpassert(.NOT. qs_env%run_rtp)
309 cpassert(.NOT. dft_control%qs_control%mulliken_restraint)
310 cpassert(.NOT. dft_control%dft_plus_u)
311 cpassert(.NOT. qs_env%energy_correction)
312 IF (ASSOCIATED(qs_env%mp2_env)) THEN
313 cpabort("TDDFPT| MP2 not available")
314 END IF
315
316 ! Save current W matrix
317 CALL get_qs_env(qs_env=qs_env, matrix_w_kp=matrix_w_b)
318 NULLIFY (matrix_w_kp)
319 CALL get_qs_env(qs_env=qs_env, ks_env=ks_env)
320 CALL set_ks_env(ks_env, matrix_w_kp=matrix_w_kp)
321
322 ! recalculate energy with forces
323 cpassert(.NOT. dft_control%qs_control%do_ls_scf)
324 cpassert(.NOT. dft_control%qs_control%do_almo_scf)
325 CALL qs_env_rebuild_pw_env(qs_env)
326 CALL qs_energies_init(qs_env, .true.)
327 CALL scf(qs_env)
328 CALL compute_matrix_w(qs_env, .true.)
329
330 NULLIFY (para_env)
331 CALL get_qs_env(qs_env, para_env=para_env)
332 IF (dft_control%qs_control%semi_empirical) THEN
333 cpabort("TDDFPT| SE not available")
334 ELSEIF (dft_control%qs_control%dftb) THEN
335 cpabort("TDDFPT| DFTB not available")
336 ELSEIF (dft_control%qs_control%xtb) THEN
337 CALL build_xtb_matrices(qs_env=qs_env, calculate_forces=.true.)
338 CALL build_xtb_ks_matrix(qs_env, calculate_forces=.true., just_energy=.false.)
339 ELSE
340 CALL build_core_hamiltonian_matrix(qs_env=qs_env, calculate_forces=.true.)
341 CALL calculate_ecore_self(qs_env)
342 CALL calculate_ecore_overlap(qs_env, para_env, calculate_forces=.true.)
343 CALL calculate_ecore_efield(qs_env, calculate_forces=.true.)
344 CALL external_e_potential(qs_env)
345 IF (.NOT. dft_control%qs_control%gapw) THEN
346 CALL external_c_potential(qs_env, calculate_forces=.true.)
347 END IF
348 IF (dft_control%qs_control%rigpw) THEN
349 CALL get_qs_env(qs_env=qs_env, lri_env=lri_env)
350 CALL build_ri_matrices(lri_env, qs_env, calculate_forces=.true.)
351 END IF
352 CALL qs_ks_build_kohn_sham_matrix(qs_env, calculate_forces=.true., just_energy=.false.)
353 END IF
354
355 ! replicate forces (get current pointer)
356 NULLIFY (gs_force)
357 CALL get_qs_env(qs_env=qs_env, force=gs_force)
358 CALL replicate_qs_force(gs_force, para_env)
359 ! Swap back force array
360 CALL set_qs_env(qs_env=qs_env, force=force)
361
362 ! deallocate W Matrix and bring back saved one
363 CALL get_qs_env(qs_env=qs_env, matrix_w_kp=matrix_w_kp)
364 CALL dbcsr_deallocate_matrix_set(matrix_w_kp)
365 NULLIFY (matrix_w_kp)
366 CALL get_qs_env(qs_env=qs_env, ks_env=ks_env)
367 CALL set_ks_env(ks_env, matrix_w_kp=matrix_w_b)
368
369 CALL timestop(handle)
370
371 END SUBROUTINE gs_forces
372
373! **************************************************************************************************
374!> \brief building a state list
375!> \param section input section
376!> \param state_list ...
377! **************************************************************************************************
378 SUBROUTINE build_state_list(section, state_list)
379
380 TYPE(section_vals_type), POINTER :: section
381 INTEGER, DIMENSION(:), INTENT(OUT) :: state_list
382
383 INTEGER :: i, is, k, n_rep, nstate
384 INTEGER, DIMENSION(:), POINTER :: indexes
385 LOGICAL :: explicit
386
387 nstate = SIZE(state_list)
388
389 CALL section_vals_val_get(section, "LIST", explicit=explicit, n_rep_val=n_rep)
390 IF (explicit) THEN
391 state_list = 0
392 DO i = 1, n_rep
393 CALL section_vals_val_get(section, "LIST", i_rep_val=i, i_vals=indexes)
394 DO is = 1, SIZE(indexes)
395 k = indexes(is)
396 IF (k <= 0 .OR. k > nstate) THEN
397 CALL cp_warn(__location__, "State List contains invalid state.")
398 cpabort("TDDFPT Print Forces: Invalid State")
399 END IF
400 state_list(k) = 1
401 END DO
402 END DO
403 ELSE
404 state_list = 1
405 END IF
406
407 END SUBROUTINE build_state_list
408
409! **************************************************************************************************
410!> \brief ...
411!> \param iwunit ...
412!> \param td_force ...
413!> \param atomic_kind_set ...
414!> \param natom ...
415! **************************************************************************************************
416 SUBROUTINE pforce(iwunit, td_force, atomic_kind_set, natom)
417 INTEGER, INTENT(IN) :: iwunit
418 TYPE(qs_force_type), DIMENSION(:), POINTER :: td_force
419 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
420 INTEGER, INTENT(IN) :: natom
421
422 INTEGER :: iatom
423 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: force
424
425 ALLOCATE (force(3, natom))
426 CALL total_qs_force(force, td_force, atomic_kind_set)
427
428 IF (iwunit > 0) THEN
429 WRITE (iwunit, *) natom
430 WRITE (iwunit, *)
431 DO iatom = 1, natom
432 WRITE (iwunit, "(3F24.14)") - force(1:3, iatom)
433 END DO
434 END IF
435 DEALLOCATE (force)
436
437 END SUBROUTINE pforce
438
439END 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 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.
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, rhoz_cneo_set, 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, harris_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, eeq, rhs, do_rixs, tb_tblite)
Set 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_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, 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 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:203
subroutine, public tddfpt_forces_main(qs_env, gs_mos, ex_env, kernel_env, sub_env, work_matrices)
Perform TDDFPT gradient calculation. This routine calculates the response vector R of Eq....
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 KS matrix in xTB Reference: Stefan Grimme, Christoph Bannwarth, Philip Shushkov JCTC 1...
subroutine, public build_xtb_ks_matrix(qs_env, calculate_forces, just_energy, ext_ks_matrix)
...
Calculation of Overlap and Hamiltonian matrices in xTB Reference: Stefan Grimme, Christoph Bannwarth,...
subroutine, public build_xtb_matrices(qs_env, calculate_forces)
...
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.