(git:ed6f26b)
Loading...
Searching...
No Matches
xtb_ks_matrix.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Calculation of KS matrix in xTB
10!> Reference: Stefan Grimme, Christoph Bannwarth, Philip Shushkov
11!> JCTC 13, 1989-2009, (2017)
12!> DOI: 10.1021/acs.jctc.7b00118
13!> \author JGH
14! **************************************************************************************************
19 USE cp_dbcsr_api, ONLY: dbcsr_add,&
33 USE kinds, ONLY: dp
35 USE mulliken, ONLY: ao_charges
41 USE qs_kind_types, ONLY: get_qs_kind,&
45 USE qs_mo_types, ONLY: get_mo_set,&
47 USE qs_rho_types, ONLY: qs_rho_get,&
51 USE xtb_types, ONLY: get_xtb_atom_param,&
53#include "./base/base_uses.f90"
54
55 IMPLICIT NONE
56
57 PRIVATE
58
59 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'xtb_ks_matrix'
60
61 PUBLIC :: build_xtb_ks_matrix
62
63CONTAINS
64
65! **************************************************************************************************
66!> \brief ...
67!> \param qs_env ...
68!> \param calculate_forces ...
69!> \param just_energy ...
70!> \param ext_ks_matrix ...
71! **************************************************************************************************
72 SUBROUTINE build_xtb_ks_matrix(qs_env, calculate_forces, just_energy, ext_ks_matrix)
73 TYPE(qs_environment_type), POINTER :: qs_env
74 LOGICAL, INTENT(in) :: calculate_forces, just_energy
75 TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
76 POINTER :: ext_ks_matrix
77
78 INTEGER :: gfn_type
79 TYPE(dft_control_type), POINTER :: dft_control
80
81 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control)
82 gfn_type = dft_control%qs_control%xtb_control%gfn_type
83
84 SELECT CASE (gfn_type)
85 CASE (0)
86 cpassert(.NOT. PRESENT(ext_ks_matrix))
87 CALL build_gfn0_xtb_ks_matrix(qs_env, calculate_forces, just_energy)
88 CASE (1)
89 CALL build_gfn1_xtb_ks_matrix(qs_env, calculate_forces, just_energy, ext_ks_matrix)
90 CASE (2)
91 cpabort("gfn_type = 2 not yet available")
92 CASE DEFAULT
93 cpabort("Unknown gfn_type")
94 END SELECT
95
96 END SUBROUTINE build_xtb_ks_matrix
97
98! **************************************************************************************************
99!> \brief ...
100!> \param qs_env ...
101!> \param calculate_forces ...
102!> \param just_energy ...
103! **************************************************************************************************
104 SUBROUTINE build_gfn0_xtb_ks_matrix(qs_env, calculate_forces, just_energy)
105 TYPE(qs_environment_type), POINTER :: qs_env
106 LOGICAL, INTENT(in) :: calculate_forces, just_energy
107
108 CHARACTER(len=*), PARAMETER :: routinen = 'build_gfn0_xtb_ks_matrix'
109
110 INTEGER :: handle, img, iounit, ispin, natom, nimg, &
111 nspins
112 REAL(kind=dp) :: pc_ener, qmmm_el
113 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
114 TYPE(cp_logger_type), POINTER :: logger
115 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_p1, mo_derivs
116 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: ks_matrix, matrix_h
117 TYPE(dbcsr_type), POINTER :: mo_coeff
118 TYPE(dft_control_type), POINTER :: dft_control
119 TYPE(mp_para_env_type), POINTER :: para_env
120 TYPE(qs_energy_type), POINTER :: energy
121 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
122 TYPE(qs_ks_env_type), POINTER :: ks_env
123 TYPE(qs_rho_type), POINTER :: rho
124 TYPE(section_vals_type), POINTER :: scf_section
125
126 CALL timeset(routinen, handle)
127
128 mark_used(calculate_forces)
129
130 NULLIFY (dft_control, logger, scf_section, ks_env, ks_matrix, rho, &
131 energy)
132 cpassert(ASSOCIATED(qs_env))
133
134 logger => cp_get_default_logger()
135 iounit = cp_logger_get_default_io_unit(logger)
136
137 CALL get_qs_env(qs_env, &
138 dft_control=dft_control, &
139 atomic_kind_set=atomic_kind_set, &
140 qs_kind_set=qs_kind_set, &
141 matrix_h_kp=matrix_h, &
142 para_env=para_env, &
143 ks_env=ks_env, &
144 matrix_ks_kp=ks_matrix, &
145 energy=energy)
146
147 energy%hartree = 0.0_dp
148 energy%qmmm_el = 0.0_dp
149
150 scf_section => section_vals_get_subs_vals(qs_env%input, "DFT%SCF")
151 nspins = dft_control%nspins
152 nimg = dft_control%nimages
153 cpassert(ASSOCIATED(matrix_h))
154 cpassert(SIZE(ks_matrix) > 0)
155
156 DO ispin = 1, nspins
157 DO img = 1, nimg
158 ! copy the core matrix into the fock matrix
159 CALL dbcsr_copy(ks_matrix(ispin, img)%matrix, matrix_h(1, img)%matrix)
160 END DO
161 END DO
162
163 IF (qs_env%qmmm) THEN
164 cpabort("gfn0 QMMM NYA")
165 CALL get_qs_env(qs_env=qs_env, rho=rho, natom=natom)
166 cpassert(SIZE(ks_matrix, 2) == 1)
167 DO ispin = 1, nspins
168 ! If QM/MM sumup the 1el Hamiltonian
169 CALL dbcsr_add(ks_matrix(ispin, 1)%matrix, qs_env%ks_qmmm_env%matrix_h(1)%matrix, &
170 1.0_dp, 1.0_dp)
171 CALL qs_rho_get(rho, rho_ao=matrix_p1)
172 ! Compute QM/MM Energy
173 CALL dbcsr_dot(qs_env%ks_qmmm_env%matrix_h(1)%matrix, &
174 matrix_p1(ispin)%matrix, qmmm_el)
175 energy%qmmm_el = energy%qmmm_el + qmmm_el
176 END DO
177 pc_ener = qs_env%ks_qmmm_env%pc_ener
178 energy%qmmm_el = energy%qmmm_el + pc_ener
179 END IF
180
181 energy%total = energy%core + energy%eeq + energy%efield + energy%qmmm_el + &
182 energy%repulsive + energy%dispersion + energy%kTS
183
184 iounit = cp_print_key_unit_nr(logger, scf_section, "PRINT%DETAILED_ENERGY", &
185 extension=".scfLog")
186 IF (iounit > 0) THEN
187 WRITE (unit=iounit, fmt="(/,(T9,A,T60,F20.10))") &
188 "Repulsive pair potential energy: ", energy%repulsive, &
189 "SRB Correction energy: ", energy%srb, &
190 "Zeroth order Hamiltonian energy: ", energy%core, &
191 "Charge equilibration energy: ", energy%eeq, &
192 "London dispersion energy: ", energy%dispersion
193 IF (dft_control%qs_control%xtb_control%do_nonbonded) &
194 WRITE (unit=iounit, fmt="(T9,A,T60,F20.10)") &
195 "Correction for nonbonded interactions: ", energy%xtb_nonbonded
196 IF (abs(energy%efield) > 1.e-12_dp) THEN
197 WRITE (unit=iounit, fmt="(T9,A,T60,F20.10)") &
198 "Electric field interaction energy: ", energy%efield
199 END IF
200 IF (qs_env%qmmm) THEN
201 WRITE (unit=iounit, fmt="(T9,A,T60,F20.10)") &
202 "QM/MM Electrostatic energy: ", energy%qmmm_el
203 END IF
204 END IF
205 CALL cp_print_key_finished_output(iounit, logger, scf_section, &
206 "PRINT%DETAILED_ENERGY")
207 ! here we compute dE/dC if needed. Assumes dE/dC is H_{ks}C
208 IF (qs_env%requires_mo_derivs .AND. .NOT. just_energy) THEN
209 cpassert(SIZE(ks_matrix, 2) == 1)
210 block
211 TYPE(mo_set_type), DIMENSION(:), POINTER :: mo_array
212 CALL get_qs_env(qs_env, mo_derivs=mo_derivs, mos=mo_array)
213 DO ispin = 1, SIZE(mo_derivs)
214 CALL get_mo_set(mo_set=mo_array(ispin), mo_coeff_b=mo_coeff)
215 IF (.NOT. mo_array(ispin)%use_mo_coeff_b) THEN
216 cpabort("")
217 END IF
218 CALL dbcsr_multiply('n', 'n', 1.0_dp, ks_matrix(ispin, 1)%matrix, mo_coeff, &
219 0.0_dp, mo_derivs(ispin)%matrix)
220 END DO
221 END block
222 END IF
223
224 CALL timestop(handle)
225
226 END SUBROUTINE build_gfn0_xtb_ks_matrix
227
228! **************************************************************************************************
229!> \brief ...
230!> \param qs_env ...
231!> \param calculate_forces ...
232!> \param just_energy ...
233!> \param ext_ks_matrix ...
234! **************************************************************************************************
235 SUBROUTINE build_gfn1_xtb_ks_matrix(qs_env, calculate_forces, just_energy, ext_ks_matrix)
236 TYPE(qs_environment_type), POINTER :: qs_env
237 LOGICAL, INTENT(in) :: calculate_forces, just_energy
238 TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, &
239 POINTER :: ext_ks_matrix
240
241 CHARACTER(len=*), PARAMETER :: routinen = 'build_gfn1_xtb_ks_matrix'
242
243 INTEGER :: atom_a, handle, iatom, ikind, img, &
244 iounit, is, ispin, na, natom, natorb, &
245 nimg, nkind, ns, nsgf, nspins
246 INTEGER, DIMENSION(25) :: lao
247 INTEGER, DIMENSION(5) :: occ
248 LOGICAL :: do_efield, pass_check
249 REAL(kind=dp) :: achrg, chmax, pc_ener, qmmm_el
250 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: mcharge
251 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: aocg, charges
252 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
253 TYPE(cp_logger_type), POINTER :: logger
254 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_p1, mo_derivs, p_matrix
255 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: ks_matrix, matrix_h, matrix_p, matrix_s
256 TYPE(dbcsr_type), POINTER :: mo_coeff, s_matrix
257 TYPE(dft_control_type), POINTER :: dft_control
258 TYPE(mp_para_env_type), POINTER :: para_env
259 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
260 TYPE(qs_energy_type), POINTER :: energy
261 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
262 TYPE(qs_ks_env_type), POINTER :: ks_env
263 TYPE(qs_rho_type), POINTER :: rho
264 TYPE(qs_scf_env_type), POINTER :: scf_env
265 TYPE(section_vals_type), POINTER :: scf_section
266 TYPE(xtb_atom_type), POINTER :: xtb_kind
267
268 CALL timeset(routinen, handle)
269
270 NULLIFY (dft_control, logger, scf_section, matrix_p, particle_set, ks_env, &
271 ks_matrix, rho, energy)
272 cpassert(ASSOCIATED(qs_env))
273
274 logger => cp_get_default_logger()
275 iounit = cp_logger_get_default_io_unit(logger)
276
277 CALL get_qs_env(qs_env, &
278 dft_control=dft_control, &
279 atomic_kind_set=atomic_kind_set, &
280 qs_kind_set=qs_kind_set, &
281 matrix_h_kp=matrix_h, &
282 para_env=para_env, &
283 ks_env=ks_env, &
284 matrix_ks_kp=ks_matrix, &
285 rho=rho, &
286 energy=energy)
287
288 IF (PRESENT(ext_ks_matrix)) THEN
289 ! remap pointer to allow for non-kpoint external ks matrix
290 ! ext_ks_matrix is used in linear response code
291 ns = SIZE(ext_ks_matrix)
292 ks_matrix(1:ns, 1:1) => ext_ks_matrix(1:ns)
293 END IF
294
295 energy%hartree = 0.0_dp
296 energy%qmmm_el = 0.0_dp
297 energy%efield = 0.0_dp
298
299 scf_section => section_vals_get_subs_vals(qs_env%input, "DFT%SCF")
300 nspins = dft_control%nspins
301 nimg = dft_control%nimages
302 cpassert(ASSOCIATED(matrix_h))
303 cpassert(ASSOCIATED(rho))
304 cpassert(SIZE(ks_matrix) > 0)
305
306 DO ispin = 1, nspins
307 DO img = 1, nimg
308 ! copy the core matrix into the fock matrix
309 CALL dbcsr_copy(ks_matrix(ispin, img)%matrix, matrix_h(1, img)%matrix)
310 END DO
311 END DO
312
313 IF (dft_control%apply_period_efield .OR. dft_control%apply_efield .OR. &
314 dft_control%apply_efield_field) THEN
315 do_efield = .true.
316 ELSE
317 do_efield = .false.
318 END IF
319
320 IF (dft_control%qs_control%xtb_control%coulomb_interaction .OR. do_efield) THEN
321 ! Mulliken charges
322 CALL get_qs_env(qs_env=qs_env, particle_set=particle_set, matrix_s_kp=matrix_s)
323 CALL qs_rho_get(rho, rho_ao_kp=matrix_p)
324 natom = SIZE(particle_set)
325 ALLOCATE (mcharge(natom), charges(natom, 5))
326 charges = 0.0_dp
327 nkind = SIZE(atomic_kind_set)
328 CALL get_qs_kind_set(qs_kind_set, maxsgf=nsgf)
329 ALLOCATE (aocg(nsgf, natom))
330 aocg = 0.0_dp
331 IF (nimg > 1) THEN
332 CALL ao_charges(matrix_p, matrix_s, aocg, para_env)
333 ELSE
334 p_matrix => matrix_p(:, 1)
335 s_matrix => matrix_s(1, 1)%matrix
336 CALL ao_charges(p_matrix, s_matrix, aocg, para_env)
337 END IF
338 DO ikind = 1, nkind
339 CALL get_atomic_kind(atomic_kind_set(ikind), natom=na)
340 CALL get_qs_kind(qs_kind_set(ikind), xtb_parameter=xtb_kind)
341 CALL get_xtb_atom_param(xtb_kind, natorb=natorb, lao=lao, occupation=occ)
342 DO iatom = 1, na
343 atom_a = atomic_kind_set(ikind)%atom_list(iatom)
344 charges(atom_a, :) = real(occ(:), kind=dp)
345 DO is = 1, natorb
346 ns = lao(is) + 1
347 charges(atom_a, ns) = charges(atom_a, ns) - aocg(is, atom_a)
348 END DO
349 END DO
350 END DO
351 DEALLOCATE (aocg)
352 ! charge mixing
353 IF (dft_control%qs_control%do_ls_scf) THEN
354 !
355 ELSE
356 CALL get_qs_env(qs_env=qs_env, scf_env=scf_env)
357 CALL charge_mixing(scf_env%mixing_method, scf_env%mixing_store, &
358 charges, para_env, scf_env%iter_count)
359 END IF
360
361 DO iatom = 1, natom
362 mcharge(iatom) = sum(charges(iatom, :))
363 END DO
364 END IF
365
366 IF (dft_control%qs_control%xtb_control%coulomb_interaction) THEN
367 CALL build_xtb_coulomb(qs_env, ks_matrix, rho, charges, mcharge, energy, &
368 calculate_forces, just_energy)
369 END IF
370
371 IF (do_efield) THEN
372 CALL efield_tb_matrix(qs_env, ks_matrix, rho, mcharge, energy, calculate_forces, just_energy)
373 END IF
374
375 IF (dft_control%qs_control%xtb_control%coulomb_interaction) THEN
376 IF (dft_control%qs_control%xtb_control%check_atomic_charges) THEN
377 pass_check = .true.
378 DO ikind = 1, nkind
379 CALL get_atomic_kind(atomic_kind_set(ikind), natom=na)
380 CALL get_qs_kind(qs_kind_set(ikind), xtb_parameter=xtb_kind)
381 CALL get_xtb_atom_param(xtb_kind, chmax=chmax)
382 DO iatom = 1, na
383 atom_a = atomic_kind_set(ikind)%atom_list(iatom)
384 achrg = mcharge(atom_a)
385 IF (abs(achrg) > chmax) THEN
386 IF (iounit > 0) THEN
387 WRITE (iounit, "(A,A,I3,I6,A,F4.2,A,F6.2)") " Charge outside chemical range:", &
388 " Kind Atom=", ikind, atom_a, " Limit=", chmax, " Charge=", achrg
389 END IF
390 pass_check = .false.
391 END IF
392 END DO
393 END DO
394 IF (.NOT. pass_check) THEN
395 CALL cp_warn(__location__, "Atomic charges outside chemical range were detected."// &
396 " Switch-off CHECK_ATOMIC_CHARGES keyword in the &xTB section"// &
397 " if you want to force to continue the calculation.")
398 cpabort("xTB Charges")
399 END IF
400 END IF
401 END IF
402
403 IF (dft_control%qs_control%xtb_control%coulomb_interaction .OR. do_efield) THEN
404 DEALLOCATE (mcharge, charges)
405 END IF
406
407 IF (qs_env%qmmm) THEN
408 cpassert(SIZE(ks_matrix, 2) == 1)
409 DO ispin = 1, nspins
410 ! If QM/MM sumup the 1el Hamiltonian
411 CALL dbcsr_add(ks_matrix(ispin, 1)%matrix, qs_env%ks_qmmm_env%matrix_h(1)%matrix, &
412 1.0_dp, 1.0_dp)
413 CALL qs_rho_get(rho, rho_ao=matrix_p1)
414 ! Compute QM/MM Energy
415 CALL dbcsr_dot(qs_env%ks_qmmm_env%matrix_h(1)%matrix, &
416 matrix_p1(ispin)%matrix, qmmm_el)
417 energy%qmmm_el = energy%qmmm_el + qmmm_el
418 END DO
419 pc_ener = qs_env%ks_qmmm_env%pc_ener
420 energy%qmmm_el = energy%qmmm_el + pc_ener
421 END IF
422
423 energy%total = energy%core + energy%hartree + energy%efield + energy%qmmm_el + &
424 energy%repulsive + energy%dispersion + energy%dftb3 + energy%kTS
425
426 iounit = cp_print_key_unit_nr(logger, scf_section, "PRINT%DETAILED_ENERGY", &
427 extension=".scfLog")
428 IF (iounit > 0) THEN
429 WRITE (unit=iounit, fmt="(/,(T9,A,T60,F20.10))") &
430 "Repulsive pair potential energy: ", energy%repulsive, &
431 "Zeroth order Hamiltonian energy: ", energy%core, &
432 "Charge fluctuation energy: ", energy%hartree, &
433 "London dispersion energy: ", energy%dispersion
434 IF (dft_control%qs_control%xtb_control%xb_interaction) &
435 WRITE (unit=iounit, fmt="(T9,A,T60,F20.10)") &
436 "Correction for halogen bonding: ", energy%xtb_xb_inter
437 IF (dft_control%qs_control%xtb_control%do_nonbonded) &
438 WRITE (unit=iounit, fmt="(T9,A,T60,F20.10)") &
439 "Correction for nonbonded interactions: ", energy%xtb_nonbonded
440 IF (abs(energy%efield) > 1.e-12_dp) THEN
441 WRITE (unit=iounit, fmt="(T9,A,T60,F20.10)") &
442 "Electric field interaction energy: ", energy%efield
443 END IF
444 WRITE (unit=iounit, fmt="(T9,A,T60,F20.10)") &
445 "DFTB3 3rd Order Energy Correction ", energy%dftb3
446 IF (qs_env%qmmm) THEN
447 WRITE (unit=iounit, fmt="(T9,A,T60,F20.10)") &
448 "QM/MM Electrostatic energy: ", energy%qmmm_el
449 END IF
450 END IF
451 CALL cp_print_key_finished_output(iounit, logger, scf_section, &
452 "PRINT%DETAILED_ENERGY")
453 ! here we compute dE/dC if needed. Assumes dE/dC is H_{ks}C
454 IF (qs_env%requires_mo_derivs .AND. .NOT. just_energy) THEN
455 cpassert(SIZE(ks_matrix, 2) == 1)
456 block
457 TYPE(mo_set_type), DIMENSION(:), POINTER :: mo_array
458 CALL get_qs_env(qs_env, mo_derivs=mo_derivs, mos=mo_array)
459 DO ispin = 1, SIZE(mo_derivs)
460 CALL get_mo_set(mo_set=mo_array(ispin), mo_coeff_b=mo_coeff)
461 IF (.NOT. mo_array(ispin)%use_mo_coeff_b) THEN
462 cpabort("")
463 END IF
464 CALL dbcsr_multiply('n', 'n', 1.0_dp, ks_matrix(ispin, 1)%matrix, mo_coeff, &
465 0.0_dp, mo_derivs(ispin)%matrix)
466 END DO
467 END block
468 END IF
469
470 CALL timestop(handle)
471
472 END SUBROUTINE build_gfn1_xtb_ks_matrix
473
474END MODULE xtb_ks_matrix
475
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
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_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_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
subroutine, public dbcsr_dot(matrix_a, matrix_b, trace)
Computes the dot product of two matrices, also known as the trace of their matrix product.
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,...
Calculation of electric field contributions in TB.
subroutine, public efield_tb_matrix(qs_env, ks_matrix, rho, mcharge, energy, calculate_forces, just_energy)
...
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
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Interface to the message passing library MPI.
compute mulliken charges we (currently) define them as c_i = 1/2 [ (PS)_{ii} + (SP)_{ii} ]
Definition mulliken.F:13
Define the data structure for the particle information.
subroutine, public charge_mixing(mixing_method, mixing_store, charges, para_env, iter_count)
Driver for the charge mixing, calls the proper routine given the requested method.
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, 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, 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)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public get_qs_kind_set(qs_kind_set, all_potential_present, tnadd_potential_present, gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, basis_rcut, basis_type, total_zeff_corr, npgf_seg)
Get attributes of an atomic kind set.
Definition and initialisation of the mo data type.
Definition qs_mo_types.F:22
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count)
Get the components of a MO set data structure.
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...
module that contains the definitions of the scf types
Calculation of Coulomb contributions in xTB.
Definition xtb_coulomb.F:12
subroutine, public build_xtb_coulomb(qs_env, ks_matrix, rho, charges, mcharge, energy, calculate_forces, just_energy)
...
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)
...
Definition of the xTB parameter types.
Definition xtb_types.F:20
subroutine, public get_xtb_atom_param(xtb_parameter, symbol, aname, typ, defined, z, zeff, natorb, lmax, nao, lao, rcut, rcov, kx, eta, xgamma, alpha, zneff, nshell, nval, lval, kpoly, kappa, hen, zeta, xi, kappa0, alpg, occupation, electronegativity, chmax, en, kqat2, kcn, kq)
...
Definition xtb_types.F:199
Provides all information about an atomic kind.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
keeps the density in various representations, keeping track of which ones are valid.