(git:618e178)
Loading...
Searching...
No Matches
dm_ls_scf_qs.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 for a linear scaling quickstep SCF run based on the density
10!> matrix, with a focus on the interface between dm_ls_scf and qs
11!> \par History
12!> 2011.04 created [Joost VandeVondele]
13!> \author Joost VandeVondele
14! **************************************************************************************************
18 USE cp_dbcsr_api, ONLY: &
29 USE dm_ls_scf_types, ONLY: ls_cluster_atomic,&
30 ls_cluster_molecular,&
35 USE kinds, ONLY: default_string_length,&
36 dp
40 USE pw_env_types, ONLY: pw_env_get,&
42 USE pw_methods, ONLY: pw_zero
43 USE pw_pool_types, ONLY: pw_pool_p_type,&
45 USE pw_types, ONLY: pw_c1d_gs_type,&
61 USE qs_ks_types, ONLY: qs_ks_did_change,&
70 USE qs_rho_types, ONLY: qs_rho_get,&
75 USE tblite_types, ONLY: tblite_type
76#include "./base/base_uses.f90"
77
78 IMPLICIT NONE
79
80 PRIVATE
81
82 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'dm_ls_scf_qs'
83
87
88CONTAINS
89
90! **************************************************************************************************
91!> \brief create a matrix for use (and as a template) in ls based on a qs template
92!> \param matrix_ls ...
93!> \param matrix_qs ...
94!> \param ls_mstruct ...
95!> \par History
96!> 2011.03 created [Joost VandeVondele]
97!> 2015.09 add support for PAO [Ole Schuett]
98!> \author Joost VandeVondele
99! **************************************************************************************************
100 SUBROUTINE matrix_ls_create(matrix_ls, matrix_qs, ls_mstruct)
101 TYPE(dbcsr_type) :: matrix_ls, matrix_qs
102 TYPE(ls_mstruct_type), INTENT(IN) :: ls_mstruct
103
104 CHARACTER(len=*), PARAMETER :: routinen = 'matrix_ls_create'
105
106 CHARACTER(len=default_string_length) :: name
107 INTEGER :: handle, iatom, imol, jatom, natom, nmol
108 INTEGER, ALLOCATABLE, DIMENSION(:), TARGET :: atom_to_cluster, atom_to_cluster_primus, &
109 clustered_blk_sizes, primus_of_mol
110 INTEGER, DIMENSION(:), POINTER :: clustered_col_dist, clustered_row_dist, &
111 ls_blk_sizes, ls_col_dist, ls_row_dist
112 TYPE(dbcsr_distribution_type) :: ls_dist, ls_dist_clustered
113
114 CALL timeset(routinen, handle)
115
116 ! Defaults -----------------------------------------------------------------------------------
117 CALL dbcsr_get_info(matrix_qs, col_blk_size=ls_blk_sizes, distribution=ls_dist)
118 CALL dbcsr_distribution_hold(ls_dist)
119 CALL dbcsr_distribution_get(ls_dist, row_dist=ls_row_dist, col_dist=ls_col_dist)
120
121 ! PAO ----------------------------------------------------------------------------------------
122 IF (ls_mstruct%do_pao) THEN
123 CALL dbcsr_get_info(ls_mstruct%matrix_A, col_blk_size=ls_blk_sizes)
124 END IF
125
126 ! Clustering ---------------------------------------------------------------------------------
127 SELECT CASE (ls_mstruct%cluster_type)
128 CASE (ls_cluster_atomic)
129 ! do nothing
131 ! create format of the clustered matrix
132 CALL dbcsr_get_info(matrix_qs, nblkrows_total=natom)
133 nmol = maxval(ls_mstruct%atom_to_molecule)
134 ALLOCATE (atom_to_cluster_primus(natom))
135 ALLOCATE (atom_to_cluster(natom))
136 ALLOCATE (primus_of_mol(nmol))
137 DO iatom = 1, natom
138 atom_to_cluster(iatom) = ls_mstruct%atom_to_molecule(iatom)
139 ! the first atom of the molecule is the primus
140 ! if the number of atoms per molecule is independent of system size, this is not a quadratic loop
141 ! it assumes that all atoms of the molecule are consecutive.
142 DO jatom = iatom, 1, -1
143 IF (ls_mstruct%atom_to_molecule(jatom) == atom_to_cluster(iatom)) THEN
144 atom_to_cluster_primus(iatom) = jatom
145 ELSE
146 EXIT
147 END IF
148 END DO
149 primus_of_mol(atom_to_cluster(iatom)) = atom_to_cluster_primus(iatom)
150 END DO
151
152 ! row
153 ALLOCATE (clustered_row_dist(nmol))
154 DO imol = 1, nmol
155 clustered_row_dist(imol) = ls_row_dist(primus_of_mol(imol))
156 END DO
157
158 ! col
159 ALLOCATE (clustered_col_dist(nmol))
160 DO imol = 1, nmol
161 clustered_col_dist(imol) = ls_col_dist(primus_of_mol(imol))
162 END DO
163
164 ALLOCATE (clustered_blk_sizes(nmol))
165 clustered_blk_sizes = 0
166 DO iatom = 1, natom
167 clustered_blk_sizes(atom_to_cluster(iatom)) = clustered_blk_sizes(atom_to_cluster(iatom)) + &
168 ls_blk_sizes(iatom)
169 END DO
170 ls_blk_sizes => clustered_blk_sizes ! redirect pointer
171
172 ! create new distribution
173 CALL dbcsr_distribution_new(ls_dist_clustered, &
174 template=ls_dist, &
175 row_dist=clustered_row_dist, &
176 col_dist=clustered_col_dist, &
177 reuse_arrays=.true.)
178 CALL dbcsr_distribution_release(ls_dist)
179 ls_dist = ls_dist_clustered
180
181 CASE DEFAULT
182 cpabort("Unknown LS cluster type")
183 END SELECT
184
185 ! Create actual matrix -----------------------------------------------------------------------
186 CALL dbcsr_get_info(matrix_qs, name=name)
187 CALL dbcsr_create(matrix_ls, &
188 name=name, &
189 dist=ls_dist, &
190 matrix_type="S", &
191 row_blk_size=ls_blk_sizes, &
192 col_blk_size=ls_blk_sizes)
193 CALL dbcsr_distribution_release(ls_dist)
194 CALL dbcsr_finalize(matrix_ls)
195
196 CALL timestop(handle)
197
198 END SUBROUTINE matrix_ls_create
199
200! **************************************************************************************************
201!> \brief first link to QS, copy a QS matrix to LS matrix
202!> used to isolate QS style matrices from LS style
203!> will be useful for future features (e.g. precision, symmetry, blocking, ...)
204!> \param matrix_ls ...
205!> \param matrix_qs ...
206!> \param ls_mstruct ...
207!> \param covariant ...
208!> \par History
209!> 2010.10 created [Joost VandeVondele]
210!> 2015.09 add support for PAO [Ole Schuett]
211!> \author Joost VandeVondele
212! **************************************************************************************************
213 SUBROUTINE matrix_qs_to_ls(matrix_ls, matrix_qs, ls_mstruct, covariant)
214 TYPE(dbcsr_type) :: matrix_ls, matrix_qs
215 TYPE(ls_mstruct_type), INTENT(IN), TARGET :: ls_mstruct
216 LOGICAL, INTENT(IN) :: covariant
217
218 CHARACTER(len=*), PARAMETER :: routinen = 'matrix_qs_to_ls'
219
220 INTEGER :: handle
221 INTEGER, DIMENSION(:), POINTER :: pao_blk_sizes
222 TYPE(dbcsr_type) :: matrix_pao, matrix_tmp
223 TYPE(dbcsr_type), POINTER :: matrix_trafo
224
225 CALL timeset(routinen, handle)
226
227 IF (.NOT. ls_mstruct%do_pao) THEN
228 CALL matrix_cluster(matrix_ls, matrix_qs, ls_mstruct)
229
230 ELSE ! using pao
231 CALL dbcsr_get_info(ls_mstruct%matrix_A, col_blk_size=pao_blk_sizes)
232 CALL dbcsr_create(matrix_pao, &
233 matrix_type="N", &
234 template=matrix_qs, &
235 row_blk_size=pao_blk_sizes, &
236 col_blk_size=pao_blk_sizes)
237
238 matrix_trafo => ls_mstruct%matrix_A ! contra-variant
239 IF (covariant) matrix_trafo => ls_mstruct%matrix_B ! co-variant
240 CALL dbcsr_create(matrix_tmp, template=matrix_trafo)
241
242 CALL dbcsr_multiply("N", "N", 1.0_dp, matrix_qs, matrix_trafo, 0.0_dp, matrix_tmp)
243 CALL dbcsr_multiply("T", "N", 1.0_dp, matrix_trafo, matrix_tmp, 0.0_dp, matrix_pao)
244 CALL dbcsr_release(matrix_tmp)
245
246 CALL matrix_cluster(matrix_ls, matrix_pao, ls_mstruct)
247 CALL dbcsr_release(matrix_pao)
248 END IF
249
250 CALL timestop(handle)
251
252 END SUBROUTINE matrix_qs_to_ls
253
254! **************************************************************************************************
255!> \brief Performs molecular blocking and reduction to single precision if enabled
256!> \param matrix_out ...
257!> \param matrix_in ...
258!> \param ls_mstruct ...
259!> \author Ole Schuett
260! **************************************************************************************************
261 SUBROUTINE matrix_cluster(matrix_out, matrix_in, ls_mstruct)
262 TYPE(dbcsr_type) :: matrix_out, matrix_in
263 TYPE(ls_mstruct_type), INTENT(IN) :: ls_mstruct
264
265 CHARACTER(len=*), PARAMETER :: routinen = 'matrix_cluster'
266
267 INTEGER :: handle
268 TYPE(dbcsr_type) :: matrix_in_nosym
269
270 CALL timeset(routinen, handle)
271
272 SELECT CASE (ls_mstruct%cluster_type)
273 CASE (ls_cluster_atomic)
274 CALL dbcsr_copy(matrix_out, matrix_in)
275
277 ! desymmetrize the qs matrix
278 CALL dbcsr_create(matrix_in_nosym, template=matrix_in, matrix_type="N")
279 CALL dbcsr_desymmetrize(matrix_in, matrix_in_nosym)
280
281 ! perform the magic complete redistribute copy
282 CALL dbcsr_complete_redistribute(matrix_in_nosym, matrix_out)
283 CALL dbcsr_release(matrix_in_nosym)
284
285 CASE DEFAULT
286 cpabort("Unknown LS cluster type")
287 END SELECT
288
289 CALL timestop(handle)
290
291 END SUBROUTINE matrix_cluster
292
293! **************************************************************************************************
294!> \brief second link to QS, copy a LS matrix to QS matrix
295!> used to isolate QS style matrices from LS style
296!> will be useful for future features (e.g. precision, symmetry, blocking, ...)
297!> \param matrix_qs ...
298!> \param matrix_ls ...
299!> \param ls_mstruct ...
300!> \param covariant ...
301!> \param keep_sparsity will be passed on to dbcsr_copy, by default set to .TRUE.
302!> \par History
303!> 2010.10 created [Joost VandeVondele]
304!> 2015.09 add support for PAO [Ole Schuett]
305!> \author Joost VandeVondele
306! **************************************************************************************************
307 SUBROUTINE matrix_ls_to_qs(matrix_qs, matrix_ls, ls_mstruct, covariant, keep_sparsity)
308 TYPE(dbcsr_type) :: matrix_qs, matrix_ls
309 TYPE(ls_mstruct_type), INTENT(IN), TARGET :: ls_mstruct
310 LOGICAL :: covariant
311 LOGICAL, OPTIONAL :: keep_sparsity
312
313 CHARACTER(len=*), PARAMETER :: routinen = 'matrix_ls_to_qs'
314
315 INTEGER :: handle
316 INTEGER, DIMENSION(:), POINTER :: pao_blk_sizes
317 LOGICAL :: my_keep_sparsity
318 TYPE(dbcsr_type) :: matrix_declustered, matrix_tmp1, &
319 matrix_tmp2
320 TYPE(dbcsr_type), POINTER :: matrix_trafo
321
322 CALL timeset(routinen, handle)
323
324 my_keep_sparsity = .true.
325 IF (PRESENT(keep_sparsity)) &
326 my_keep_sparsity = keep_sparsity
327
328 IF (.NOT. ls_mstruct%do_pao) THEN
329 CALL dbcsr_create(matrix_declustered, template=matrix_qs)
330 CALL matrix_decluster(matrix_declustered, matrix_ls, ls_mstruct)
331 CALL dbcsr_copy(matrix_qs, matrix_declustered, keep_sparsity=my_keep_sparsity)
332 CALL dbcsr_release(matrix_declustered)
333
334 ELSE ! using pao
335 CALL dbcsr_get_info(ls_mstruct%matrix_A, col_blk_size=pao_blk_sizes)
336 CALL dbcsr_create(matrix_declustered, &
337 template=matrix_qs, &
338 row_blk_size=pao_blk_sizes, &
339 col_blk_size=pao_blk_sizes)
340
341 CALL matrix_decluster(matrix_declustered, matrix_ls, ls_mstruct)
342
343 matrix_trafo => ls_mstruct%matrix_B ! contra-variant
344 IF (covariant) matrix_trafo => ls_mstruct%matrix_A ! co-variant
345 CALL dbcsr_create(matrix_tmp1, template=matrix_trafo)
346 CALL dbcsr_create(matrix_tmp2, template=matrix_qs)
347 CALL dbcsr_multiply("N", "N", 1.0_dp, matrix_trafo, matrix_declustered, 0.0_dp, matrix_tmp1)
348 CALL dbcsr_multiply("N", "T", 1.0_dp, matrix_tmp1, matrix_trafo, 0.0_dp, matrix_tmp2)
349 CALL dbcsr_copy(matrix_qs, matrix_tmp2, keep_sparsity=my_keep_sparsity)
350 CALL dbcsr_release(matrix_declustered)
351 CALL dbcsr_release(matrix_tmp1)
352 CALL dbcsr_release(matrix_tmp2)
353 END IF
354
355 CALL timestop(handle)
356
357 END SUBROUTINE matrix_ls_to_qs
358
359! **************************************************************************************************
360!> \brief Reverses molecular blocking and reduction to single precision if enabled
361!> \param matrix_out ...
362!> \param matrix_in ...
363!> \param ls_mstruct ...
364!> \author Ole Schuett
365! **************************************************************************************************
366 SUBROUTINE matrix_decluster(matrix_out, matrix_in, ls_mstruct)
367 TYPE(dbcsr_type) :: matrix_out, matrix_in
368 TYPE(ls_mstruct_type), INTENT(IN) :: ls_mstruct
369
370 CHARACTER(len=*), PARAMETER :: routinen = 'matrix_decluster'
371
372 INTEGER :: handle
373
374 CALL timeset(routinen, handle)
375
376 SELECT CASE (ls_mstruct%cluster_type)
377 CASE (ls_cluster_atomic)
378 CALL dbcsr_copy(matrix_out, matrix_in)
379
381 ! perform the magic complete redistribute copy
382 CALL dbcsr_complete_redistribute(matrix_in, matrix_out)
383
384 CASE DEFAULT
385 cpabort("Unknown LS cluster type")
386 END SELECT
387
388 CALL timestop(handle)
389
390 END SUBROUTINE matrix_decluster
391
392! **************************************************************************************************
393!> \brief further required initialization of QS.
394!> Might be factored-out since this seems common code with the other SCF.
395!> \param qs_env ...
396!> \par History
397!> 2010.10 created [Joost VandeVondele]
398!> \author Joost VandeVondele
399! **************************************************************************************************
400 SUBROUTINE ls_scf_init_qs(qs_env)
401 TYPE(qs_environment_type), POINTER :: qs_env
402
403 CHARACTER(len=*), PARAMETER :: routinen = 'ls_scf_init_qs'
404
405 INTEGER :: handle, ispin, nspin, unit_nr
406 TYPE(cp_logger_type), POINTER :: logger
407 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_ks, matrix_s
408 TYPE(dft_control_type), POINTER :: dft_control
409 TYPE(neighbor_list_set_p_type), DIMENSION(:), &
410 POINTER :: sab_orb
411 TYPE(qs_ks_env_type), POINTER :: ks_env
412
413 NULLIFY (sab_orb)
414 CALL timeset(routinen, handle)
415
416 ! get a useful output_unit
417 logger => cp_get_default_logger()
418 IF (logger%para_env%is_source()) THEN
419 unit_nr = cp_logger_get_default_unit_nr(logger, local=.true.)
420 ELSE
421 unit_nr = -1
422 END IF
423
424 ! get basic quantities from the qs_env
425 CALL get_qs_env(qs_env, dft_control=dft_control, &
426 matrix_s=matrix_s, &
427 matrix_ks=matrix_ks, &
428 ks_env=ks_env, &
429 sab_orb=sab_orb)
430
431 nspin = dft_control%nspins
432
433 ! we might have to create matrix_ks
434 IF (.NOT. ASSOCIATED(matrix_ks)) THEN
435 CALL dbcsr_allocate_matrix_set(matrix_ks, nspin)
436 DO ispin = 1, nspin
437 ALLOCATE (matrix_ks(ispin)%matrix)
438 CALL dbcsr_create(matrix_ks(ispin)%matrix, template=matrix_s(1)%matrix)
439 CALL cp_dbcsr_alloc_block_from_nbl(matrix_ks(ispin)%matrix, sab_orb)
440 CALL dbcsr_set(matrix_ks(ispin)%matrix, 0.0_dp)
441 END DO
442 CALL set_ks_env(ks_env, matrix_ks=matrix_ks)
443 END IF
444
445 CALL timestop(handle)
446
447 END SUBROUTINE ls_scf_init_qs
448
449! **************************************************************************************************
450!> \brief get an atomic initial guess
451!> \param qs_env ...
452!> \param ls_scf_env ...
453!> \param energy ...
454!> \param nonscf ...
455!> \par History
456!> 2012.11 created [Joost VandeVondele]
457!> \author Joost VandeVondele
458! **************************************************************************************************
459 SUBROUTINE ls_scf_qs_atomic_guess(qs_env, ls_scf_env, energy, nonscf)
460 TYPE(qs_environment_type), POINTER :: qs_env
461 TYPE(ls_scf_env_type) :: ls_scf_env
462 REAL(kind=dp) :: energy
463 LOGICAL, INTENT(IN), OPTIONAL :: nonscf
464
465 CHARACTER(len=*), PARAMETER :: routinen = 'ls_scf_qs_atomic_guess'
466
467 INTEGER :: handle, nspin, unit_nr
468 INTEGER, DIMENSION(2) :: nelectron_spin
469 LOGICAL :: do_scf, has_unit_metric
470 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
471 TYPE(cp_logger_type), POINTER :: logger
472 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_ks, matrix_s, rho_ao
473 TYPE(dft_control_type), POINTER :: dft_control
474 TYPE(mp_para_env_type), POINTER :: para_env
475 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
476 TYPE(qs_energy_type), POINTER :: qs_energy
477 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
478 TYPE(qs_ks_env_type), POINTER :: ks_env
479 TYPE(qs_rho_type), POINTER :: rho
480
481 CALL timeset(routinen, handle)
482 NULLIFY (rho, rho_ao)
483
484 ! get a useful output_unit
485 logger => cp_get_default_logger()
486 IF (logger%para_env%is_source()) THEN
487 unit_nr = cp_logger_get_default_unit_nr(logger, local=.true.)
488 ELSE
489 unit_nr = -1
490 END IF
491
492 ! get basic quantities from the qs_env
493 CALL get_qs_env(qs_env, dft_control=dft_control, &
494 matrix_s=matrix_s, &
495 matrix_ks=matrix_ks, &
496 ks_env=ks_env, &
497 energy=qs_energy, &
498 atomic_kind_set=atomic_kind_set, &
499 qs_kind_set=qs_kind_set, &
500 particle_set=particle_set, &
501 has_unit_metric=has_unit_metric, &
502 para_env=para_env, &
503 nelectron_spin=nelectron_spin, &
504 rho=rho)
505
506 CALL qs_rho_get(rho, rho_ao=rho_ao)
507
508 nspin = dft_control%nspins
509
510 ! create an initial atomic guess
511 IF (dft_control%qs_control%dftb .OR. dft_control%qs_control%semi_empirical .OR. &
512 dft_control%qs_control%xtb) THEN
513 CALL calculate_mopac_dm(rho_ao, matrix_s(1)%matrix, has_unit_metric, &
514 dft_control, particle_set, atomic_kind_set, qs_kind_set, &
515 nspin, nelectron_spin, para_env)
516 ELSE
517 CALL calculate_atomic_block_dm(rho_ao, matrix_s(1)%matrix, atomic_kind_set, qs_kind_set, &
518 nspin, nelectron_spin, unit_nr, para_env)
519 END IF
520
521 do_scf = .true.
522 IF (PRESENT(nonscf)) do_scf = .NOT. nonscf
523 IF (do_scf) THEN
524 CALL qs_rho_update_rho(rho, qs_env=qs_env)
525 CALL qs_ks_did_change(qs_env%ks_env, rho_changed=.true.)
526 CALL qs_ks_update_qs_env(qs_env, calculate_forces=.false., just_energy=.false.)
527 CALL ls_scf_tblite_energy(qs_env, qs_energy)
528 energy = qs_energy%total
529 ELSE
530 CALL ls_nonscf_ks(qs_env, ls_scf_env, energy)
531 END IF
532
533 CALL timestop(handle)
534
535 END SUBROUTINE ls_scf_qs_atomic_guess
536
537! **************************************************************************************************
538!> \brief use the density matrix in ls_scf_env to compute the new energy and KS matrix
539!> \param qs_env ...
540!> \param ls_scf_env ...
541!> \param energy_new ...
542!> \param iscf ...
543!> \par History
544!> 2011.04 created [Joost VandeVondele]
545!> 2015.02 added gspace density mixing [Patrick Seewald]
546!> \author Joost VandeVondele
547! **************************************************************************************************
548 SUBROUTINE ls_scf_dm_to_ks(qs_env, ls_scf_env, energy_new, iscf)
549 TYPE(qs_environment_type), POINTER :: qs_env
550 TYPE(ls_scf_env_type) :: ls_scf_env
551 REAL(kind=dp) :: energy_new
552 INTEGER, INTENT(IN) :: iscf
553
554 CHARACTER(len=*), PARAMETER :: routinen = 'ls_scf_dm_to_ks'
555
556 INTEGER :: handle, ispin, nspin, unit_nr
557 TYPE(cp_logger_type), POINTER :: logger
558 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao
559 TYPE(mp_para_env_type), POINTER :: para_env
560 TYPE(qs_energy_type), POINTER :: energy
561 TYPE(qs_rho_type), POINTER :: rho
562
563 NULLIFY (energy, rho, rho_ao)
564 CALL timeset(routinen, handle)
565
566 logger => cp_get_default_logger()
567 IF (logger%para_env%is_source()) THEN
568 unit_nr = cp_logger_get_default_unit_nr(logger, local=.true.)
569 ELSE
570 unit_nr = -1
571 END IF
572
573 nspin = ls_scf_env%nspins
574 CALL get_qs_env(qs_env, para_env=para_env, energy=energy, rho=rho)
575 CALL qs_rho_get(rho, rho_ao=rho_ao)
576
577 ! set the new density matrix
578 DO ispin = 1, nspin
579 CALL matrix_ls_to_qs(rho_ao(ispin)%matrix, ls_scf_env%matrix_p(ispin), &
580 ls_scf_env%ls_mstruct, covariant=.false.)
581 END DO
582
583 ! compute the corresponding KS matrix and new energy, mix density if requested
584 CALL qs_rho_update_rho(rho, qs_env=qs_env)
585 IF (ls_scf_env%do_rho_mixing) THEN
586 IF (ls_scf_env%density_mixing_method == direct_mixing_nr) &
587 cpabort("Direct P mixing not implemented in linear scaling SCF. ")
588 IF (ls_scf_env%density_mixing_method >= gspace_mixing_nr) THEN
589 IF (iscf > max(ls_scf_env%mixing_store%nskip_mixing, 1)) THEN
590 CALL gspace_mixing(qs_env, ls_scf_env%density_mixing_method, &
591 ls_scf_env%mixing_store, rho, para_env, &
592 iscf - 1)
593 IF (unit_nr > 0) THEN
594 WRITE (unit_nr, '(A57)') &
595 "*********************************************************"
596 WRITE (unit_nr, '(A13,F5.3,A20,A6,A7,I3)') &
597 " Using ALPHA=", ls_scf_env%mixing_store%alpha, &
598 " to mix rho: method=", ls_scf_env%mixing_store%iter_method, ", iscf=", iscf
599 WRITE (unit_nr, '(A8,F5.3,A6,F5.3,A8)') &
600 " rho_nw=", ls_scf_env%mixing_store%alpha, "*rho + ", &
601 1.0_dp - ls_scf_env%mixing_store%alpha, "*rho_old"
602 WRITE (unit_nr, '(A57)') &
603 "*********************************************************"
604 END IF
605 END IF
606 END IF
607 END IF
608
609 CALL qs_ks_did_change(qs_env%ks_env, rho_changed=.true.)
610 CALL qs_ks_update_qs_env(qs_env, calculate_forces=.false., &
611 just_energy=.false., print_active=.true.)
612 CALL ls_scf_tblite_energy(qs_env, energy)
613 energy_new = energy%total
614
615 CALL timestop(handle)
616
617 END SUBROUTINE ls_scf_dm_to_ks
618
619! **************************************************************************************************
620!> \brief use the external density in ls_scf_env to compute the new KS matrix
621!> \param qs_env ...
622!> \param ls_scf_env ...
623!> \param energy_new ...
624! **************************************************************************************************
625 SUBROUTINE ls_nonscf_ks(qs_env, ls_scf_env, energy_new)
626 TYPE(qs_environment_type), POINTER :: qs_env
627 TYPE(ls_scf_env_type) :: ls_scf_env
628 REAL(kind=dp) :: energy_new
629
630 CHARACTER(len=*), PARAMETER :: routinen = 'ls_nonscf_ks'
631
632 INTEGER :: handle, ispin, nspin
633 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao
634 TYPE(harris_type), POINTER :: harris_env
635 TYPE(mp_para_env_type), POINTER :: para_env
636 TYPE(qs_energy_type), POINTER :: energy
637 TYPE(qs_rho_type), POINTER :: rho
638
639 NULLIFY (energy, rho, rho_ao)
640 CALL timeset(routinen, handle)
641
642 nspin = ls_scf_env%nspins
643 CALL get_qs_env(qs_env, para_env=para_env, energy=energy, rho=rho)
644 CALL qs_rho_get(rho, rho_ao=rho_ao)
645
646 ! set the new density matrix
647 DO ispin = 1, nspin
648 CALL matrix_ls_to_qs(rho_ao(ispin)%matrix, ls_scf_env%matrix_p(ispin), &
649 ls_scf_env%ls_mstruct, covariant=.false.)
650 END DO
651
652 IF (qs_env%harris_method) THEN
653 CALL get_qs_env(qs_env, harris_env=harris_env)
654 CALL harris_density_update(qs_env, harris_env)
655 END IF
656 ! compute the corresponding KS matrix and new energy
657 CALL qs_rho_update_rho(rho, qs_env=qs_env)
658 IF (ls_scf_env%do_rho_mixing) THEN
659 cpabort("P mixing not implemented in linear scaling NONSCF. ")
660 END IF
661
662 CALL qs_ks_did_change(qs_env%ks_env, rho_changed=.true.)
663 CALL qs_ks_update_qs_env(qs_env, calculate_forces=.false., &
664 just_energy=.false., print_active=.true.)
665 CALL ls_scf_tblite_energy(qs_env, energy)
666 energy_new = energy%total
667
668 CALL timestop(handle)
669
670 END SUBROUTINE ls_nonscf_ks
671
672! **************************************************************************************************
673!> \brief use the new density matrix in ls_scf_env to compute the new energy
674!> \param qs_env ...
675!> \param ls_scf_env ...
676! **************************************************************************************************
677 SUBROUTINE ls_nonscf_energy(qs_env, ls_scf_env)
678 TYPE(qs_environment_type), POINTER :: qs_env
679 TYPE(ls_scf_env_type) :: ls_scf_env
680
681 CHARACTER(len=*), PARAMETER :: routinen = 'ls_nonscf_energy'
682
683 INTEGER :: handle, ispin, nspin
684 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_h, matrix_ks, rho_ao
685 TYPE(mp_para_env_type), POINTER :: para_env
686 TYPE(qs_energy_type), POINTER :: energy
687 TYPE(qs_rho_type), POINTER :: rho
688
689 NULLIFY (energy, rho, rho_ao)
690 CALL timeset(routinen, handle)
691 IF (qs_env%qmmm) THEN
692 cpabort("NYA")
693 END IF
694
695 nspin = ls_scf_env%nspins
696 CALL get_qs_env(qs_env, para_env=para_env, energy=energy, rho=rho)
697 CALL qs_rho_get(rho, rho_ao=rho_ao)
698
699 ! set the new density matrix
700 DO ispin = 1, nspin
701 CALL matrix_ls_to_qs(rho_ao(ispin)%matrix, ls_scf_env%matrix_p(ispin), &
702 ls_scf_env%ls_mstruct, covariant=.false.)
703 END DO
704
705 CALL qs_ks_did_change(qs_env%ks_env, rho_changed=.true.)
706
707 ! band energy : Tr(PH)
708 CALL get_qs_env(qs_env, matrix_ks=matrix_ks)
709 CALL calculate_ptrace(matrix_ks, rho_ao, energy%band, nspin, .true.)
710 ! core energy : Tr(Ph)
711 energy%total = energy%total - energy%core
712 CALL get_qs_env(qs_env, matrix_h=matrix_h)
713 CALL calculate_ptrace(matrix_h, rho_ao, energy%core, nspin)
714
715 CALL timestop(handle)
716
717 END SUBROUTINE ls_nonscf_energy
718
719! **************************************************************************************************
720!> \brief update CP2K/tblite total energy after an LS_SCF KS rebuild.
721!> \param qs_env ...
722!> \param energy ...
723! **************************************************************************************************
724 SUBROUTINE ls_scf_tblite_energy(qs_env, energy)
725 TYPE(qs_environment_type), POINTER :: qs_env
726 TYPE(qs_energy_type), POINTER :: energy
727
728 TYPE(dft_control_type), POINTER :: dft_control
729 TYPE(tblite_type), POINTER :: tb
730
731 NULLIFY (dft_control, tb)
732 CALL get_qs_env(qs_env, dft_control=dft_control, tb_tblite=tb)
733
734 IF (dft_control%qs_control%xtb .AND. dft_control%qs_control%xtb_control%do_tblite) THEN
735 cpassert(ASSOCIATED(tb))
736 CALL tb_get_energy(qs_env, tb, energy)
737 END IF
738
739 END SUBROUTINE ls_scf_tblite_energy
740
741! **************************************************************************************************
742!> \brief ...
743!> \param qs_env ...
744!> \param ls_scf_env ...
745!> \param matrix_p_ls ...
746!> \param unit_nr ...
747!> \param title ...
748!> \param stride ...
749! **************************************************************************************************
750 SUBROUTINE write_matrix_to_cube(qs_env, ls_scf_env, matrix_p_ls, unit_nr, title, stride)
751 TYPE(qs_environment_type), POINTER :: qs_env
752 TYPE(ls_scf_env_type) :: ls_scf_env
753 TYPE(dbcsr_type), INTENT(IN) :: matrix_p_ls
754 INTEGER, INTENT(IN) :: unit_nr
755 CHARACTER(LEN=*), INTENT(IN) :: title
756 INTEGER, DIMENSION(:), POINTER :: stride
757
758 CHARACTER(len=*), PARAMETER :: routinen = 'write_matrix_to_cube'
759
760 INTEGER :: handle
761 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_ks
762 TYPE(dbcsr_type), TARGET :: matrix_p_qs
763 TYPE(particle_list_type), POINTER :: particles
764 TYPE(pw_c1d_gs_type) :: wf_g
765 TYPE(pw_env_type), POINTER :: pw_env
766 TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools
767 TYPE(pw_pool_type), POINTER :: auxbas_pw_pool
768 TYPE(pw_r3d_rs_type) :: wf_r
769 TYPE(qs_ks_env_type), POINTER :: ks_env
770 TYPE(qs_subsys_type), POINTER :: subsys
771
772 CALL timeset(routinen, handle)
773
774 NULLIFY (ks_env, pw_env, auxbas_pw_pool, pw_pools, particles, subsys, matrix_ks)
775
776 CALL get_qs_env(qs_env, &
777 ks_env=ks_env, &
778 subsys=subsys, &
779 pw_env=pw_env, &
780 matrix_ks=matrix_ks)
781
782 CALL qs_subsys_get(subsys, particles=particles)
783
784 ! convert the density matrix (ls style) to QS style
785 CALL dbcsr_copy(matrix_p_qs, matrix_ks(1)%matrix)
786 CALL dbcsr_set(matrix_p_qs, 0.0_dp) !zero matrix creation
787 CALL matrix_ls_to_qs(matrix_p_qs, matrix_p_ls, ls_scf_env%ls_mstruct, covariant=.false.)
788
789 ! Print total electronic density
790 CALL pw_env_get(pw_env=pw_env, &
791 auxbas_pw_pool=auxbas_pw_pool, &
792 pw_pools=pw_pools)
793 CALL auxbas_pw_pool%create_pw(pw=wf_r)
794 CALL pw_zero(wf_r)
795 CALL auxbas_pw_pool%create_pw(pw=wf_g)
796 CALL pw_zero(wf_g)
797 CALL calculate_rho_elec(matrix_p=matrix_p_qs, &
798 rho=wf_r, &
799 rho_gspace=wf_g, &
800 ks_env=ks_env)
801
802 ! write this to a cube
803 CALL cp_pw_to_cube(wf_r, unit_nr=unit_nr, title=title, &
804 particles=particles, stride=stride)
805
806 !free memory
807 CALL auxbas_pw_pool%give_back_pw(wf_r)
808 CALL auxbas_pw_pool%give_back_pw(wf_g)
809 CALL dbcsr_release(matrix_p_qs)
810
811 CALL timestop(handle)
812
813 END SUBROUTINE write_matrix_to_cube
814
815! **************************************************************************************************
816!> \brief Initialize g-space density mixing
817!> \param qs_env ...
818!> \param ls_scf_env ...
819! **************************************************************************************************
820 SUBROUTINE rho_mixing_ls_init(qs_env, ls_scf_env)
821 TYPE(qs_environment_type), POINTER :: qs_env
822 TYPE(ls_scf_env_type) :: ls_scf_env
823
824 CHARACTER(len=*), PARAMETER :: routinen = 'rho_mixing_ls_init'
825
826 INTEGER :: handle
827 TYPE(dft_control_type), POINTER :: dft_control
828 TYPE(qs_rho_type), POINTER :: rho
829 TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho_atom
830
831 CALL timeset(routinen, handle)
832
833 CALL get_qs_env(qs_env, dft_control=dft_control, rho=rho)
834
835 CALL mixing_allocate(qs_env, ls_scf_env%density_mixing_method, nspins=ls_scf_env%nspins, &
836 mixing_store=ls_scf_env%mixing_store)
837 IF (ls_scf_env%density_mixing_method >= gspace_mixing_nr) THEN
838 IF (dft_control%qs_control%gapw) THEN
839 CALL get_qs_env(qs_env, rho_atom_set=rho_atom)
840 CALL mixing_init(ls_scf_env%density_mixing_method, rho, ls_scf_env%mixing_store, &
841 ls_scf_env%para_env, rho_atom=rho_atom)
842 ELSEIF (dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb) THEN
843 CALL charge_mixing_init(ls_scf_env%mixing_store)
844 ELSEIF (dft_control%qs_control%semi_empirical) THEN
845 cpabort('SE Code not possible')
846 ELSE
847 CALL mixing_init(ls_scf_env%density_mixing_method, rho, ls_scf_env%mixing_store, &
848 ls_scf_env%para_env)
849 END IF
850 END IF
851 CALL timestop(handle)
852 END SUBROUTINE rho_mixing_ls_init
853
854END MODULE dm_ls_scf_qs
Define the atomic kind types and their sub types.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_distribution_release(dist)
...
subroutine, public dbcsr_distribution_new(dist, template, group, pgrid, row_dist, col_dist, reuse_arrays)
...
subroutine, public dbcsr_distribution_hold(dist)
...
subroutine, public dbcsr_desymmetrize(matrix_a, matrix_b)
...
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_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
subroutine, public dbcsr_finalize(matrix)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_complete_redistribute(matrix, redist)
...
subroutine, public dbcsr_distribution_get(dist, row_dist, col_dist, nrows, ncols, has_threads, group, mynode, numnodes, nprows, npcols, myprow, mypcol, pgrid, subgroups_defined, prow_group, pcol_group)
...
DBCSR operations in CP2K.
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
A wrapper around pw_to_cube() which accepts particle_list_type.
subroutine, public cp_pw_to_cube(pw, unit_nr, title, particles, zeff, stride, max_file_size_mb, zero_tails, silent, mpi_io)
...
Routines for a linear scaling quickstep SCF run based on the density matrix, with a focus on the inte...
subroutine, public ls_scf_qs_atomic_guess(qs_env, ls_scf_env, energy, nonscf)
get an atomic initial guess
subroutine, public ls_nonscf_ks(qs_env, ls_scf_env, energy_new)
use the external density in ls_scf_env to compute the new KS matrix
subroutine, public matrix_ls_to_qs(matrix_qs, matrix_ls, ls_mstruct, covariant, keep_sparsity)
second link to QS, copy a LS matrix to QS matrix used to isolate QS style matrices from LS style will...
subroutine, public matrix_decluster(matrix_out, matrix_in, ls_mstruct)
Reverses molecular blocking and reduction to single precision if enabled.
subroutine, public ls_scf_dm_to_ks(qs_env, ls_scf_env, energy_new, iscf)
use the density matrix in ls_scf_env to compute the new energy and KS matrix
subroutine, public write_matrix_to_cube(qs_env, ls_scf_env, matrix_p_ls, unit_nr, title, stride)
...
subroutine, public rho_mixing_ls_init(qs_env, ls_scf_env)
Initialize g-space density mixing.
subroutine, public ls_nonscf_energy(qs_env, ls_scf_env)
use the new density matrix in ls_scf_env to compute the new energy
subroutine, public matrix_ls_create(matrix_ls, matrix_qs, ls_mstruct)
create a matrix for use (and as a template) in ls based on a qs template
subroutine, public matrix_qs_to_ls(matrix_ls, matrix_qs, ls_mstruct, covariant)
first link to QS, copy a QS matrix to LS matrix used to isolate QS style matrices from LS style will ...
subroutine, public ls_scf_init_qs(qs_env)
further required initialization of QS. Might be factored-out since this seems common code with the ot...
Types needed for a linear scaling quickstep SCF run based on the density matrix.
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public ls_cluster_molecular
integer, parameter, public ls_cluster_atomic
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
Interface to the message passing library MPI.
represent a simple array based list of the given type
Define the data structure for the particle information.
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Routine to return block diagonal density matrix. Blocks correspond to the atomic densities.
subroutine, public calculate_atomic_block_dm(pmatrix, matrix_s, atomic_kind_set, qs_kind_set, nspin, nelectron_spin, ounit, para_env)
returns a block diagonal density matrix. Blocks correspond to the atomic densities.
Calculate the plane wave density by collocating the primitive Gaussian functions (pgf).
subroutine, public calculate_rho_elec(matrix_p, matrix_p_kp, rho, rho_gspace, total_rho, ks_env, soft_valid, compute_tau, compute_grad, basis_type, der_type, idir, task_list_external, pw_env_external)
computes the density corresponding to a given density matrix on the grid
Calculation of the energies concerning the core charge distribution.
module that contains the definitions of the scf types
integer, parameter, public direct_mixing_nr
integer, parameter, public gspace_mixing_nr
Perform a QUICKSTEP wavefunction optimization (single point)
Definition qs_energy.F:14
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, 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 gspace_mixing(qs_env, mixing_method, mixing_store, rho, para_env, iter_count)
Driver for the g-space mixing, calls the proper routine given the requested method.
Types needed for a for a Harris model calculation.
Harris method environment setup and handling.
subroutine, public harris_density_update(qs_env, harris_env)
...
Routines to somehow generate an initial guess.
subroutine, public calculate_mopac_dm(pmat, matrix_s, has_unit_metric, dft_control, particle_set, atomic_kind_set, qs_kind_set, nspin, nelectron_spin, para_env)
returns a block diagonal density matrix. Blocks correspond to the mopac initial guess.
Define the quickstep kind type and their sub types.
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 qs_ks_did_change(ks_env, s_mstruct_changed, rho_changed, potential_changed, full_reset)
tells that some of the things relevant to the ks calculation did change. has to be called when change...
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_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)
...
elemental subroutine, public charge_mixing_init(mixing_store)
initialiation needed when charge mixing is used
subroutine, public mixing_init(mixing_method, rho, mixing_store, para_env, rho_atom)
initialiation needed when gspace mixing is used
subroutine, public mixing_allocate(qs_env, mixing_method, p_mix_new, p_delta, nspins, mixing_store)
allocation needed when density mixing is used
Define the neighbor list data types and the corresponding functionality.
methods of the rho structure (defined in qs_rho_types)
subroutine, public qs_rho_update_rho(rho_struct, qs_env, rho_xc_external, local_rho_set, task_list_external, task_list_external_soft, pw_env_external, para_env_external)
updates rho_r and rho_g to the rhorho_ao. if use_kinetic_energy_density also computes tau_r and tau_g...
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...
types that represent a quickstep subsys
subroutine, public qs_subsys_get(subsys, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...
interface to tblite
subroutine, public tb_get_energy(qs_env, tb, energy)
...
types for tblite
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
contained for different pw related things
to create arrays of pools
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Contains information on the Harris method.
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.