(git:6ba6522)
Loading...
Searching...
No Matches
qs_force.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 Quickstep force driver routine
10!> \author MK (12.06.2002)
11! **************************************************************************************************
15 USE cell_types, ONLY: cell_type
17 USE cp_dbcsr_api, ONLY: dbcsr_copy,&
26 USE cp_output_handling, ONLY: cp_p_file,&
30 USE dft_plus_u, ONLY: plus_u
36 USE hfx_exx, ONLY: calculate_exx
37 USE input_constants, ONLY: &
45 USE kinds, ONLY: dp
56 USE qs_energy, ONLY: qs_energies
68 USE qs_ks_types, ONLY: qs_ks_env_type,&
70 USE qs_rho_types, ONLY: qs_rho_get,&
88#include "./base/base_uses.f90"
89
90 IMPLICIT NONE
91
92 PRIVATE
93
94! *** Global parameters ***
95
96 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_force'
97
98! *** Public subroutines ***
99
100 PUBLIC :: qs_calc_energy_force
101
102CONTAINS
103
104! **************************************************************************************************
105!> \brief ...
106!> \param qs_env ...
107!> \param calc_force ...
108!> \param consistent_energies ...
109!> \param linres ...
110! **************************************************************************************************
111 SUBROUTINE qs_calc_energy_force(qs_env, calc_force, consistent_energies, linres)
112 TYPE(qs_environment_type), POINTER :: qs_env
113 LOGICAL :: calc_force, consistent_energies, linres
114
115 qs_env%linres_run = linres
116 IF (calc_force) THEN
117 CALL qs_forces(qs_env)
118 ELSE
119 CALL qs_energies(qs_env, calc_forces=.false., &
120 consistent_energies=consistent_energies)
121 END IF
122
123 END SUBROUTINE qs_calc_energy_force
124
125! **************************************************************************************************
126!> \brief Calculate the Quickstep forces.
127!> \param qs_env ...
128!> \date 29.10.2002
129!> \author MK
130!> \version 1.0
131! **************************************************************************************************
132 SUBROUTINE qs_forces(qs_env)
133
134 TYPE(qs_environment_type), POINTER :: qs_env
135
136 CHARACTER(len=*), PARAMETER :: routinen = 'qs_forces'
137
138 INTEGER :: after, handle, i, iatom, ic, ikind, &
139 ispin, iw, natom, nkind, nspin, &
140 output_unit
141 INTEGER, ALLOCATABLE, DIMENSION(:) :: atom_of_kind, kind_of, natom_of_kind
142 LOGICAL :: do_admm, do_exx, do_gw, do_im_time, &
143 do_kpoints, has_unit_metric, &
144 omit_headers, perform_ec, reuse_hfx
145 REAL(dp) :: dummy_real, dummy_real2(2)
146 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
147 TYPE(cell_type), POINTER :: cell
148 TYPE(cp_logger_type), POINTER :: logger
149 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_s, matrix_w, rho_ao
150 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_w_kp
151 TYPE(dft_control_type), POINTER :: dft_control
152 TYPE(energy_correction_type), POINTER :: ec_env
153 TYPE(lri_environment_type), POINTER :: lri_env
154 TYPE(mp_para_env_type), POINTER :: para_env
155 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
156 TYPE(qs_energy_type), POINTER :: energy
157 TYPE(qs_force_type), DIMENSION(:), POINTER :: force
158 TYPE(qs_ks_env_type), POINTER :: ks_env
159 TYPE(qs_rho_type), POINTER :: rho
160 TYPE(qs_subsys_type), POINTER :: subsys
161 TYPE(section_vals_type), POINTER :: hfx_sections, print_section
162 TYPE(virial_type), POINTER :: virial
163
164 CALL timeset(routinen, handle)
165 NULLIFY (logger)
166 logger => cp_get_default_logger()
167
168 ! rebuild plane wave environment
169 CALL qs_env_rebuild_pw_env(qs_env)
170
171 ! zero out the forces in particle set
172 CALL get_qs_env(qs_env, particle_set=particle_set)
173 natom = SIZE(particle_set)
174 DO iatom = 1, natom
175 particle_set(iatom)%f = 0.0_dp
176 END DO
177
178 ! get atom mapping
179 NULLIFY (atomic_kind_set)
180 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set)
181 CALL get_atomic_kind_set(atomic_kind_set=atomic_kind_set, &
182 atom_of_kind=atom_of_kind, &
183 kind_of=kind_of)
184
185 NULLIFY (force, subsys, dft_control)
186 CALL get_qs_env(qs_env, &
187 force=force, &
188 subsys=subsys, &
189 do_kpoints=do_kpoints, &
190 dft_control=dft_control)
191 IF (do_kpoints .AND. dft_control%dft_plus_u .AND. dft_control%plus_u_method_id == plus_u_lowdin) THEN
192 IF (ASSOCIATED(qs_env%mp2_env) .OR. qs_env%run_rtp .OR. &
193 (dft_control%smeagol_control%smeagol_enabled .AND. &
194 dft_control%smeagol_control%run_type == smeagol_runtype_emtransport)) THEN
195 cpabort("Lowdin DFT+U forces with k-points require the ground-state DFT W matrix")
196 END IF
197 END IF
198 IF (.NOT. ASSOCIATED(force)) THEN
199 ! *** Allocate the force data structure ***
200 nkind = SIZE(atomic_kind_set)
201 CALL get_atomic_kind_set(atomic_kind_set=atomic_kind_set, natom_of_kind=natom_of_kind)
202 CALL allocate_qs_force(force, natom_of_kind)
203 DEALLOCATE (natom_of_kind)
204 CALL qs_subsys_set(subsys, force=force)
205 END IF
206 CALL zero_qs_force(force)
207
208 ! Check if CDFT potential is needed and save it until forces have been calculated
209 IF (dft_control%qs_control%cdft) THEN
210 dft_control%qs_control%cdft_control%save_pot = .true.
211 END IF
212
213 ! recalculate energy and the response vector for the Z-vector linear equation system if calc_force = .true.
214 CALL qs_energies(qs_env, calc_forces=.true.)
215
216 NULLIFY (para_env)
217 CALL get_qs_env(qs_env, &
218 para_env=para_env)
219
220 ! Now we handle some special cases
221 ! Maybe some of these would be better dealt with in qs_energies?
222 IF (qs_env%run_rtp) THEN
223 NULLIFY (matrix_w, matrix_s, ks_env)
224 CALL get_qs_env(qs_env, &
225 ks_env=ks_env, &
226 matrix_w=matrix_w, &
227 matrix_s=matrix_s)
228 CALL dbcsr_allocate_matrix_set(matrix_w, dft_control%nspins)
229 DO ispin = 1, dft_control%nspins
230 ALLOCATE (matrix_w(ispin)%matrix)
231 CALL dbcsr_copy(matrix_w(ispin)%matrix, matrix_s(1)%matrix, &
232 name="W MATRIX")
233 CALL dbcsr_set(matrix_w(ispin)%matrix, 0.0_dp)
234 END DO
235 CALL set_ks_env(ks_env, matrix_w=matrix_w)
236
237 CALL calc_c_mat_force(qs_env)
238 IF (dft_control%do_admm) CALL rt_admm_force(qs_env)
239 IF (dft_control%rtp_control%velocity_gauge .AND. dft_control%rtp_control%nl_gauge_transform) THEN
240 CALL velocity_gauge_nl_force(qs_env, particle_set)
241 END IF
242 END IF
243 ! from an eventual Mulliken restraint
244 IF (dft_control%qs_control%mulliken_restraint) THEN
245 NULLIFY (matrix_w, matrix_s, rho)
246 CALL get_qs_env(qs_env, &
247 matrix_w=matrix_w, &
248 matrix_s=matrix_s, &
249 rho=rho)
250 NULLIFY (rho_ao)
251 CALL qs_rho_get(rho, rho_ao=rho_ao)
252 CALL mulliken_restraint(dft_control%qs_control%mulliken_restraint_control, &
253 para_env, matrix_s(1)%matrix, rho_ao, w_matrix=matrix_w)
254 END IF
255 ! Add non-Pulay contribution of DFT+U to W matrix, since it has also to be
256 ! digested with overlap matrix derivatives
257 ! Lowdin k-point derivatives were already added before transforming W(k).
258 IF (dft_control%dft_plus_u .AND. .NOT. (do_kpoints .AND. dft_control%plus_u_method_id == plus_u_lowdin)) THEN
259 NULLIFY (matrix_w_kp)
260 CALL get_qs_env(qs_env, matrix_w_kp=matrix_w_kp)
261 CALL plus_u(qs_env=qs_env, matrix_w=matrix_w_kp)
262 END IF
263
264 ! Write W Matrix to output (if requested)
265 CALL get_qs_env(qs_env, has_unit_metric=has_unit_metric)
266 IF (.NOT. has_unit_metric) THEN
267 NULLIFY (matrix_w_kp)
268 CALL get_qs_env(qs_env, matrix_w_kp=matrix_w_kp)
269 nspin = SIZE(matrix_w_kp, 1)
270 DO ispin = 1, nspin
271 IF (btest(cp_print_key_should_output(logger%iter_info, &
272 qs_env%input, "DFT%PRINT%AO_MATRICES/W_MATRIX"), cp_p_file)) THEN
273 iw = cp_print_key_unit_nr(logger, qs_env%input, "DFT%PRINT%AO_MATRICES/W_MATRIX", &
274 extension=".Log")
275 CALL section_vals_val_get(qs_env%input, "DFT%PRINT%AO_MATRICES%NDIGITS", i_val=after)
276 CALL section_vals_val_get(qs_env%input, "DFT%PRINT%AO_MATRICES%OMIT_HEADERS", l_val=omit_headers)
277 after = min(max(after, 1), 16)
278 DO ic = 1, SIZE(matrix_w_kp, 2)
279 CALL cp_dbcsr_write_sparse_matrix(matrix_w_kp(ispin, ic)%matrix, 4, after, qs_env, &
280 para_env, output_unit=iw, omit_headers=omit_headers)
281 END DO
282 CALL cp_print_key_finished_output(iw, logger, qs_env%input, &
283 "DFT%PRINT%AO_MATRICES/W_MATRIX")
284 END IF
285 END DO
286 END IF
287
288 ! Check if energy correction should be skipped
289 perform_ec = .false.
290 IF (qs_env%energy_correction) THEN
291 CALL get_qs_env(qs_env, ec_env=ec_env)
292 IF (.NOT. ec_env%do_skip) perform_ec = .true.
293 END IF
294
295 ! Compute core forces (also overwrites matrix_w)
296 IF (dft_control%qs_control%semi_empirical) THEN
297 CALL build_se_core_matrix(qs_env=qs_env, para_env=para_env, &
298 calculate_forces=.true.)
299 CALL se_core_core_interaction(qs_env, para_env, calculate_forces=.true.)
300 ELSE IF (dft_control%qs_control%dftb) THEN
301 CALL build_dftb_matrices(qs_env=qs_env, para_env=para_env, &
302 calculate_forces=.true.)
303 CALL calculate_dftb_dispersion(qs_env=qs_env, para_env=para_env, &
304 calculate_forces=.true.)
305 ELSE IF (dft_control%qs_control%xtb) THEN
306 IF (dft_control%qs_control%xtb_control%do_tblite) THEN
307 CALL build_tblite_matrices(qs_env=qs_env, calculate_forces=.true.)
308 ELSE
309 CALL build_xtb_matrices(qs_env=qs_env, calculate_forces=.true.)
310 END IF
311 ELSE IF (perform_ec) THEN
312 ! Calculates core and grid based forces
313 CALL energy_correction(qs_env, ec_init=.false., calculate_forces=.true.)
314 ELSE
315 ! Dispersion energy and forces are calculated in qs_energy?
316 CALL build_core_hamiltonian_matrix(qs_env=qs_env, calculate_forces=.true.)
317 ! The above line reset the core H, which should be re-updated in case a TD field is applied:
318 IF (qs_env%run_rtp) THEN
319 IF (dft_control%apply_efield_field) THEN
321 END IF
322 IF (dft_control%rtp_control%velocity_gauge) THEN
323 CALL velocity_gauge_ks_matrix(qs_env, subtract_nl_term=.false.)
324 END IF
325
326 END IF
327 CALL calculate_ecore_self(qs_env)
328 CALL calculate_ecore_overlap(qs_env, para_env, calculate_forces=.true.)
329 CALL calculate_ecore_efield(qs_env, calculate_forces=.true.)
330 !swap external_e_potential before external_c_potential, to ensure
331 !that external potential on grid is loaded before calculating energy of cores
332 CALL external_e_potential(qs_env)
333 IF (.NOT. dft_control%qs_control%gapw) THEN
334 CALL external_c_potential(qs_env, calculate_forces=.true.)
335 END IF
336 ! RIGPW matrices
337 IF (dft_control%qs_control%rigpw) THEN
338 CALL get_qs_env(qs_env=qs_env, lri_env=lri_env)
339 CALL build_ri_matrices(lri_env, qs_env, calculate_forces=.true.)
340 END IF
341 END IF
342
343 ! MP2 Code
344 IF (ASSOCIATED(qs_env%mp2_env)) THEN
345 NULLIFY (energy)
346 CALL get_qs_env(qs_env, energy=energy)
347 CALL qs_scf_compute_properties(qs_env, wf_type='MP2 ', do_mp2=.true.)
348 CALL qs_ks_update_qs_env(qs_env, just_energy=.true.)
349 energy%total = energy%total + energy%mp2
350
351 IF ((qs_env%mp2_env%method == ri_mp2_method_gpw .OR. qs_env%mp2_env%method == ri_mp2_laplace .OR. &
352 qs_env%mp2_env%method == ri_rpa_method_gpw) &
353 .AND. .NOT. qs_env%mp2_env%do_im_time) THEN
354 CALL update_mp2_forces(qs_env)
355 END IF
356
357 !RPA EXX energy and forces
358 IF (qs_env%mp2_env%method == ri_rpa_method_gpw) THEN
359 do_exx = .false.
360 hfx_sections => section_vals_get_subs_vals(qs_env%input, "DFT%XC%WF_CORRELATION%RI_RPA%HF")
361 CALL section_vals_get(hfx_sections, explicit=do_exx)
362 IF (do_exx) THEN
363 do_gw = qs_env%mp2_env%ri_rpa%do_ri_g0w0
364 do_admm = qs_env%mp2_env%ri_rpa%do_admm
365 reuse_hfx = qs_env%mp2_env%ri_rpa%reuse_hfx
366 do_im_time = qs_env%mp2_env%do_im_time
367 output_unit = cp_logger_get_default_io_unit()
368 dummy_real = 0.0_dp
369
370 CALL calculate_exx(qs_env=qs_env, &
371 unit_nr=output_unit, &
372 hfx_sections=hfx_sections, &
373 x_data=qs_env%mp2_env%ri_rpa%x_data, &
374 do_gw=do_gw, &
375 do_admm=do_admm, &
376 calc_forces=.true., &
377 reuse_hfx=reuse_hfx, &
378 do_im_time=do_im_time, &
379 e_ex_from_gw=dummy_real, &
380 e_admm_from_gw=dummy_real2, &
381 t3=dummy_real)
382 END IF
383 END IF
384 ELSE IF (perform_ec) THEN
385 ! energy correction forces postponed
386 ELSE IF (qs_env%harris_method) THEN
387 ! Harris method forces already done in harris_energy_correction
388 ELSE
389 ! Compute grid-based forces
390 CALL qs_ks_update_qs_env(qs_env, calculate_forces=.true.)
391 END IF
392
393 ! Excited state forces
394 ! Solve the response linear equation system for the Z-vector method
395 ! and calculate remaining terms of the force
396 CALL excited_state_energy(qs_env, calculate_forces=.true.)
397
398 ! replicate forces (get current pointer)
399 NULLIFY (force)
400 CALL get_qs_env(qs_env=qs_env, force=force)
401 CALL replicate_qs_force(force, para_env)
402
403 DO iatom = 1, natom
404 ikind = kind_of(iatom)
405 i = atom_of_kind(iatom)
406 ! XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
407 ! the force is - dE/dR, what is called force is actually the gradient
408 ! Things should have the right name
409 ! The minus sign below is a hack
410 ! XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
411 force(ikind)%other(1:3, i) = -particle_set(iatom)%f(1:3) + force(ikind)%ch_pulay(1:3, i)
412 force(ikind)%total(1:3, i) = force(ikind)%total(1:3, i) + force(ikind)%other(1:3, i)
413 particle_set(iatom)%f = -force(ikind)%total(1:3, i)
414 END DO
415
416 NULLIFY (cell, virial, energy)
417 CALL get_qs_env(qs_env=qs_env, cell=cell, virial=virial, energy=energy)
418 IF (virial%pv_availability) THEN
419 CALL para_env%sum(virial%pv_overlap)
420 CALL para_env%sum(virial%pv_ekinetic)
421 CALL para_env%sum(virial%pv_ppl)
422 CALL para_env%sum(virial%pv_ppnl)
423 CALL para_env%sum(virial%pv_ecore_overlap)
424 CALL para_env%sum(virial%pv_ehartree)
425 CALL para_env%sum(virial%pv_exc)
426 CALL para_env%sum(virial%pv_exx)
427 CALL para_env%sum(virial%pv_vdw)
428 CALL para_env%sum(virial%pv_mp2)
429 CALL para_env%sum(virial%pv_nlcc)
430 CALL para_env%sum(virial%pv_gapw)
431 CALL para_env%sum(virial%pv_lrigpw)
432 CALL para_env%sum(virial%pv_virial)
433 CALL symmetrize_virial(virial)
434 ! Add the volume terms of the virial
435 IF ((.NOT. virial%pv_numer) .AND. &
436 (.NOT. (dft_control%qs_control%dftb .OR. &
437 dft_control%qs_control%xtb .OR. &
438 dft_control%qs_control%semi_empirical))) THEN
439
440 ! Harris energy correction requires volume terms from
441 ! 1) Harris functional contribution, and
442 ! 2) Linear Response solver
443 IF (perform_ec) THEN
444 CALL get_qs_env(qs_env, ec_env=ec_env)
445 energy%hartree = ec_env%ehartree
446 energy%exc = ec_env%exc
447 IF (dft_control%do_admm) THEN
448 energy%exc_aux_fit = ec_env%exc_aux_fit
449 END IF
450 END IF
451 DO i = 1, 3
452 virial%pv_ehartree(i, i) = virial%pv_ehartree(i, i) &
453 - 2.0_dp*(energy%hartree + energy%sccs_pol)
454 virial%pv_virial(i, i) = virial%pv_virial(i, i) - energy%exc &
455 - 2.0_dp*(energy%hartree + energy%sccs_pol)
456 virial%pv_exc(i, i) = virial%pv_exc(i, i) - energy%exc
457 IF (dft_control%do_admm) THEN
458 virial%pv_exc(i, i) = virial%pv_exc(i, i) - energy%exc_aux_fit
459 virial%pv_virial(i, i) = virial%pv_virial(i, i) - energy%exc_aux_fit
460 END IF
461 ! The factor 2 is a hack. It compensates the plus sign in h_stress/pw_poisson_solve.
462 ! The sign in pw_poisson_solve is correct for FIST, but not for QS.
463 ! There should be a more elegant solution to that ...
464 END DO
465 END IF
466 IF ((.NOT. virial%pv_numer) .AND. count(cell%perd /= 0) == 2) THEN
467 SELECT CASE (dft_control%qs_control%method_id)
470 CALL project_virial_to_periodic_subspace(virial, cell%perd)
471 END SELECT
472 END IF
473 END IF
474
475 IF (dft_control%qs_control%xtb .AND. dft_control%qs_control%xtb_control%do_tblite) THEN
476 CALL tb_reference_cli_compare(qs_env)
477 END IF
478
479 output_unit = cp_print_key_unit_nr(logger, qs_env%input, "DFT%PRINT%DERIVATIVES", &
480 extension=".Log")
481 print_section => section_vals_get_subs_vals(qs_env%input, "DFT%PRINT%DERIVATIVES")
482 IF (dft_control%qs_control%semi_empirical) THEN
483 CALL write_forces(force, atomic_kind_set, 2, output_unit=output_unit, &
484 print_section=print_section)
485 ELSE IF (dft_control%qs_control%dftb) THEN
486 CALL write_forces(force, atomic_kind_set, 4, output_unit=output_unit, &
487 print_section=print_section)
488 ELSE IF (dft_control%qs_control%xtb) THEN
489 CALL write_forces(force, atomic_kind_set, 4, output_unit=output_unit, &
490 print_section=print_section)
491 ELSE IF (dft_control%qs_control%gapw .OR. dft_control%qs_control%gapw_xc) THEN
492 CALL write_forces(force, atomic_kind_set, 1, output_unit=output_unit, &
493 print_section=print_section)
494 ELSE
495 CALL write_forces(force, atomic_kind_set, 0, output_unit=output_unit, &
496 print_section=print_section)
497 END IF
498 CALL cp_print_key_finished_output(output_unit, logger, qs_env%input, &
499 "DFT%PRINT%DERIVATIVES")
500
501 ! deallocate W Matrix:
502 NULLIFY (ks_env, matrix_w_kp)
503 CALL get_qs_env(qs_env=qs_env, &
504 matrix_w_kp=matrix_w_kp, &
505 ks_env=ks_env)
506 CALL dbcsr_deallocate_matrix_set(matrix_w_kp)
507 NULLIFY (matrix_w_kp)
508 CALL set_ks_env(ks_env, matrix_w_kp=matrix_w_kp)
509
510 DEALLOCATE (atom_of_kind, kind_of)
511
512 CALL timestop(handle)
513
514 END SUBROUTINE qs_forces
515
516! **************************************************************************************************
517!> \brief Write a Quickstep force data structure to output unit
518!> \param qs_force ...
519!> \param atomic_kind_set ...
520!> \param ftype ...
521!> \param output_unit ...
522!> \param print_section ...
523!> \date 05.06.2002
524!> \author MK
525!> \version 1.0
526! **************************************************************************************************
527 SUBROUTINE write_forces(qs_force, atomic_kind_set, ftype, output_unit, &
528 print_section)
529
530 TYPE(qs_force_type), DIMENSION(:), POINTER :: qs_force
531 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
532 INTEGER, INTENT(IN) :: ftype, output_unit
533 TYPE(section_vals_type), POINTER :: print_section
534
535 CHARACTER(LEN=13) :: fmtstr5
536 CHARACTER(LEN=15) :: fmtstr4
537 CHARACTER(LEN=20) :: fmtstr3
538 CHARACTER(LEN=35) :: fmtstr2
539 CHARACTER(LEN=48) :: fmtstr1
540 INTEGER :: i, iatom, ikind, my_ftype, natom, ndigits
541 INTEGER, ALLOCATABLE, DIMENSION(:) :: atom_of_kind, kind_of
542 REAL(kind=dp), DIMENSION(3) :: grand_total
543
544 IF (output_unit > 0) THEN
545
546 IF (.NOT. ASSOCIATED(qs_force)) THEN
547 CALL cp_abort(__location__, &
548 "The qs_force pointer is not associated "// &
549 "and cannot be printed")
550 END IF
551
552 CALL get_atomic_kind_set(atomic_kind_set=atomic_kind_set, atom_of_kind=atom_of_kind, &
553 kind_of=kind_of, natom=natom)
554
555 ! Variable precision output of the forces
556 CALL section_vals_val_get(print_section, "NDIGITS", &
557 i_val=ndigits)
558
559 fmtstr1 = "(/,/,T2,A,/,/,T3,A,T11,A,T23,A,T40,A1,2( X,A1))"
560 WRITE (unit=fmtstr1(41:42), fmt="(I2)") ndigits + 5
561
562 fmtstr2 = "(/,(T2,I5,4X,I4,T18,A,T34,3F . ))"
563 WRITE (unit=fmtstr2(32:33), fmt="(I2)") ndigits
564 WRITE (unit=fmtstr2(29:30), fmt="(I2)") ndigits + 6
565
566 fmtstr3 = "(/,T3,A,T34,3F . )"
567 WRITE (unit=fmtstr3(18:19), fmt="(I2)") ndigits
568 WRITE (unit=fmtstr3(15:16), fmt="(I2)") ndigits + 6
569
570 fmtstr4 = "((T34,3F . ))"
571 WRITE (unit=fmtstr4(12:13), fmt="(I2)") ndigits
572 WRITE (unit=fmtstr4(9:10), fmt="(I2)") ndigits + 6
573
574 fmtstr5 = "(/T2,A//T3,A)"
575
576 WRITE (unit=output_unit, fmt=fmtstr1) &
577 "FORCES [a.u.]", "Atom", "Kind", "Component", "X", "Y", "Z"
578
579 grand_total(:) = 0.0_dp
580
581 my_ftype = ftype
582
583 SELECT CASE (my_ftype)
584 CASE DEFAULT
585 DO iatom = 1, natom
586 ikind = kind_of(iatom)
587 i = atom_of_kind(iatom)
588 WRITE (unit=output_unit, fmt=fmtstr2) &
589 iatom, ikind, " total", qs_force(ikind)%total(1:3, i)
590 grand_total(1:3) = grand_total(1:3) + qs_force(ikind)%total(1:3, i)
591 END DO
592 CASE (0)
593 DO iatom = 1, natom
594 ikind = kind_of(iatom)
595 i = atom_of_kind(iatom)
596 WRITE (unit=output_unit, fmt=fmtstr2) &
597 iatom, ikind, " overlap", qs_force(ikind)%overlap(1:3, i), &
598 iatom, ikind, " overlap_admm", qs_force(ikind)%overlap_admm(1:3, i), &
599 iatom, ikind, " kinetic", qs_force(ikind)%kinetic(1:3, i), &
600 iatom, ikind, " gth_ppl", qs_force(ikind)%gth_ppl(1:3, i), &
601 iatom, ikind, " gth_nlcc", qs_force(ikind)%gth_nlcc(1:3, i), &
602 iatom, ikind, " gth_ppnl", qs_force(ikind)%gth_ppnl(1:3, i), &
603 iatom, ikind, " core_overlap", qs_force(ikind)%core_overlap(1:3, i), &
604 iatom, ikind, " rho_core", qs_force(ikind)%rho_core(1:3, i), &
605 iatom, ikind, " rho_elec", qs_force(ikind)%rho_elec(1:3, i), &
606 iatom, ikind, " rho_lri_elec", qs_force(ikind)%rho_lri_elec(1:3, i), &
607 iatom, ikind, " ch_pulay", qs_force(ikind)%ch_pulay(1:3, i), &
608 iatom, ikind, " dispersion", qs_force(ikind)%dispersion(1:3, i), &
609 iatom, ikind, " gCP", qs_force(ikind)%gcp(1:3, i), &
610 iatom, ikind, " other", qs_force(ikind)%other(1:3, i), &
611 iatom, ikind, " fock_4c", qs_force(ikind)%fock_4c(1:3, i), &
612 iatom, ikind, " ehrenfest", qs_force(ikind)%ehrenfest(1:3, i), &
613 iatom, ikind, " efield", qs_force(ikind)%efield(1:3, i), &
614 iatom, ikind, " eev", qs_force(ikind)%eev(1:3, i), &
615 iatom, ikind, " mp2_non_sep", qs_force(ikind)%mp2_non_sep(1:3, i), &
616 iatom, ikind, " tensorial_u", qs_force(ikind)%tensorial_u(1:3, i), &
617 iatom, ikind, " total", qs_force(ikind)%total(1:3, i)
618 grand_total(1:3) = grand_total(1:3) + qs_force(ikind)%total(1:3, i)
619 END DO
620 CASE (1)
621 DO iatom = 1, natom
622 ikind = kind_of(iatom)
623 i = atom_of_kind(iatom)
624 WRITE (unit=output_unit, fmt=fmtstr2) &
625 iatom, ikind, " overlap", qs_force(ikind)%overlap(1:3, i), &
626 iatom, ikind, " overlap_admm", qs_force(ikind)%overlap_admm(1:3, i), &
627 iatom, ikind, " kinetic", qs_force(ikind)%kinetic(1:3, i), &
628 iatom, ikind, " gth_ppl", qs_force(ikind)%gth_ppl(1:3, i), &
629 iatom, ikind, " gth_nlcc", qs_force(ikind)%gth_nlcc(1:3, i), &
630 iatom, ikind, " gth_ppnl", qs_force(ikind)%gth_ppnl(1:3, i), &
631 iatom, ikind, " all_potential", qs_force(ikind)%all_potential(1:3, i), &
632 iatom, ikind, "cneo_potential", qs_force(ikind)%cneo_potential(1:3, i), &
633 iatom, ikind, " core_overlap", qs_force(ikind)%core_overlap(1:3, i), &
634 iatom, ikind, " rho_core", qs_force(ikind)%rho_core(1:3, i), &
635 iatom, ikind, " rho_elec", qs_force(ikind)%rho_elec(1:3, i), &
636 iatom, ikind, " rho_lri_elec", qs_force(ikind)%rho_lri_elec(1:3, i), &
637 iatom, ikind, " rho_cneo_nuc", qs_force(ikind)%rho_cneo_nuc(1:3, i), &
638 iatom, ikind, " vhxc_atom", qs_force(ikind)%vhxc_atom(1:3, i), &
639 iatom, ikind, " g0s_Vh_elec", qs_force(ikind)%g0s_Vh_elec(1:3, i), &
640 iatom, ikind, " ch_pulay", qs_force(ikind)%ch_pulay(1:3, i), &
641 iatom, ikind, " dispersion", qs_force(ikind)%dispersion(1:3, i), &
642 iatom, ikind, " gCP", qs_force(ikind)%gcp(1:3, i), &
643 iatom, ikind, " fock_4c", qs_force(ikind)%fock_4c(1:3, i), &
644 iatom, ikind, " ehrenfest", qs_force(ikind)%ehrenfest(1:3, i), &
645 iatom, ikind, " efield", qs_force(ikind)%efield(1:3, i), &
646 iatom, ikind, " eev", qs_force(ikind)%eev(1:3, i), &
647 iatom, ikind, " mp2_non_sep", qs_force(ikind)%mp2_non_sep(1:3, i), &
648 iatom, ikind, " tensorial_u", qs_force(ikind)%tensorial_u(1:3, i), &
649 iatom, ikind, " total", qs_force(ikind)%total(1:3, i)
650 grand_total(1:3) = grand_total(1:3) + qs_force(ikind)%total(1:3, i)
651 END DO
652 CASE (2)
653 DO iatom = 1, natom
654 ikind = kind_of(iatom)
655 i = atom_of_kind(iatom)
656 WRITE (unit=output_unit, fmt=fmtstr2) &
657 iatom, ikind, " all_potential", qs_force(ikind)%all_potential(1:3, i), &
658 iatom, ikind, " rho_elec", qs_force(ikind)%rho_elec(1:3, i), &
659 iatom, ikind, " total", qs_force(ikind)%total(1:3, i)
660 grand_total(1:3) = grand_total(1:3) + qs_force(ikind)%total(1:3, i)
661 END DO
662 CASE (3)
663 DO iatom = 1, natom
664 ikind = kind_of(iatom)
665 i = atom_of_kind(iatom)
666 WRITE (unit=output_unit, fmt=fmtstr2) &
667 iatom, ikind, " overlap", qs_force(ikind)%overlap(1:3, i), &
668 iatom, ikind, "overlap_admm", qs_force(ikind)%overlap_admm(1:3, i), &
669 iatom, ikind, " kinetic", qs_force(ikind)%kinetic(1:3, i), &
670 iatom, ikind, " gth_ppl", qs_force(ikind)%gth_ppl(1:3, i), &
671 iatom, ikind, " gth_nlcc", qs_force(ikind)%gth_nlcc(1:3, i), &
672 iatom, ikind, " gth_ppnl", qs_force(ikind)%gth_ppnl(1:3, i), &
673 iatom, ikind, " core_overlap", qs_force(ikind)%core_overlap(1:3, i), &
674 iatom, ikind, " rho_core", qs_force(ikind)%rho_core(1:3, i), &
675 iatom, ikind, " rho_elec", qs_force(ikind)%rho_elec(1:3, i), &
676 iatom, ikind, " ch_pulay", qs_force(ikind)%ch_pulay(1:3, i), &
677 iatom, ikind, " fock_4c", qs_force(ikind)%fock_4c(1:3, i), &
678 iatom, ikind, " mp2_non_sep", qs_force(ikind)%mp2_non_sep(1:3, i), &
679 iatom, ikind, " tensorial_u", qs_force(ikind)%tensorial_u(1:3, i), &
680 iatom, ikind, " total", qs_force(ikind)%total(1:3, i)
681 grand_total(1:3) = grand_total(1:3) + qs_force(ikind)%total(1:3, i)
682 END DO
683 CASE (4)
684 DO iatom = 1, natom
685 ikind = kind_of(iatom)
686 i = atom_of_kind(iatom)
687 WRITE (unit=output_unit, fmt=fmtstr2) &
688 iatom, ikind, " all_potential", qs_force(ikind)%all_potential(1:3, i), &
689 iatom, ikind, " overlap", qs_force(ikind)%overlap(1:3, i), &
690 iatom, ikind, " rho_elec", qs_force(ikind)%rho_elec(1:3, i), &
691 iatom, ikind, " repulsive", qs_force(ikind)%repulsive(1:3, i), &
692 iatom, ikind, " dispersion", qs_force(ikind)%dispersion(1:3, i), &
693 iatom, ikind, " efield", qs_force(ikind)%efield(1:3, i), &
694 iatom, ikind, " ehrenfest", qs_force(ikind)%ehrenfest(1:3, i), &
695 iatom, ikind, " total", qs_force(ikind)%total(1:3, i)
696 grand_total(1:3) = grand_total(1:3) + qs_force(ikind)%total(1:3, i)
697 END DO
698 CASE (5)
699 DO iatom = 1, natom
700 ikind = kind_of(iatom)
701 i = atom_of_kind(iatom)
702 WRITE (unit=output_unit, fmt=fmtstr2) &
703 iatom, ikind, " overlap", qs_force(ikind)%overlap(1:3, i), &
704 iatom, ikind, " kinetic", qs_force(ikind)%kinetic(1:3, i), &
705 iatom, ikind, " rho_elec", qs_force(ikind)%rho_elec(1:3, i), &
706 iatom, ikind, " dispersion", qs_force(ikind)%dispersion(1:3, i), &
707 iatom, ikind, " all potential", qs_force(ikind)%all_potential(1:3, i), &
708 iatom, ikind, " other", qs_force(ikind)%other(1:3, i), &
709 iatom, ikind, " total", qs_force(ikind)%total(1:3, i)
710 grand_total(1:3) = grand_total(1:3) + qs_force(ikind)%total(1:3, i)
711 END DO
712 END SELECT
713
714 WRITE (unit=output_unit, fmt=fmtstr3) "Sum of total", grand_total(1:3)
715
716 DEALLOCATE (atom_of_kind)
717 DEALLOCATE (kind_of)
718
719 END IF
720
721 END SUBROUTINE write_forces
722
723END MODULE qs_force
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.
Handles all functions related to the CELL.
Definition cell_types.F:15
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_set(matrix, alpha)
...
DBCSR operations in CP2K.
DBCSR output in CP2K.
subroutine, public cp_dbcsr_write_sparse_matrix(sparse_matrix, before, after, qs_env, para_env, first_row, last_row, first_col, last_col, scale, output_unit, omit_headers, cartesian_basis)
...
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...
Add the DFT+U contribution to the Hamiltonian matrix.
Definition dft_plus_u.F:18
subroutine, public plus_u(qs_env, matrix_h, matrix_w)
Add the DFT+U contribution to the Hamiltonian matrix. Wrapper routine for all "+U" methods.
Definition dft_plus_u.F:134
Types needed for a for a Energy Correction.
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,...
subroutine, public efield_potential_lengh_gauge(qs_env)
Replace the original implementation of the electric-electronic interaction in the length gauge....
Routines for an energy correction on top of a Kohn-Sham calculation.
subroutine, public energy_correction(qs_env, ec_init, calculate_forces)
Energy Correction to a Kohn-Sham simulation Available energy corrections: (1) Harris energy functiona...
Routines for total energy and forces of excited states.
subroutine, public excited_state_energy(qs_env, calculate_forces)
Excited state energy and forces.
Routines to calculate EXX in RPA and energy correction methods.
Definition hfx_exx.F:16
subroutine, public calculate_exx(qs_env, unit_nr, hfx_sections, x_data, do_gw, do_admm, calc_forces, reuse_hfx, do_im_time, e_ex_from_gw, e_admm_from_gw, t3)
...
Definition hfx_exx.F:106
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_method_ofgpw
integer, parameter, public smeagol_runtype_emtransport
integer, parameter, public do_method_rigpw
integer, parameter, public do_method_gpw
integer, parameter, public plus_u_lowdin
integer, parameter, public ri_rpa_method_gpw
integer, parameter, public ri_mp2_method_gpw
integer, parameter, public do_method_gapw
integer, parameter, public ri_mp2_laplace
integer, parameter, public do_method_lrigpw
integer, parameter, public do_method_gapw_xc
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
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.
Routines to calculate CPHF like update and solve Z-vector equation for MP2 gradients (only GPW).
Definition mp2_cphf.F:14
subroutine, public update_mp2_forces(qs_env)
...
Definition mp2_cphf.F:1283
compute mulliken charges we (currently) define them as c_i = 1/2 [ (PS)_{ii} + (SP)_{ii}...
Definition mulliken.F:13
subroutine, public mulliken_restraint(mulliken_restraint_control, para_env, s_matrix, p_matrix, energy, order_p, ks_matrix, w_matrix)
computes the energy and density matrix derivate of a constraint on the mulliken charges
Definition mulliken.F:73
Define the data structure for the particle information.
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.
Calculation of dispersion in DFTB.
subroutine, public calculate_dftb_dispersion(qs_env, para_env, calculate_forces)
...
Calculation of Overlap and Hamiltonian matrices in DFTB.
subroutine, public build_dftb_matrices(qs_env, para_env, calculate_forces)
...
Perform a QUICKSTEP wavefunction optimization (single point).
Definition qs_energy.F:14
subroutine, public qs_energies(qs_env, consistent_energies, calc_forces)
Driver routine for QUICKSTEP single point wavefunction optimization.
Definition qs_energy.F:72
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, 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.
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 replicate_qs_force(qs_force, para_env)
Replicate and sum up the force.
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.
Quickstep force driver routine.
Definition qs_force.F:12
subroutine, public qs_calc_energy_force(qs_env, calc_force, consistent_energies, linres)
...
Definition qs_force.F:112
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)
subroutine, public set_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, exc_accint, 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_vhxc, 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, xcint_weights, 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)
...
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...
Utility routines for qs_scf.
subroutine, public qs_scf_compute_properties(qs_env, wf_type, do_mp2)
computes properties for a given hamilonian using the current wfn
types that represent a quickstep subsys
subroutine, public qs_subsys_set(subsys, cp_subsys, local_particles, local_molecules, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, nelectron_total, nelectron_spin)
...
Calculates integral matrices for RIGPW method.
subroutine, public build_ri_matrices(lri_env, qs_env, calculate_forces)
creates and initializes an lri_env
Routines needed for EMD.
subroutine, public rt_admm_force(qs_env)
...
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 ,...
Routines to perform the RTP in the velocity gauge.
subroutine, public velocity_gauge_nl_force(qs_env, particle_set)
Calculate the force associated to non-local pseudo potential in the velocity gauge.
subroutine, public velocity_gauge_ks_matrix(qs_env, subtract_nl_term)
...
Split and build its own idependent core_core SE interaction module.
subroutine, public se_core_core_interaction(qs_env, para_env, calculate_forces)
Evaluates the core-core interactions for NDDO methods.
Calculation of the Hamiltonian integral matrix <a|H|b> for semi-empirical methods.
subroutine, public build_se_core_matrix(qs_env, para_env, calculate_forces)
...
interface to tblite
subroutine, public build_tblite_matrices(qs_env, calculate_forces)
...
subroutine, public tb_reference_cli_compare(qs_env)
Run native tblite CLI and compare against CP2K/tblite.
subroutine, public project_virial_to_periodic_subspace(virial, periodic)
Project all virial components to the periodic subspace of a low-dimensional cell.
subroutine, public symmetrize_virial(virial)
Symmetrize the virial components.
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.
Type defining parameters related to the simulation cell.
Definition cell_types.F:60
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 energy correction functional for KG.
stores all the informations relevant to an mpi environment
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.