(git:3f0d10b)
Loading...
Searching...
No Matches
rt_propagation_forces.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Routines needed for EMD
10!> \author Florian Schiffmann (02.09)
11! **************************************************************************************************
12
14 USE admm_types, ONLY: admm_type,&
20 USE cp_dbcsr_api, ONLY: &
24 dbcsr_p_type, dbcsr_release, dbcsr_type, dbcsr_type_no_symmetry
29 USE cp_fm_types, ONLY: cp_fm_create,&
32 USE kinds, ONLY: dp
33 USE mathconstants, ONLY: one,&
34 zero
39 USE qs_force_types, ONLY: add_qs_force,&
44 USE qs_rho_types, ONLY: qs_rho_get,&
46 USE rt_propagation_types, ONLY: get_rtp,&
48#include "./base/base_uses.f90"
49
50 IMPLICIT NONE
51 PRIVATE
52
53 PUBLIC :: calc_c_mat_force, &
55
56 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'rt_propagation_forces'
57
58CONTAINS
59
60! **************************************************************************************************
61!> \brief calculates the three additional force contributions needed in EMD
62!> P_imag*C , P_imag*B*S^-1*S_der , P*S^-1*H*S_der
63!> \param qs_env ...
64!> \par History
65!> 02.2014 switched to dbcsr matrices [Samuel Andermatt]
66!> 10.2023 merge MO-based and all-atom into one routine [Guillaume Le Breton]
67!> \author Florian Schiffmann (02.09)
68! **************************************************************************************************
69
70 SUBROUTINE calc_c_mat_force(qs_env)
71 TYPE(qs_environment_type), POINTER :: qs_env
72
73 CHARACTER(LEN=*), PARAMETER :: routinen = 'calc_c_mat_force'
74 REAL(kind=dp), PARAMETER :: one = 1.0_dp, zero = 0.0_dp
75
76 INTEGER :: handle, i, im, ispin, re
77 INTEGER, ALLOCATABLE, DIMENSION(:) :: atom_of_kind, kind_of
78 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
79 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: c_mat, rho_ao, rho_ao_im, rho_new, &
80 s_der, sinvb, sinvh, sinvh_imag
81 TYPE(dbcsr_type), POINTER :: s_inv, tmp
82 TYPE(dft_control_type), POINTER :: dft_control
83 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
84 TYPE(qs_force_type), DIMENSION(:), POINTER :: force
85 TYPE(qs_rho_type), POINTER :: rho
86 TYPE(rt_prop_type), POINTER :: rtp
87 TYPE(rtp_control_type), POINTER :: rtp_control
88
89 CALL timeset(routinen, handle)
90 NULLIFY (rtp, particle_set, atomic_kind_set, dft_control)
91
92 CALL get_qs_env(qs_env, &
93 rtp=rtp, &
94 rho=rho, &
95 particle_set=particle_set, &
96 atomic_kind_set=atomic_kind_set, &
97 force=force, &
98 dft_control=dft_control)
99
100 rtp_control => dft_control%rtp_control
101 CALL get_rtp(rtp=rtp, c_mat=c_mat, s_der=s_der, s_inv=s_inv, &
102 sinvh=sinvh, sinvb=sinvb)
103
104 CALL get_atomic_kind_set(atomic_kind_set=atomic_kind_set, atom_of_kind=atom_of_kind, kind_of=kind_of)
105
106 NULLIFY (tmp)
107 ALLOCATE (tmp)
108 CALL dbcsr_create(tmp, template=sinvb(1)%matrix)
109
110 IF (rtp%linear_scaling) THEN
111 CALL get_rtp(rtp=rtp, rho_new=rho_new)
112 ELSE
113 CALL qs_rho_get(rho_struct=rho, rho_ao=rho_ao, rho_ao_im=rho_ao_im)
114 END IF
115
116 ! If SinvH has an imaginary part (the minus sign is already in SinvH_imag)
117 IF (rtp%propagate_complex_ks) CALL get_rtp(rtp=rtp, sinvh_imag=sinvh_imag)
118
119 DO ispin = 1, SIZE(sinvh)
120 re = 2*ispin - 1
121 im = 2*ispin
122 IF (rtp%linear_scaling) THEN
123 CALL dbcsr_multiply("N", "N", one, sinvh(ispin)%matrix, rho_new(re)%matrix, zero, tmp, &
124 filter_eps=rtp%filter_eps)
125 IF (rtp%propagate_complex_ks) THEN
126 CALL dbcsr_multiply("N", "N", one, sinvh_imag(ispin)%matrix, rho_new(im)%matrix, one, tmp, &
127 filter_eps=rtp%filter_eps)
128 END IF
129 CALL dbcsr_multiply("N", "N", one, sinvb(ispin)%matrix, rho_new(im)%matrix, one, tmp, &
130 filter_eps=rtp%filter_eps)
131 CALL compute_forces(force, tmp, s_der, rho_new(im)%matrix, c_mat, kind_of, atom_of_kind)
132 ELSE
133 CALL dbcsr_multiply("N", "N", one, sinvh(ispin)%matrix, rho_ao(ispin)%matrix, zero, tmp)
134 IF (rtp%propagate_complex_ks) THEN
135 CALL dbcsr_multiply("N", "N", one, sinvh_imag(ispin)%matrix, rho_ao_im(ispin)%matrix, one, tmp)
136 END IF
137 CALL dbcsr_multiply("N", "N", one, sinvb(ispin)%matrix, rho_ao_im(ispin)%matrix, one, tmp)
138 CALL compute_forces(force, tmp, s_der, rho_ao_im(ispin)%matrix, c_mat, kind_of, atom_of_kind)
139 END IF
140 END DO
141
142 ! recall QS forces, at this point have the other sign.
143 DO i = 1, SIZE(force)
144 force(i)%ehrenfest(:, :) = -force(i)%ehrenfest(:, :)
145 END DO
146
148
149 CALL timestop(handle)
150
151 END SUBROUTINE calc_c_mat_force
152
153! **************************************************************************************************
154!> \brief ...
155!> \param force ...
156!> \param tmp ...
157!> \param S_der ...
158!> \param rho_im ...
159!> \param C_mat ...
160!> \param kind_of ...
161!> \param atom_of_kind ...
162! **************************************************************************************************
163 SUBROUTINE compute_forces(force, tmp, S_der, rho_im, C_mat, kind_of, atom_of_kind)
164 TYPE(qs_force_type), DIMENSION(:), POINTER :: force
165 TYPE(dbcsr_type), POINTER :: tmp
166 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: s_der
167 TYPE(dbcsr_type), POINTER :: rho_im
168 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: c_mat
169 INTEGER, ALLOCATABLE, DIMENSION(:) :: kind_of, atom_of_kind
170
171 INTEGER :: col_atom, i, ikind, kind_atom, row_atom
172 LOGICAL :: found, triangle
173 REAL(dp), DIMENSION(:, :), POINTER :: block_values, block_values2
174 TYPE(dbcsr_iterator_type) :: iter
175 TYPE(dbcsr_type) :: rho_im_full
176
177 ! A block of a (anti)symmetric matrix need not be on the process that holds the same
178 ! block of the non-symmetric C_mat, so the stored triangle is taken from a full copy
179 triangle = dbcsr_get_matrix_type(rho_im) /= dbcsr_type_no_symmetry
180 CALL dbcsr_create(rho_im_full, template=c_mat(1)%matrix, matrix_type=dbcsr_type_no_symmetry)
181 CALL dbcsr_desymmetrize(rho_im, rho_im_full)
182
183 DO i = 1, 3
184 !Calculate the sum over the hadmard product
185 !S_der part
186
187 CALL dbcsr_iterator_start(iter, tmp)
188 DO WHILE (dbcsr_iterator_blocks_left(iter))
189 CALL dbcsr_iterator_next_block(iter, row_atom, col_atom, block_values)
190 CALL dbcsr_get_block_p(s_der(i)%matrix, row_atom, col_atom, block_values2, found=found)
191 IF (found) THEN
192 ikind = kind_of(col_atom)
193 kind_atom = atom_of_kind(col_atom)
194 !The block_values are in a vector format,
195 ! so the dot_product is the sum over all elements of the hamand product, that I need
196 force(ikind)%ehrenfest(i, kind_atom) = force(ikind)%ehrenfest(i, kind_atom) + &
197 2.0_dp*sum(block_values*block_values2)
198 END IF
199 END DO
200 CALL dbcsr_iterator_stop(iter)
201
202 !C_mat part
203
204 CALL dbcsr_iterator_start(iter, rho_im_full)
205 DO WHILE (dbcsr_iterator_blocks_left(iter))
206 CALL dbcsr_iterator_next_block(iter, row_atom, col_atom, block_values)
207 IF (triangle .AND. row_atom > col_atom) cycle
208 CALL dbcsr_get_block_p(c_mat(i)%matrix, row_atom, col_atom, block_values2, found=found)
209 IF (found) THEN
210 ikind = kind_of(col_atom)
211 kind_atom = atom_of_kind(col_atom)
212 !The block_values are in a vector format, so the dot_product is
213 ! the sum over all elements of the hamand product, that I need
214 force(ikind)%ehrenfest(i, kind_atom) = force(ikind)%ehrenfest(i, kind_atom) + &
215 2.0_dp*sum(block_values*block_values2)
216 END IF
217 END DO
218 CALL dbcsr_iterator_stop(iter)
219 END DO
220 CALL dbcsr_release(rho_im_full)
221
222 END SUBROUTINE compute_forces
223
224! **************************************************************************************************
225!> \brief Force contribution from the dependence of the ADMM projection on the nuclear positions
226!> \param qs_env ...
227!> \par History
228!> 10.2026 use the density matrix instead of the MO coefficients
229! **************************************************************************************************
230 SUBROUTINE rt_admm_force(qs_env)
231 TYPE(qs_environment_type), POINTER :: qs_env
232
233 TYPE(admm_type), POINTER :: admm_env
234 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: ks_aux_im, ks_aux_re, matrix_s_aux_fit, &
235 matrix_s_aux_fit_vs_orb
236 TYPE(rt_prop_type), POINTER :: rtp
237
238 CALL get_qs_env(qs_env, &
239 admm_env=admm_env, &
240 rtp=rtp)
241 CALL get_admm_env(admm_env, matrix_ks_aux_fit=ks_aux_re, &
242 matrix_ks_aux_fit_im=ks_aux_im, &
243 matrix_s_aux_fit=matrix_s_aux_fit, &
244 matrix_s_aux_fit_vs_orb=matrix_s_aux_fit_vs_orb)
245
246 ! currently only none option
247 CALL rt_admm_forces_none(qs_env, admm_env, rtp, ks_aux_re, ks_aux_im, &
248 matrix_s_aux_fit, matrix_s_aux_fit_vs_orb)
249
250 END SUBROUTINE rt_admm_force
251
252! **************************************************************************************************
253!> \brief ADMM projection force without purification.
254!> With P~ = A*P*A^T and A = S~^-1*Q, the weighted matrices are
255!> W_Q = -2*S~^-1*Re(K~*A*P) and W_S = -W_Q*A^T.
256!> The complex density matrix P is used instead of the MO coefficients, so that
257!> P is consistent with the auxiliary KS matrix K~ and includes the occupations.
258!> \param qs_env ...
259!> \param admm_env ...
260!> \param rtp ...
261!> \param KS_aux_re ...
262!> \param KS_aux_im ...
263!> \param matrix_s_aux_fit ...
264!> \param matrix_s_aux_fit_vs_orb ...
265! **************************************************************************************************
266 SUBROUTINE rt_admm_forces_none(qs_env, admm_env, rtp, KS_aux_re, KS_aux_im, matrix_s_aux_fit, &
267 matrix_s_aux_fit_vs_orb)
268 TYPE(qs_environment_type), POINTER :: qs_env
269 TYPE(admm_type), POINTER :: admm_env
270 TYPE(rt_prop_type), POINTER :: rtp
271 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: ks_aux_re, ks_aux_im, matrix_s_aux_fit, &
272 matrix_s_aux_fit_vs_orb
273
274 INTEGER :: ispin, nao, natom, naux
275 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: admm_force
276 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
277 TYPE(cp_fm_type) :: tmp_aux_aux, tmp_aux_kap, tmp_aux_nao, &
278 tmp_nao_nao
279 TYPE(cp_fm_type), DIMENSION(2) :: tmp_aux_ap
280 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao, rho_ao_im, rho_new
281 TYPE(dbcsr_type), POINTER :: matrix_w_q, matrix_w_s, rho_im, rho_re
282 TYPE(neighbor_list_set_p_type), DIMENSION(:), &
283 POINTER :: sab_aux_fit_asymm, sab_aux_fit_vs_orb
284 TYPE(qs_force_type), DIMENSION(:), POINTER :: force
285 TYPE(qs_ks_env_type), POINTER :: ks_env
286 TYPE(qs_rho_type), POINTER :: rho
287
288 NULLIFY (sab_aux_fit_asymm, sab_aux_fit_vs_orb, ks_env, rho, rho_ao, rho_ao_im, rho_new)
289
290 CALL get_qs_env(qs_env, ks_env=ks_env, rho=rho, natom=natom, &
291 atomic_kind_set=atomic_kind_set, force=force)
292 CALL get_admm_env(admm_env, sab_aux_fit_asymm=sab_aux_fit_asymm, &
293 sab_aux_fit_vs_orb=sab_aux_fit_vs_orb)
294 IF (rtp%linear_scaling) THEN
295 CALL get_rtp(rtp=rtp, rho_new=rho_new)
296 ELSE
297 CALL qs_rho_get(rho_struct=rho, rho_ao=rho_ao, rho_ao_im=rho_ao_im)
298 END IF
299
300 naux = admm_env%nao_aux_fit; nao = admm_env%nao_orb
301
302 ALLOCATE (matrix_w_s)
303 CALL dbcsr_create(matrix_w_s, template=matrix_s_aux_fit(1)%matrix, &
304 name='W MATRIX AUX S', matrix_type=dbcsr_type_no_symmetry)
305 CALL cp_dbcsr_alloc_block_from_nbl(matrix_w_s, sab_aux_fit_asymm)
306
307 ALLOCATE (matrix_w_q)
308 CALL dbcsr_copy(matrix_w_q, matrix_s_aux_fit_vs_orb(1)%matrix, &
309 "W MATRIX AUX Q")
310
311 CALL cp_fm_create(tmp_nao_nao, admm_env%work_orb_orb%matrix_struct, name="too")
312 CALL cp_fm_create(tmp_aux_ap(1), admm_env%work_aux_orb%matrix_struct, name="tao")
313 CALL cp_fm_create(tmp_aux_ap(2), admm_env%work_aux_orb%matrix_struct, name="tao")
314 CALL cp_fm_create(tmp_aux_kap, admm_env%work_aux_orb%matrix_struct, name="tao")
315 CALL cp_fm_create(tmp_aux_nao, admm_env%work_aux_orb%matrix_struct, name="tao")
316 CALL cp_fm_create(tmp_aux_aux, admm_env%work_aux_aux%matrix_struct, name="taa")
317
318 ALLOCATE (admm_force(3, natom))
319
320 DO ispin = 1, SIZE(ks_aux_re)
321 IF (rtp%linear_scaling) THEN
322 rho_re => rho_new(2*ispin - 1)%matrix
323 rho_im => rho_new(2*ispin)%matrix
324 ELSE
325 rho_re => rho_ao(ispin)%matrix
326 rho_im => rho_ao_im(ispin)%matrix
327 END IF
328
329! First calculate A*P, real part ends on tmp_aux_ap(1), imaginary part on tmp_aux_ap(2)
330 CALL copy_dbcsr_to_fm(rho_re, tmp_nao_nao)
331 CALL parallel_gemm('N', 'N', naux, nao, nao, 1.0_dp, admm_env%A, tmp_nao_nao, 0.0_dp, tmp_aux_ap(1))
332 CALL copy_dbcsr_to_fm(rho_im, tmp_nao_nao)
333 CALL parallel_gemm('N', 'N', naux, nao, nao, 1.0_dp, admm_env%A, tmp_nao_nao, 0.0_dp, tmp_aux_ap(2))
334
335! Next step Re(K~*A*P) = K~_re*A*P_re - K~_im*A*P_im
336 CALL cp_dbcsr_sm_fm_multiply(ks_aux_re(ispin)%matrix, tmp_aux_ap(1), tmp_aux_kap, nao, 1.0_dp, 0.0_dp)
337 CALL cp_dbcsr_sm_fm_multiply(ks_aux_im(ispin)%matrix, tmp_aux_ap(2), tmp_aux_kap, nao, -1.0_dp, 1.0_dp)
338
339! Wq=-2*S~^-1*Re(K~*A*P), minus sign due to force = -dE/dR
340 CALL parallel_gemm('N', 'N', naux, nao, naux, -2.0_dp, admm_env%S_inv, tmp_aux_kap, 0.0_dp, tmp_aux_nao)
341
342! Ws=-Wq*A^T
343 CALL parallel_gemm('N', 'T', naux, naux, nao, -1.0_dp, tmp_aux_nao, admm_env%A, 0.0_dp, tmp_aux_aux)
344
345 ! *** copy to sparse matrix
346 CALL copy_fm_to_dbcsr(tmp_aux_nao, matrix_w_q, keep_sparsity=.true.)
347
348 ! *** copy to sparse matrix
349 CALL copy_fm_to_dbcsr(tmp_aux_aux, matrix_w_s, keep_sparsity=.true.)
350
351 admm_force = 0.0_dp
352 CALL build_overlap_force(ks_env, admm_force, &
353 basis_type_a="AUX_FIT", basis_type_b="AUX_FIT", &
354 sab_nl=sab_aux_fit_asymm, matrix_p=matrix_w_s)
355 CALL build_overlap_force(ks_env, admm_force, &
356 basis_type_a="AUX_FIT", basis_type_b="ORB", &
357 sab_nl=sab_aux_fit_vs_orb, matrix_p=matrix_w_q)
358 ! add forces
359 CALL add_qs_force(admm_force, force, "overlap_admm", atomic_kind_set)
360
361 END DO
362
363 DEALLOCATE (admm_force)
364
365 ! *** Deallocated weighted density matrices
366 CALL dbcsr_deallocate_matrix(matrix_w_s)
367 CALL dbcsr_deallocate_matrix(matrix_w_q)
368
369 CALL cp_fm_release(tmp_nao_nao)
370 CALL cp_fm_release(tmp_aux_ap(1))
371 CALL cp_fm_release(tmp_aux_ap(2))
372 CALL cp_fm_release(tmp_aux_kap)
373 CALL cp_fm_release(tmp_aux_nao)
374 CALL cp_fm_release(tmp_aux_aux)
375
376 END SUBROUTINE rt_admm_forces_none
377
378END MODULE rt_propagation_forces
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:599
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...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
character function, public dbcsr_get_matrix_type(matrix)
...
logical function, public dbcsr_iterator_blocks_left(iterator)
...
subroutine, public dbcsr_iterator_stop(iterator)
...
subroutine, public dbcsr_desymmetrize(matrix_a, matrix_b)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_get_block_p(matrix, row, col, block, found, row_size, col_size)
...
subroutine, public dbcsr_multiply(transa, transb, alpha, matrix_a, matrix_b, beta, matrix_c, first_row, last_row, first_column, last_column, first_k, last_k, retain_sparsity, filter_eps, flop)
...
subroutine, public dbcsr_iterator_next_block(iterator, row, column, block, block_number_argument_has_been_removed, row_size, col_size, row_offset, col_offset, transposed)
...
subroutine, public dbcsr_iterator_start(iterator, matrix, shared, dynamic, dynamic_byrows)
...
subroutine, public dbcsr_release(matrix)
...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_sm_fm_multiply(matrix, fm_in, fm_out, ncol, alpha, beta)
multiply a dbcsr with a fm matrix
subroutine, public copy_dbcsr_to_fm(matrix, fm, plan, check_plan)
Copy a DBCSR matrix to a BLACS matrix.
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
represent a full matrix distributed on many processors
Definition cp_fm_types.F:15
subroutine, public cp_fm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
creates a new full matrix with the given structure
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Definition of mathematical constants and functions.
real(kind=dp), parameter, public one
real(kind=dp), parameter, public zero
basic linear algebra operations for full matrixes
Define the data structure for the particle information.
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_vhxc, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
subroutine, public add_qs_force(force, qs_force, forcetype, atomic_kind_set)
Add force to a force_type variable.
Define the neighbor list data types and the corresponding functionality.
Calculation of overlap matrix, its derivatives and forces.
Definition qs_overlap.F:19
subroutine, public build_overlap_force(ks_env, force, basis_type_a, basis_type_b, sab_nl, matrix_p, matrixkp_p)
Calculation of the force contribution from an overlap matrix over Cartesian Gaussian functions.
Definition qs_overlap.F:825
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 needed for EMD.
subroutine, public rt_admm_force(qs_env)
Force contribution from the dependence of the ADMM projection on the nuclear positions.
subroutine, public calc_c_mat_force(qs_env)
calculates the three additional force contributions needed in EMD P_imag*C , P_imag*B*S^-1*S_der ,...
Types and set_get for real time propagation depending on runtype and diagonalization method different...
subroutine, public get_rtp(rtp, exp_h_old, exp_h_new, h_last_iter, rho_old, rho_next, rho_new, mos, mos_new, mos_old, mos_next, s_inv, s_half, s_minus_half, b_mat, c_mat, propagator_matrix, mixing, mixing_factor, s_der, dt, nsteps, sinvh, sinvh_imag, sinvb, admm_mos)
...
stores some data used in wavefunction fitting
Definition admm_types.F:120
Provides all information about an atomic kind.
represent a full matrix
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.