44 dbcsr_type_antisymmetric, dbcsr_type_no_symmetry, dbcsr_type_symmetric
123#include "./base/base_uses.f90"
128 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
129 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_wf_history_methods'
145 SUBROUTINE wfs_create(snapshot)
146 TYPE(qs_wf_snapshot_type),
INTENT(OUT) :: snapshot
148 NULLIFY (snapshot%wf, snapshot%rho_r, &
149 snapshot%rho_g, snapshot%rho_ao, snapshot%rho_ao_kp, &
150 snapshot%overlap, snapshot%wf_kp, snapshot%overlap_cfm_kp, &
153 END SUBROUTINE wfs_create
166 SUBROUTINE wfs_update(snapshot, wf_history, qs_env, dt)
167 TYPE(qs_wf_snapshot_type),
POINTER :: snapshot
168 TYPE(qs_wf_history_type),
POINTER :: wf_history
169 TYPE(qs_environment_type),
POINTER :: qs_env
170 REAL(KIND=
dp),
INTENT(in),
OPTIONAL :: dt
172 CHARACTER(len=*),
PARAMETER :: routineN =
'wfs_update'
174 INTEGER :: handle, ic, igroup, ik, ikp, img, &
175 indx_ft, ispin, kplocal, nc, nimg, &
176 nkp_all, nkp_grps, nspin_kp, nspins
177 INTEGER,
DIMENSION(2) :: kp_range
178 INTEGER,
DIMENSION(:, :),
POINTER :: kp_dist
179 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
181 REAL(KIND=
dp),
DIMENSION(:, :),
POINTER :: xkp
182 TYPE(copy_info_type),
ALLOCATABLE,
DIMENSION(:, :) :: info_ft
183 TYPE(cp_fm_pool_p_type),
DIMENSION(:),
POINTER :: ao_ao_fm_pools, ao_mo_pools
184 TYPE(cp_fm_struct_type),
POINTER :: ao_ao_struct_ft
185 TYPE(cp_fm_type) :: fmdummy_ft, fmlocal_ft
186 TYPE(cp_fm_type),
POINTER :: mo_coeff
187 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_s, rho_ao
188 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s_kp, rho_ao_kp
189 TYPE(dbcsr_type),
POINTER :: cmat_ft, rmat_ft, tmpmat_ft
190 TYPE(dft_control_type),
POINTER :: dft_control
191 TYPE(kpoint_env_type),
POINTER :: kp
192 TYPE(kpoint_type),
POINTER :: kpoints
193 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
194 TYPE(mp_para_env_type),
POINTER :: para_env_ft
195 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
197 TYPE(pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g
198 TYPE(pw_env_type),
POINTER :: pw_env
199 TYPE(pw_pool_type),
POINTER :: auxbas_pw_pool
200 TYPE(pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r
201 TYPE(qs_matrix_pools_type),
POINTER :: mpools_kp
202 TYPE(qs_rho_type),
POINTER :: rho
203 TYPE(qs_scf_env_type),
POINTER :: scf_env
205 CALL timeset(routinen, handle)
207 NULLIFY (pw_env, auxbas_pw_pool, ao_mo_pools, ao_ao_fm_pools, dft_control, mos, mo_coeff, &
208 rho, rho_r, rho_g, rho_ao, matrix_s, matrix_s_kp, kpoints, kp, &
209 kp_dist, cell_to_index, xkp, sab_nl, scf_env, mpools_kp, para_env_ft, &
210 rmat_ft, cmat_ft, tmpmat_ft, ao_ao_struct_ft)
212 dft_control=dft_control, rho=rho)
213 CALL mpools_get(qs_env%mpools, ao_mo_fm_pools=ao_mo_pools)
214 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
216 cpassert(
ASSOCIATED(wf_history))
217 cpassert(
ASSOCIATED(dft_control))
218 IF (.NOT.
ASSOCIATED(snapshot))
THEN
220 CALL wfs_create(snapshot)
222 cpassert(wf_history%ref_count > 0)
224 nspins = dft_control%nspins
226 IF (
PRESENT(dt)) snapshot%dt = dt
227 IF (wf_history%store_wf)
THEN
229 IF (.NOT.
ASSOCIATED(snapshot%wf))
THEN
232 cpassert(nspins ==
SIZE(snapshot%wf))
235 CALL get_mo_set(mos(ispin), mo_coeff=mo_coeff)
242 IF (wf_history%store_rho_r)
THEN
244 cpassert(
ASSOCIATED(rho_r))
245 IF (.NOT.
ASSOCIATED(snapshot%rho_r))
THEN
246 ALLOCATE (snapshot%rho_r(nspins))
248 CALL auxbas_pw_pool%create_pw(snapshot%rho_r(ispin))
252 CALL pw_copy(rho_r(ispin), snapshot%rho_r(ispin))
254 ELSE IF (
ASSOCIATED(snapshot%rho_r))
THEN
255 DO ispin = 1,
SIZE(snapshot%rho_r)
256 CALL auxbas_pw_pool%give_back_pw(snapshot%rho_r(ispin))
258 DEALLOCATE (snapshot%rho_r)
261 IF (wf_history%store_rho_g)
THEN
263 cpassert(
ASSOCIATED(rho_g))
264 IF (.NOT.
ASSOCIATED(snapshot%rho_g))
THEN
265 ALLOCATE (snapshot%rho_g(nspins))
267 CALL auxbas_pw_pool%create_pw(snapshot%rho_g(ispin))
271 CALL pw_copy(rho_g(ispin), snapshot%rho_g(ispin))
273 ELSE IF (
ASSOCIATED(snapshot%rho_g))
THEN
274 DO ispin = 1,
SIZE(snapshot%rho_g)
275 CALL auxbas_pw_pool%give_back_pw(snapshot%rho_g(ispin))
277 DEALLOCATE (snapshot%rho_g)
280 IF (
ASSOCIATED(snapshot%rho_ao))
THEN
284 IF (wf_history%store_rho_ao)
THEN
286 cpassert(
ASSOCIATED(rho_ao))
290 ALLOCATE (snapshot%rho_ao(ispin)%matrix)
291 CALL dbcsr_copy(snapshot%rho_ao(ispin)%matrix, rho_ao(ispin)%matrix)
295 IF (
ASSOCIATED(snapshot%rho_ao_kp))
THEN
299 IF (wf_history%store_rho_ao_kp)
THEN
301 cpassert(
ASSOCIATED(rho_ao_kp))
303 nimg = dft_control%nimages
307 ALLOCATE (snapshot%rho_ao_kp(ispin, img)%matrix)
308 CALL dbcsr_copy(snapshot%rho_ao_kp(ispin, img)%matrix, &
309 rho_ao_kp(ispin, img)%matrix)
314 IF (
ASSOCIATED(snapshot%overlap))
THEN
318 IF (wf_history%store_overlap)
THEN
320 cpassert(
ASSOCIATED(matrix_s))
321 cpassert(
ASSOCIATED(matrix_s(1)%matrix))
322 ALLOCATE (snapshot%overlap)
323 CALL dbcsr_copy(snapshot%overlap, matrix_s(1)%matrix)
327 IF (
ASSOCIATED(kpoints))
THEN
328 IF (
ASSOCIATED(kpoints%kp_env))
THEN
330 IF (wf_history%store_wf_kp)
THEN
332 kplocal = kp_range(2) - kp_range(1) + 1
333 nspin_kp =
SIZE(kpoints%kp_env(1)%kpoint_env%mos, 2)
334 nc =
SIZE(kpoints%kp_env(1)%kpoint_env%mos, 1)
336 IF (
ASSOCIATED(snapshot%wf_kp))
THEN
337 DO ikp = 1,
SIZE(snapshot%wf_kp, 1)
338 DO ic = 1,
SIZE(snapshot%wf_kp, 2)
339 DO ispin = 1,
SIZE(snapshot%wf_kp, 3)
344 DEALLOCATE (snapshot%wf_kp)
347 ALLOCATE (snapshot%wf_kp(kplocal, nc, nspin_kp))
349 kp => kpoints%kp_env(ikp)%kpoint_env
350 DO ispin = 1, nspin_kp
352 CALL get_mo_set(kp%mos(ic, ispin), mo_coeff=mo_coeff)
354 mo_coeff%matrix_struct, &
356 CALL cp_fm_to_fm(mo_coeff, snapshot%wf_kp(ikp, ic, ispin))
366 IF (wf_history%store_overlap_kp)
THEN
367 CALL get_qs_env(qs_env, matrix_s_kp=matrix_s_kp, scf_env=scf_env)
368 CALL get_kpoint_info(kpoints, nkp=nkp_all, xkp=xkp, kp_range=kp_range, &
369 nkp_groups=nkp_grps, kp_dist=kp_dist, &
370 sab_nl=sab_nl, cell_to_index=cell_to_index)
371 kplocal = kp_range(2) - kp_range(1) + 1
372 para_env_ft => kpoints%blacs_env_all%para_env
375 ALLOCATE (rmat_ft, cmat_ft, tmpmat_ft)
376 CALL dbcsr_create(rmat_ft, template=matrix_s_kp(1, 1)%matrix, &
377 matrix_type=dbcsr_type_symmetric)
378 CALL dbcsr_create(cmat_ft, template=matrix_s_kp(1, 1)%matrix, &
379 matrix_type=dbcsr_type_antisymmetric)
380 CALL dbcsr_create(tmpmat_ft, template=matrix_s_kp(1, 1)%matrix, &
381 matrix_type=dbcsr_type_no_symmetry)
387 CALL mpools_get(mpools_kp, ao_ao_fm_pools=ao_ao_fm_pools)
391 IF (
ASSOCIATED(snapshot%overlap_cfm_kp))
THEN
392 DO ikp = 1,
SIZE(snapshot%overlap_cfm_kp)
395 DEALLOCATE (snapshot%overlap_cfm_kp)
397 ALLOCATE (snapshot%overlap_cfm_kp(kplocal))
402 ALLOCATE (info_ft(kplocal*nkp_grps, 2))
407 DO igroup = 1, nkp_grps
408 ik = kp_dist(1, igroup) + ikp - 1
409 my_kpgrp = (ik >= kp_range(1) .AND. ik <= kp_range(2))
410 indx_ft = indx_ft + 1
414 CALL rskp_transform(rmatrix=rmat_ft, cmatrix=cmat_ft, rsmat=matrix_s_kp, &
415 ispin=1, xkp=xkp(1:3, ik), &
416 cell_to_index=cell_to_index, sab_nl=sab_nl)
424 para_env_ft, info_ft(indx_ft, 1))
426 para_env_ft, info_ft(indx_ft, 2))
429 para_env_ft, info_ft(indx_ft, 1))
431 para_env_ft, info_ft(indx_ft, 2))
439 CALL cp_cfm_create(snapshot%overlap_cfm_kp(ikp), ao_ao_struct_ft)
441 DO igroup = 1, nkp_grps
442 ik = kp_dist(1, igroup) + ikp - 1
443 my_kpgrp = (ik >= kp_range(1) .AND. ik <= kp_range(2))
444 indx_ft = indx_ft + 1
457 DO indx_ft = 1, kplocal*nkp_grps
470 IF (wf_history%store_frozen_density)
THEN
475 CALL timestop(handle)
477 END SUBROUTINE wfs_update
491 SUBROUTINE wfi_create(wf_history, interpolation_method_nr, extrapolation_order, &
494 INTEGER,
INTENT(in) :: interpolation_method_nr, &
496 LOGICAL,
INTENT(IN) :: has_unit_metric
498 CHARACTER(len=*),
PARAMETER :: routinen =
'wfi_create'
502 CALL timeset(routinen, handle)
504 ALLOCATE (wf_history)
505 wf_history%ref_count = 1
506 wf_history%memory_depth = 0
507 wf_history%snapshot_count = 0
508 wf_history%last_state_index = 1
509 wf_history%store_wf = .false.
510 wf_history%store_rho_r = .false.
511 wf_history%store_rho_g = .false.
512 wf_history%store_rho_ao = .false.
513 wf_history%store_rho_ao_kp = .false.
514 wf_history%store_overlap = .false.
515 wf_history%store_wf_kp = .false.
516 wf_history%store_overlap_kp = .false.
517 wf_history%store_frozen_density = .false.
518 NULLIFY (wf_history%past_states)
520 wf_history%interpolation_method_nr = interpolation_method_nr
522 SELECT CASE (wf_history%interpolation_method_nr)
524 wf_history%memory_depth = 0
526 wf_history%memory_depth = 0
528 wf_history%memory_depth = 1
529 wf_history%store_rho_ao = .true.
531 wf_history%memory_depth = 1
532 wf_history%store_rho_ao = .true.
534 wf_history%memory_depth = 2
535 wf_history%store_wf = .true.
537 wf_history%memory_depth = 2
538 wf_history%store_rho_ao = .true.
540 wf_history%memory_depth = 2
541 wf_history%store_wf = .true.
542 IF (.NOT. has_unit_metric) wf_history%store_overlap = .true.
545 wf_history%memory_depth = extrapolation_order + 1
546 wf_history%store_wf = .true.
547 wf_history%store_wf_kp = .true.
548 IF (.NOT. has_unit_metric)
THEN
549 wf_history%store_overlap = .true.
550 wf_history%store_overlap_kp = .true.
553 wf_history%memory_depth = 1
554 wf_history%store_frozen_density = .true.
556 wf_history%memory_depth = extrapolation_order + 2
557 wf_history%store_wf = .true.
558 wf_history%store_wf_kp = .true.
559 IF (.NOT. has_unit_metric)
THEN
560 wf_history%store_overlap = .true.
561 wf_history%store_overlap_kp = .true.
564 wf_history%memory_depth = extrapolation_order
565 wf_history%store_wf = .true.
566 wf_history%store_overlap = .true.
568 wf_history%memory_depth = extrapolation_order
569 wf_history%store_wf = .true.
570 wf_history%store_overlap = .true.
572 CALL cp_abort(__location__, &
573 "Unknown interpolation method: "// &
577 ALLOCATE (wf_history%past_states(wf_history%memory_depth))
579 DO i = 1,
SIZE(wf_history%past_states)
580 NULLIFY (wf_history%past_states(i)%snapshot)
583 CALL timestop(handle)
598 cpassert(
ASSOCIATED(wf_history))
599 IF (wf_history%store_rho_ao)
THEN
600 wf_history%store_rho_ao_kp = .true.
601 wf_history%store_rho_ao = .false.
604 IF (wf_history%store_wf_kp)
THEN
605 wf_history%store_wf = .false.
606 wf_history%store_overlap = .false.
610 IF (wf_history%store_wf .OR. wf_history%store_overlap)
THEN
611 cpabort(
"Linear WFN-based extrapolation methods not implemented for k-points.")
614 IF (wf_history%store_frozen_density)
THEN
615 cpabort(
"Frozen density initialization method not possible for kpoints.")
629 INTEGER,
INTENT(in) :: method_nr
630 CHARACTER(len=30) :: res
633 SELECT CASE (method_nr)
639 res =
"previous_rho_r"
641 res =
"initial_guess"
651 res =
"frozen density approximation"
657 res =
"GEXT_PROJ_QTR"
659 CALL cp_abort(__location__, &
660 "Unknown interpolation method: "// &
684 REAL(kind=
dp),
INTENT(IN) :: dt
685 INTEGER,
INTENT(OUT),
OPTIONAL :: extrapolation_method_nr
686 LOGICAL,
INTENT(OUT),
OPTIONAL :: orthogonal_wf
688 CHARACTER(len=*),
PARAMETER :: routinen =
'wfi_extrapolate'
690 INTEGER :: actual_extrapolation_method_nr, handle, &
691 i, img, io_unit, ispin, k, n, nmo, &
693 LOGICAL :: do_kpoints, my_orthogonal_wf, use_overlap
694 REAL(kind=
dp) :: alpha, t0, t1, t2
695 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: coeffs
701 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_s, rho_ao, rho_frozen_ao
702 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp
707 NULLIFY (mos, ao_mo_fm_pools, t0_state, t1_state, mo_coeff, &
708 rho, rho_ao, rho_frozen_ao)
710 use_overlap = wf_history%store_overlap
712 CALL timeset(routinen, handle)
714 print_level = logger%iter_info%print_level
718 cpassert(
ASSOCIATED(wf_history))
719 cpassert(wf_history%ref_count > 0)
720 cpassert(
ASSOCIATED(qs_env))
721 CALL get_qs_env(qs_env, mos=mos, rho=rho, do_kpoints=do_kpoints)
722 CALL mpools_get(qs_env%mpools, ao_mo_fm_pools=ao_mo_fm_pools)
724 IF (wf_history%snapshot_count < 1)
THEN
727 actual_extrapolation_method_nr = wf_history%interpolation_method_nr
730 SELECT CASE (actual_extrapolation_method_nr)
732 IF (wf_history%snapshot_count < 2)
THEN
736 IF (wf_history%snapshot_count < 2)
THEN
740 IF (wf_history%snapshot_count < 2)
THEN
745 IF (
PRESENT(extrapolation_method_nr)) &
746 extrapolation_method_nr = actual_extrapolation_method_nr
747 my_orthogonal_wf = .false.
749 SELECT CASE (actual_extrapolation_method_nr)
751 cpassert(.NOT. do_kpoints)
753 cpassert(
ASSOCIATED(t0_state%rho_frozen))
755 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
756 CALL wfi_set_history_variables(qs_env=qs_env, nvec=nvec)
758 CALL qs_rho_get(t0_state%rho_frozen, rho_ao=rho_frozen_ao)
760 DO ispin = 1,
SIZE(rho_frozen_ao)
762 rho_frozen_ao(ispin)%matrix, &
763 keep_sparsity=.true.)
770 my_orthogonal_wf = .false.
773 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
774 CALL wfi_set_history_variables(qs_env=qs_env, nvec=nvec)
776 cpassert(
ASSOCIATED(t0_state%rho_ao_kp))
778 DO ispin = 1,
SIZE(t0_state%rho_ao_kp, 1)
779 DO img = 1,
SIZE(t0_state%rho_ao_kp, 2)
780 IF (img >
SIZE(rho_ao_kp, 2))
THEN
781 cpwarn(
"Change in cell neighborlist: might affect quality of initial guess")
783 CALL dbcsr_copy(rho_ao_kp(ispin, img)%matrix, &
784 t0_state%rho_ao_kp(ispin, img)%matrix, &
785 keep_sparsity=.true.)
790 cpassert(
ASSOCIATED(t0_state%rho_ao))
792 DO ispin = 1,
SIZE(t0_state%rho_ao)
794 t0_state%rho_ao(ispin)%matrix, &
795 keep_sparsity=.true.)
803 my_orthogonal_wf = .true.
804 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
805 CALL wfi_set_history_variables(qs_env=qs_env, nvec=nvec)
808 CALL wfi_use_prev_wf_kp(qs_env, io_unit, print_level)
811 DO ispin = 1,
SIZE(mos)
812 CALL get_mo_set(mos(ispin), mo_coeff=mo_coeff, nmo=nmo)
822 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
823 CALL wfi_set_history_variables(qs_env=qs_env, nvec=nvec)
825 cpassert(
ASSOCIATED(t0_state%rho_ao_kp))
827 DO ispin = 1,
SIZE(t0_state%rho_ao_kp, 1)
828 DO img = 1,
SIZE(t0_state%rho_ao_kp, 2)
829 IF (img >
SIZE(rho_ao_kp, 2))
THEN
830 cpwarn(
"Change in cell neighborlist: might affect quality of initial guess")
832 CALL dbcsr_copy(rho_ao_kp(ispin, img)%matrix, &
833 t0_state%rho_ao_kp(ispin, img)%matrix, &
834 keep_sparsity=.true.)
839 cpassert(
ASSOCIATED(t0_state%rho_ao))
841 DO ispin = 1,
SIZE(t0_state%rho_ao)
843 t0_state%rho_ao(ispin)%matrix, &
844 keep_sparsity=.true.)
858 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
859 CALL wfi_set_history_variables(qs_env=qs_env, nvec=nvec)
861 cpassert(.NOT. do_kpoints)
864 cpassert(
ASSOCIATED(t0_state))
865 cpassert(
ASSOCIATED(t1_state))
866 cpassert(
ASSOCIATED(t0_state%wf))
867 cpassert(
ASSOCIATED(t1_state%wf))
868 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
869 CALL wfi_set_history_variables(qs_env=qs_env, nvec=nvec)
871 my_orthogonal_wf = .true.
876 DO ispin = 1,
SIZE(mos)
877 CALL get_mo_set(mos(ispin), mo_coeff=mo_coeff, &
881 matrix_b=t1_state%wf(ispin), &
882 beta=(t2 - t0)/(t1 - t0))
886 beta=(t1 - t2)/(t1 - t0), matrix_b=t0_state%wf(ispin))
891 density_matrix=rho_ao(ispin)%matrix)
900 cpassert(
ASSOCIATED(t0_state))
901 cpassert(
ASSOCIATED(t1_state))
903 cpassert(
ASSOCIATED(t0_state%rho_ao_kp))
904 cpassert(
ASSOCIATED(t1_state%rho_ao_kp))
906 cpassert(
ASSOCIATED(t0_state%rho_ao))
907 cpassert(
ASSOCIATED(t1_state%rho_ao))
909 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
910 CALL wfi_set_history_variables(qs_env=qs_env, nvec=nvec)
917 DO ispin = 1,
SIZE(rho_ao_kp, 1)
918 DO img = 1,
SIZE(rho_ao_kp, 2)
919 IF (img >
SIZE(t0_state%rho_ao_kp, 2) .OR. &
920 img >
SIZE(t1_state%rho_ao_kp, 2))
THEN
921 cpwarn(
"Change in cell neighborlist: might affect quality of initial guess")
923 CALL dbcsr_add(rho_ao_kp(ispin, img)%matrix, t1_state%rho_ao_kp(ispin, img)%matrix, &
924 alpha_scalar=0.0_dp, beta_scalar=(t2 - t0)/(t1 - t0))
925 CALL dbcsr_add(rho_ao_kp(ispin, img)%matrix, t0_state%rho_ao_kp(ispin, img)%matrix, &
926 alpha_scalar=1.0_dp, beta_scalar=(t1 - t2)/(t1 - t0))
932 DO ispin = 1,
SIZE(rho_ao)
933 CALL dbcsr_add(rho_ao(ispin)%matrix, t1_state%rho_ao(ispin)%matrix, &
934 alpha_scalar=0.0_dp, beta_scalar=(t2 - t0)/(t1 - t0))
935 CALL dbcsr_add(rho_ao(ispin)%matrix, t0_state%rho_ao(ispin)%matrix, &
936 alpha_scalar=1.0_dp, beta_scalar=(t1 - t2)/(t1 - t0))
944 cpassert(.NOT. do_kpoints)
947 cpassert(
ASSOCIATED(t0_state))
948 cpassert(
ASSOCIATED(t1_state))
949 cpassert(
ASSOCIATED(t0_state%wf))
950 cpassert(
ASSOCIATED(t1_state%wf))
951 IF (wf_history%store_overlap)
THEN
952 cpassert(
ASSOCIATED(t0_state%overlap))
953 cpassert(
ASSOCIATED(t1_state%overlap))
955 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
956 IF (nvec >= wf_history%memory_depth)
THEN
957 IF ((qs_env%scf_control%max_scf_hist /= 0) .AND. (qs_env%scf_control%eps_scf_hist /= 0))
THEN
958 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
959 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
960 qs_env%scf_control%outer_scf%have_scf = .false.
961 ELSE IF (qs_env%scf_control%max_scf_hist /= 0)
THEN
962 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
963 qs_env%scf_control%outer_scf%have_scf = .false.
964 ELSE IF (qs_env%scf_control%eps_scf_hist /= 0)
THEN
965 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
969 my_orthogonal_wf = .true.
973 DO ispin = 1,
SIZE(mos)
974 NULLIFY (mo_coeff, matrix_struct, matrix_struct_new)
975 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
977 matrix_struct=matrix_struct)
979 nrow_global=k, ncol_global=k)
983 IF (use_overlap)
THEN
985 CALL parallel_gemm(
'T',
'N', k, k, n, 1.0_dp, t0_state%wf(ispin), mo_coeff, 0.0_dp, csc)
987 CALL parallel_gemm(
'T',
'N', k, k, n, 1.0_dp, t0_state%wf(ispin), &
988 t1_state%wf(ispin), 0.0_dp, csc)
990 CALL parallel_gemm(
'N',
'N', n, k, k, 1.0_dp, t0_state%wf(ispin), csc, 0.0_dp, mo_coeff)
997 density_matrix=rho_ao(ispin)%matrix)
1004 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
1006 IF (nvec >= wf_history%memory_depth)
THEN
1007 IF ((qs_env%scf_control%max_scf_hist /= 0) .AND. (qs_env%scf_control%eps_scf_hist /= 0))
THEN
1008 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1009 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1010 qs_env%scf_control%outer_scf%have_scf = .false.
1011 ELSE IF (qs_env%scf_control%max_scf_hist /= 0)
THEN
1012 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1013 qs_env%scf_control%outer_scf%have_scf = .false.
1014 ELSE IF (qs_env%scf_control%eps_scf_hist /= 0)
THEN
1015 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1019 IF (do_kpoints)
THEN
1020 CALL wfi_extrapolate_ps_aspc_kp(wf_history, qs_env, nvec, io_unit, print_level)
1021 my_orthogonal_wf = .true.
1023 my_orthogonal_wf = .true.
1024 DO ispin = 1,
SIZE(mos)
1025 NULLIFY (mo_coeff, matrix_struct, matrix_struct_new)
1026 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
1028 matrix_struct=matrix_struct)
1031 nrow_global=k, ncol_global=k)
1042 IF (use_overlap)
THEN
1044 CALL parallel_gemm(
'T',
'N', k, k, n, 1.0_dp, t0_state%wf(ispin), fm_tmp, 0.0_dp, csc)
1046 CALL parallel_gemm(
'T',
'N', k, k, n, 1.0_dp, t0_state%wf(ispin), &
1047 t1_state%wf(ispin), 0.0_dp, csc)
1049 CALL parallel_gemm(
'N',
'N', n, k, k, 1.0_dp, t0_state%wf(ispin), csc, 0.0_dp, fm_tmp)
1050 alpha = -1.0_dp*alpha*real(nvec - i + 1,
dp)/real(i,
dp)
1057 v_matrix=mo_coeff, &
1060 density_matrix=rho_ao(ispin)%matrix)
1070 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
1072 IF (nvec >= wf_history%memory_depth)
THEN
1073 IF ((qs_env%scf_control%max_scf_hist /= 0) .AND. &
1074 (qs_env%scf_control%eps_scf_hist /= 0))
THEN
1075 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1076 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1077 qs_env%scf_control%outer_scf%have_scf = .false.
1078 ELSE IF (qs_env%scf_control%max_scf_hist /= 0)
THEN
1079 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1080 qs_env%scf_control%outer_scf%have_scf = .false.
1081 ELSE IF (qs_env%scf_control%eps_scf_hist /= 0)
THEN
1082 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1086 IF (do_kpoints)
THEN
1087 CALL wfi_extrapolate_ps_aspc_kp(wf_history, qs_env, nvec, io_unit, print_level)
1088 my_orthogonal_wf = .true.
1090 my_orthogonal_wf = .true.
1092 DO ispin = 1,
SIZE(mos)
1093 NULLIFY (mo_coeff, matrix_struct, matrix_struct_new)
1094 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
1098 matrix_struct=matrix_struct)
1099 CALL cp_fm_create(fm_tmp, matrix_struct, set_zero=.true.)
1101 template_fmstruct=matrix_struct, &
1104 CALL cp_fm_create(csc, matrix_struct_new, set_zero=.true.)
1110 alpha = real(4*nvec - 2, kind=
dp)/real(nvec + 1, kind=
dp)
1112 WRITE (unit=io_unit, fmt=
"(/,T2,A,/,/,T3,A,I0,/,/,T3,A2,I0,A4,F10.6)") &
1113 "Parameters for the always stable predictor-corrector (ASPC) method:", &
1114 "ASPC order: ", max(nvec - 2, 0), &
1115 "B(", 1,
") = ", alpha
1121 IF (use_overlap)
THEN
1123 CALL parallel_gemm(
'T',
'N', k, k, n, 1.0_dp, t0_state%wf(ispin), fm_tmp, 0.0_dp, csc)
1125 CALL parallel_gemm(
'T',
'N', k, k, n, 1.0_dp, t0_state%wf(ispin), &
1126 t1_state%wf(ispin), 0.0_dp, csc)
1128 CALL parallel_gemm(
'N',
'N', n, k, k, 1.0_dp, t0_state%wf(ispin), csc, 0.0_dp, fm_tmp)
1129 alpha = (-1.0_dp)**(i + 1)*real(i, kind=
dp)* &
1132 WRITE (unit=io_unit, fmt=
"(T3,A2,I0,A4,F10.6)") &
1133 "B(", i,
") = ", alpha
1140 v_matrix=mo_coeff, &
1143 density_matrix=rho_ao(ispin)%matrix)
1150 cpassert(.NOT. do_kpoints)
1153 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
1154 IF (nvec >= wf_history%memory_depth)
THEN
1155 IF ((qs_env%scf_control%max_scf_hist /= 0) .AND. &
1156 (qs_env%scf_control%eps_scf_hist /= 0))
THEN
1157 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1158 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1159 qs_env%scf_control%outer_scf%have_scf = .false.
1160 ELSE IF (qs_env%scf_control%max_scf_hist /= 0)
THEN
1161 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1162 qs_env%scf_control%outer_scf%have_scf = .false.
1163 ELSE IF (qs_env%scf_control%eps_scf_hist /= 0)
THEN
1164 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1170 ALLOCATE (coeffs(nvec))
1173 CALL diff_fitting(wf_history, matrix_s(1)%matrix, coeffs, nvec, &
1174 1e-4_dp, io_unit, print_level)
1176 my_orthogonal_wf = .true.
1178 DO ispin = 1,
SIZE(mos)
1179 NULLIFY (mo_coeff, matrix_struct, matrix_struct_new)
1180 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
1184 matrix_struct=matrix_struct)
1187 template_fmstruct=matrix_struct, &
1200 CALL parallel_gemm(
'T',
'N', k, k, n, 1.0_dp, t0_state%wf(ispin), fm_tmp, 0.0_dp, csc)
1201 CALL parallel_gemm(
'N',
'N', n, k, k, 1.0_dp, t0_state%wf(ispin), csc, 0.0_dp, fm_tmp)
1207 v_matrix=mo_coeff, &
1210 density_matrix=rho_ao(ispin)%matrix)
1218 cpassert(.NOT. do_kpoints)
1221 nvec = min(wf_history%memory_depth, wf_history%snapshot_count)
1222 IF (nvec >= wf_history%memory_depth)
THEN
1223 IF ((qs_env%scf_control%max_scf_hist /= 0) .AND. &
1224 (qs_env%scf_control%eps_scf_hist /= 0))
THEN
1225 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1226 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1227 qs_env%scf_control%outer_scf%have_scf = .false.
1228 ELSE IF (qs_env%scf_control%max_scf_hist /= 0)
THEN
1229 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1230 qs_env%scf_control%outer_scf%have_scf = .false.
1231 ELSE IF (qs_env%scf_control%eps_scf_hist /= 0)
THEN
1232 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1238 ALLOCATE (coeffs(nvec))
1241 CALL tr_fitting(wf_history, matrix_s(1)%matrix, coeffs, nvec, &
1242 1e-4_dp, io_unit, print_level)
1244 my_orthogonal_wf = .true.
1246 DO ispin = 1,
SIZE(mos)
1247 NULLIFY (mo_coeff, matrix_struct, matrix_struct_new)
1248 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
1252 matrix_struct=matrix_struct)
1255 template_fmstruct=matrix_struct, &
1268 CALL parallel_gemm(
'T',
'N', k, k, n, 1.0_dp, t0_state%wf(ispin), fm_tmp, 0.0_dp, csc)
1269 CALL parallel_gemm(
'N',
'N', n, k, k, 1.0_dp, t0_state%wf(ispin), csc, 0.0_dp, fm_tmp)
1275 v_matrix=mo_coeff, &
1278 density_matrix=rho_ao(ispin)%matrix)
1286 CALL cp_abort(__location__, &
1287 "Unknown interpolation method: "// &
1288 trim(adjustl(
cp_to_string(wf_history%interpolation_method_nr))))
1290 IF (
PRESENT(orthogonal_wf)) orthogonal_wf = my_orthogonal_wf
1292 "DFT%SCF%PRINT%PROGRAM_RUN_INFO")
1293 CALL timestop(handle)
1303 SUBROUTINE wfi_use_prev_wf_kp(qs_env, io_unit, print_level)
1305 INTEGER,
INTENT(IN) :: io_unit, print_level
1307 CHARACTER(len=*),
PARAMETER :: routinen =
'wfi_use_prev_wf_kp'
1309 COMPLEX(KIND=dp),
ALLOCATABLE,
DIMENSION(:) :: col_scaling
1310 INTEGER :: chol_info, handle, igroup, ik, ikp, &
1311 indx, ispin, j, kplocal, nao, nkp, &
1312 nkp_groups, nmo, nspin
1313 INTEGER,
DIMENSION(2) :: kp_range
1314 INTEGER,
DIMENSION(:, :),
POINTER :: kp_dist
1315 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
1316 LOGICAL :: my_kpgrp, use_real_wfn
1317 REAL(kind=
dp) :: eval_thresh
1318 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigenvalues
1319 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: xkp
1321 TYPE(
cp_cfm_type) :: cfm_evecs, cfm_mhalf, cfm_nao_nmo_work, &
1323 TYPE(
cp_cfm_type),
ALLOCATABLE,
DIMENSION(:) :: csmat_cur
1327 TYPE(
cp_fm_type),
POINTER :: imos, mo_coeff, rmos
1328 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s_kp, rho_ao_kp
1329 TYPE(
dbcsr_type),
POINTER :: cmatrix_db, rmatrix, tmpmat
1341 CALL timeset(routinen, handle)
1343 NULLIFY (kpoints, dft_control, matrix_s_kp, scf_env, scf_control, rho, sab_nl, kp, mo_coeff, rmos, imos)
1345 CALL get_qs_env(qs_env, kpoints=kpoints, dft_control=dft_control, &
1346 matrix_s_kp=matrix_s_kp, scf_env=scf_env, &
1347 scf_control=scf_control, rho=rho)
1348 CALL get_kpoint_info(kpoints, nkp=nkp, xkp=xkp, use_real_wfn=use_real_wfn, &
1349 kp_range=kp_range, nkp_groups=nkp_groups, kp_dist=kp_dist, &
1350 sab_nl=sab_nl, cell_to_index=cell_to_index)
1351 kplocal = kp_range(2) - kp_range(1) + 1
1353 IF (use_real_wfn)
THEN
1354 CALL timestop(handle)
1358 kp => kpoints%kp_env(1)%kpoint_env
1359 nspin =
SIZE(kp%mos, 2)
1360 CALL get_mo_set(kp%mos(1, 1), nao=nao, nmo=nmo, mo_coeff=mo_coeff)
1363 WRITE (unit=io_unit, fmt=
"(/,T2,A)") &
1364 "Using previous wavefunctions as initial guess for k-points (with reorthogonalization)"
1368 ALLOCATE (rmatrix, cmatrix_db, tmpmat)
1369 CALL dbcsr_create(rmatrix, template=matrix_s_kp(1, 1)%matrix, matrix_type=dbcsr_type_symmetric)
1370 CALL dbcsr_create(cmatrix_db, template=matrix_s_kp(1, 1)%matrix, matrix_type=dbcsr_type_antisymmetric)
1371 CALL dbcsr_create(tmpmat, template=matrix_s_kp(1, 1)%matrix, matrix_type=dbcsr_type_no_symmetry)
1376 CALL mpools_get(mpools_kp, ao_ao_fm_pools=ao_ao_fm_pools_kp)
1381 CALL cp_cfm_create(cfm_nao_nmo_work, mo_coeff%matrix_struct)
1383 NULLIFY (nmo_nmo_struct)
1385 nrow_global=nmo, ncol_global=nmo)
1389 para_env => kpoints%blacs_env_all%para_env
1390 ALLOCATE (info(kplocal*nkp_groups, 2))
1392 ALLOCATE (csmat_cur(kplocal))
1400 DO igroup = 1, nkp_groups
1401 ik = kp_dist(1, igroup) + ikp - 1
1402 my_kpgrp = (ik >= kp_range(1) .AND. ik <= kp_range(2))
1407 CALL rskp_transform(rmatrix=rmatrix, cmatrix=cmatrix_db, rsmat=matrix_s_kp, &
1408 ispin=1, xkp=xkp(1:3, ik), cell_to_index=cell_to_index, sab_nl=sab_nl)
1427 DO igroup = 1, nkp_groups
1428 ik = kp_dist(1, igroup) + ikp - 1
1429 my_kpgrp = (ik >= kp_range(1) .AND. ik <= kp_range(2))
1440 DO indx = 1, kplocal*nkp_groups
1446 ALLOCATE (eigenvalues(nmo))
1447 eval_thresh = 1.0e-12_dp
1450 kp => kpoints%kp_env(ikp)%kpoint_env
1452 CALL get_mo_set(kp%mos(1, ispin), mo_coeff=rmos)
1453 CALL get_mo_set(kp%mos(2, ispin), mo_coeff=imos)
1457 csmat_cur(ikp), cmos_new,
z_zero, cfm_nao_nmo_work)
1459 cmos_new, cfm_nao_nmo_work,
z_zero, csc_cfm)
1462 IF (chol_info == 0)
THEN
1470 ALLOCATE (col_scaling(nmo))
1472 IF (eigenvalues(j) > eval_thresh)
THEN
1473 col_scaling(j) = cmplx(1.0_dp/sqrt(eigenvalues(j)), 0.0_dp, kind=
dp)
1479 DEALLOCATE (col_scaling)
1489 DEALLOCATE (eigenvalues)
1496 matrix_s_kp(1, 1)%matrix, sab_nl, scf_env%scf_work1)
1504 DEALLOCATE (csmat_cur)
1514 CALL timestop(handle)
1515 END SUBROUTINE wfi_use_prev_wf_kp
1528 SUBROUTINE wfi_extrapolate_ps_aspc_kp(wf_history, qs_env, nvec, io_unit, print_level)
1531 INTEGER,
INTENT(IN) :: nvec, io_unit, print_level
1533 CHARACTER(len=*),
PARAMETER :: routinen =
'wfi_extrapolate_ps_aspc_kp'
1535 INTEGER :: handle, i, ikp, ispin, kplocal, &
1536 method_nr, nao, nmo, nspin
1537 INTEGER,
DIMENSION(2) :: kp_range
1538 LOGICAL :: use_real_wfn
1539 REAL(kind=
dp) :: alpha_coeff
1540 TYPE(
cp_cfm_type) :: cfm_nao_nmo_work, cmos_1, cmos_i, &
1543 TYPE(
cp_fm_type),
POINTER :: imos, mo_coeff, rmos
1548 method_nr = wf_history%interpolation_method_nr
1550 CALL timeset(routinen, handle)
1551 NULLIFY (kpoints, kp, mo_coeff, rmos, imos, t0_state, t1_state, nmo_nmo_struct)
1554 CALL get_kpoint_info(kpoints, use_real_wfn=use_real_wfn, kp_range=kp_range)
1555 kplocal = kp_range(2) - kp_range(1) + 1
1557 IF (use_real_wfn)
THEN
1559 CALL cp_warn(__location__,
"ASPC with k-points requires complex wavefunctions; "// &
1560 "falling back to USE_PREV_WF.")
1562 CALL cp_warn(__location__,
"PS with k-points requires complex wavefunctions; "// &
1563 "falling back to USE_PREV_WF.")
1565 CALL wfi_use_prev_wf_kp(qs_env, io_unit, print_level)
1566 CALL timestop(handle)
1570 kp => kpoints%kp_env(1)%kpoint_env
1571 nspin =
SIZE(kp%mos, 2)
1572 CALL get_mo_set(kp%mos(1, 1), nao=nao, nmo=nmo, mo_coeff=mo_coeff)
1576 WRITE (unit=io_unit, fmt=
"(/,T2,A,/,T3,A,I0)") &
1577 "Parameters for the always stable predictor-corrector (ASPC) method:", &
1578 "ASPC order: ", max(nvec - 2, 0)
1583 CALL cp_cfm_create(cmos_new, mo_coeff%matrix_struct, set_zero=.true.)
1584 CALL cp_cfm_create(cmos_1, mo_coeff%matrix_struct, set_zero=.true.)
1585 CALL cp_cfm_create(cmos_i, mo_coeff%matrix_struct, set_zero=.true.)
1586 CALL cp_cfm_create(cfm_nao_nmo_work, mo_coeff%matrix_struct, set_zero=.true.)
1591 CALL cp_cfm_create(cfm_nao_nmo_work, mo_coeff%matrix_struct)
1595 nrow_global=nmo, ncol_global=nmo)
1597 CALL cp_cfm_create(csc_cfm, nmo_nmo_struct, set_zero=.true.)
1606 alpha_coeff = real(4*nvec - 2, kind=
dp)/real(nvec + 1, kind=
dp)
1608 WRITE (unit=io_unit, fmt=
"(T3,A2,I0,A4,F10.6)")
"B(", 1,
") = ", alpha_coeff
1615 kp => kpoints%kp_env(ikp)%kpoint_env
1617 CALL get_mo_set(kp%mos(1, ispin), mo_coeff=rmos)
1618 CALL get_mo_set(kp%mos(2, ispin), mo_coeff=imos)
1619 CALL cp_fm_to_fm(t1_state%wf_kp(ikp, 1, ispin), rmos)
1620 CALL cp_fm_to_fm(t1_state%wf_kp(ikp, 2, ispin), imos)
1630 alpha_coeff = (-1.0_dp)**(i + 1)*real(i, kind=
dp)* &
1633 WRITE (unit=io_unit, fmt=
"(T3,A2,I0,A4,F10.6)")
"B(", i,
") = ", alpha_coeff
1636 alpha_coeff = -1.0_dp*alpha_coeff*real(nvec - i + 1,
dp)/real(i,
dp)
1640 kp => kpoints%kp_env(ikp)%kpoint_env
1642 CALL cp_fm_to_cfm(t1_state%wf_kp(ikp, 1, ispin), t1_state%wf_kp(ikp, 2, ispin), cmos_1)
1643 CALL cp_fm_to_cfm(t0_state%wf_kp(ikp, 1, ispin), t0_state%wf_kp(ikp, 2, ispin), cmos_i)
1647 t0_state%overlap_cfm_kp(ikp), cmos_1,
z_zero, cfm_nao_nmo_work)
1649 cmos_i, cfm_nao_nmo_work,
z_zero, csc_cfm)
1651 cmos_i, csc_cfm,
z_zero, cfm_nao_nmo_work)
1653 CALL get_mo_set(kp%mos(1, ispin), mo_coeff=rmos)
1654 CALL get_mo_set(kp%mos(2, ispin), mo_coeff=imos)
1671 CALL wfi_use_prev_wf_kp(qs_env, 0, print_level)
1673 CALL timestop(handle)
1675 END SUBROUTINE wfi_extrapolate_ps_aspc_kp
1686 ELEMENTAL SUBROUTINE wfi_set_history_variables(qs_env, nvec)
1688 INTEGER,
INTENT(IN) :: nvec
1690 IF (nvec >= qs_env%wf_history%memory_depth)
THEN
1691 IF ((qs_env%scf_control%max_scf_hist /= 0) .AND. (qs_env%scf_control%eps_scf_hist /= 0))
THEN
1692 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1693 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1694 qs_env%scf_control%outer_scf%have_scf = .false.
1695 ELSE IF (qs_env%scf_control%max_scf_hist /= 0)
THEN
1696 qs_env%scf_control%max_scf = qs_env%scf_control%max_scf_hist
1697 qs_env%scf_control%outer_scf%have_scf = .false.
1698 ELSE IF (qs_env%scf_control%eps_scf_hist /= 0)
THEN
1699 qs_env%scf_control%eps_scf = qs_env%scf_control%eps_scf_hist
1700 qs_env%scf_control%outer_scf%eps_scf = qs_env%scf_control%eps_scf_hist
1704 END SUBROUTINE wfi_set_history_variables
1718 REAL(kind=
dp),
INTENT(in) :: dt
1720 cpassert(
ASSOCIATED(wf_history))
1721 cpassert(wf_history%ref_count > 0)
1722 cpassert(
ASSOCIATED(qs_env))
1724 wf_history%snapshot_count = wf_history%snapshot_count + 1
1725 IF (wf_history%memory_depth > 0)
THEN
1726 wf_history%last_state_index =
modulo(wf_history%snapshot_count, &
1727 wf_history%memory_depth) + 1
1728 CALL wfs_update(snapshot=wf_history%past_states &
1729 (wf_history%last_state_index)%snapshot, wf_history=wf_history, &
1730 qs_env=qs_env, dt=dt)
1746 INTEGER,
INTENT(in),
OPTIONAL :: n_col
1748 CHARACTER(len=*),
PARAMETER :: routinen =
'reorthogonalize_vectors'
1750 INTEGER :: handle, my_n_col
1751 LOGICAL :: has_unit_metric, &
1752 ortho_contains_cholesky, &
1761 NULLIFY (scf_env, scf_control, maxao_maxmo_fm_pool, matrix_s, mpools, dft_control)
1762 CALL timeset(routinen, handle)
1764 cpassert(
ASSOCIATED(qs_env))
1767 IF (
PRESENT(n_col)) my_n_col = n_col
1770 scf_control=scf_control, &
1771 matrix_s=matrix_s, &
1772 dft_control=dft_control)
1773 CALL mpools_get(mpools, maxao_maxmo_fm_pool=maxao_maxmo_fm_pool)
1774 IF (
ASSOCIATED(scf_env))
THEN
1775 ortho_contains_cholesky = (scf_env%method /=
ot_method_nr) .AND. &
1776 (scf_env%cholesky_method > 0) .AND. &
1777 ASSOCIATED(scf_env%ortho)
1779 ortho_contains_cholesky = .false.
1782 CALL get_qs_env(qs_env, has_unit_metric=has_unit_metric)
1783 smearing_is_used = .false.
1784 IF (dft_control%smear)
THEN
1785 smearing_is_used = .true.
1788 IF (has_unit_metric)
THEN
1790 ELSE IF (smearing_is_used)
THEN
1792 matrix_s=matrix_s(1)%matrix)
1793 ELSE IF (ortho_contains_cholesky)
THEN
1795 ortho=scf_env%ortho)
1799 CALL timestop(handle)
1813 CHARACTER(len=*),
PARAMETER :: routinen =
'wfi_purge_history'
1815 INTEGER :: handle, io_unit, print_level
1820 NULLIFY (dft_control, wf_history)
1822 CALL timeset(routinen, handle)
1824 print_level = logger%iter_info%print_level
1826 extension=
".scfLog")
1828 cpassert(
ASSOCIATED(qs_env))
1829 cpassert(
ASSOCIATED(qs_env%wf_history))
1830 cpassert(qs_env%wf_history%ref_count > 0)
1831 CALL get_qs_env(qs_env, dft_control=dft_control)
1833 SELECT CASE (qs_env%wf_history%interpolation_method_nr)
1841 IF (qs_env%wf_history%snapshot_count >= 2)
THEN
1842 IF (debug_this_module .AND. io_unit > 0) &
1843 WRITE (io_unit, fmt=
"(T2,A)")
"QS| Purging WFN history"
1844 CALL wfi_create(wf_history, interpolation_method_nr= &
1845 dft_control%qs_control%wf_interpolation_method_nr, &
1846 extrapolation_order=dft_control%qs_control%wf_extrapolation_order, &
1847 has_unit_metric=qs_env%has_unit_metric)
1849 wf_history=wf_history)
1851 CALL wfi_update(qs_env%wf_history, qs_env=qs_env, dt=1.0_dp)
1854 cpabort(
"Unknown extrapolation method.")
1856 CALL timestop(handle)
1876 SUBROUTINE diff_fitting(wf_history, current_overlap, coeffs, nvec, eps, io_unit, print_level)
1878 TYPE(
dbcsr_type),
INTENT(IN) :: current_overlap
1879 INTEGER,
INTENT(IN) :: nvec
1880 REAL(kind=
dp),
INTENT(OUT) :: coeffs(nvec)
1881 REAL(kind=
dp),
INTENT(IN) :: eps
1882 INTEGER,
INTENT(IN) :: io_unit, print_level
1884 INTEGER :: i, info, j
1885 REAL(kind=
dp) :: error
1886 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: b
1887 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: a
1888 TYPE(
dbcsr_type) :: target_diff, tmp_i, tmp_j, tmp_k
1892 cpabort(
"Not enough vectors to do the fitting")
1893 ELSE IF (nvec == 1)
THEN
1898 ALLOCATE (a(nvec - 1, nvec - 1), b(nvec - 1))
1904 CALL dbcsr_copy(target_diff, current_overlap)
1905 CALL dbcsr_add(target_diff, ref_state%overlap, 1.0_dp, -1.0_dp)
1914 CALL dbcsr_add(tmp_i, ref_state%overlap, 1.0_dp, -1.0_dp)
1915 CALL dbcsr_multiply(
"N",
"N", 1.0_dp, tmp_i, target_diff, 0.0_dp, tmp_k)
1921 CALL dbcsr_add(tmp_j, ref_state%overlap, 1.0_dp, -1.0_dp)
1922 CALL dbcsr_multiply(
"N",
"N", 1.0_dp, tmp_i, tmp_j, 0.0_dp, tmp_k)
1924 a(i - 1, j - 1) = a(j - 1, i - 1)
1930 a(i, i) = a(i, i) + eps**2
1934 CALL dposv(
'u', nvec - 1, 1, a, nvec - 1, b, nvec - 1, info)
1936 cpabort(
"DPOSV failed.")
1940 coeffs(1) = 1.0_dp - sum(b)
1941 coeffs(2:nvec) = b(:)
1949 CALL dbcsr_add(tmp_i, state%overlap, 1.0_dp, -coeffs(i))
1952 IF (io_unit > 0)
THEN
1953 WRITE (unit=io_unit, fmt=
"(/,T2,A,F20.10)")
"GEXT overlap fitting error:", error
1964 END SUBROUTINE diff_fitting
1983 SUBROUTINE tr_fitting(wf_history, current_overlap, coeffs, nvec, eps, io_unit, print_level)
1985 TYPE(
dbcsr_type),
INTENT(IN) :: current_overlap
1986 INTEGER,
INTENT(IN) :: nvec
1987 REAL(kind=
dp),
INTENT(OUT) :: coeffs(nvec)
1988 REAL(kind=
dp),
INTENT(IN) :: eps
1989 INTEGER,
INTENT(IN) :: io_unit, print_level
1991 INTEGER :: i, info, j, ntr
1992 REAL(kind=
dp) :: error
1993 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: b
1994 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: a
1995 TYPE(
dbcsr_type) :: target_overlap, tmp_i, tmp_j, tmp_k
1999 cpabort(
"Not enough vectors to do the fitting")
2000 ELSE IF (nvec == 1)
THEN
2005 IF (mod(nvec, 2) == 0)
THEN
2011 ALLOCATE (a(ntr, ntr), b(ntr))
2017 CALL dbcsr_copy(target_overlap, current_overlap)
2018 CALL dbcsr_add(target_overlap, ref_state%overlap, 1.0_dp, 1.0_dp)
2028 CALL dbcsr_add(tmp_i, state%overlap, 1.0_dp, 1.0_dp)
2037 CALL dbcsr_add(tmp_j, state%overlap, 1.0_dp, 1.0_dp)
2038 CALL dbcsr_multiply(
"N",
"N", 1.0_dp, tmp_i, tmp_j, 0.0_dp, tmp_k)
2046 a(i, i) = a(i, i) + eps**2
2050 CALL dposv(
'u', ntr, 1, a, ntr, b, ntr, info)
2052 cpabort(
"DPOSV failed.")
2057 coeffs(nvec) = -1.0_dp
2059 coeffs(i) = coeffs(i) + b(i)
2060 coeffs(nvec - i) = coeffs(nvec - i) + b(i)
2069 CALL dbcsr_add(tmp_i, state%overlap, 1.0_dp, -coeffs(i))
2072 IF (io_unit > 0)
THEN
2073 WRITE (unit=io_unit, fmt=
"(/,T2,A,F20.10)")
"GEXT overlap fitting error:", error
2084 END SUBROUTINE tr_fitting
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public vandevondele2005a
integer, save, public kuhne2007
integer, save, public kolafa2004
Basic linear algebra operations for complex full matrices.
subroutine, public cp_cfm_scale_and_add(alpha, matrix_a, beta, matrix_b)
Scale and add two BLACS matrices (a = alpha*a + beta*b).
subroutine, public cp_cfm_gemm(transa, transb, m, n, k, alpha, matrix_a, matrix_b, beta, matrix_c, a_first_col, a_first_row, b_first_col, b_first_row, c_first_col, c_first_row)
Performs one of the matrix-matrix operations: matrix_c = alpha * op1( matrix_a ) * op2( matrix_b ) + ...
subroutine, public cp_cfm_scale_and_add_fm(alpha, matrix_a, beta, matrix_b)
Scale and add two BLACS matrices (a = alpha*a + beta*b). where b is a real matrix (adapted from cp_cf...
subroutine, public cp_cfm_triangular_multiply(triangular_matrix, matrix_b, side, transa_tr, invert_tr, uplo_tr, unit_diag_tr, n_rows, n_cols, alpha)
Multiplies in place by a triangular matrix: matrix_b = alpha op(triangular_matrix) matrix_b or (if si...
subroutine, public cp_cfm_column_scale(matrix_a, scaling)
Scales columns of the full matrix by corresponding factors.
various cholesky decomposition related routines
subroutine, public cp_cfm_cholesky_decompose(matrix, n, info_out)
Used to replace a symmetric positive definite matrix M with its Cholesky decomposition U: M = U^T * U...
used for collecting diagonalization schemes available for cp_cfm_type
subroutine, public cp_cfm_heevd(matrix, eigenvectors, eigenvalues)
Perform a diagonalisation of a complex matrix.
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_release(matrix)
Releases a full matrix.
subroutine, public cp_fm_to_cfm(msourcer, msourcei, mtarget)
Construct a complex full matrix by taking its real and imaginary parts from two separate real-value f...
subroutine, public cp_cfm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
Creates a new full matrix with the given structure.
subroutine, public cp_cfm_set_all(matrix, alpha, beta)
Set all elements of the full matrix to alpha. Besides, set all diagonal matrix elements to beta (if g...
subroutine, public cp_cfm_to_fm(msource, mtargetr, mtargeti)
Copy real and imaginary parts of a complex full matrix into separate real-value full matrices.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
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_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
subroutine, public dbcsr_trace(matrix, trace)
Computes the trace of the given matrix, also known as the sum of its diagonal elements.
real(dp) function, public dbcsr_frobenius_norm(matrix)
Compute the frobenius norm of a dbcsr matrix.
Routines that link DBCSR and CP2K concepts together.
subroutine, public cp_dbcsr_alloc_block_from_nbl(matrix, sab_orb, desymmetrize)
allocate the blocks of a dbcsr based on the neighbor list
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_sm_fm_multiply(matrix, fm_in, fm_out, ncol, alpha, beta)
multiply a dbcsr with a fm matrix
subroutine, public copy_dbcsr_to_fm(matrix, fm)
Copy a DBCSR matrix to a BLACS matrix.
Basic linear algebra operations for full matrices.
subroutine, public cp_fm_scale_and_add(alpha, matrix_a, beta, matrix_b)
calc A <- alpha*A + beta*B optimized for alpha == 1.0 (just add beta*B) and beta == 0....
subroutine, public cp_fm_scale(alpha, matrix_a)
scales a matrix matrix_a = alpha * matrix_b
pool for for elements that are retained and released
subroutine, public fm_pool_create_fm(pool, element, name)
returns an element, allocating it if none is in the pool
subroutine, public fm_pool_give_back_fm(pool, element)
returns the element to the pool
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_start_copy_general(source, destination, para_env, info)
Initiates the copy operation: get distribution data, post MPI isend and irecvs.
subroutine, public cp_fm_cleanup_copy_general(info)
Completes the copy operation: wait for comms clean up MPI state.
subroutine, public cp_fm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp, nrow, ncol, set_zero)
creates a new full matrix with the given structure
subroutine, public cp_fm_set_all(matrix, alpha, beta)
set all elements of a matrix to the same value, and optionally the diagonal to a different one
subroutine, public cp_fm_finish_copy_general(destination, info)
Completes the copy operation: wait for comms, unpack, clean up MPI state.
various routines to log and control the output. The idea is that decisions about where to log should ...
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)
...
integer, parameter, public low_print_level
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,...
Defines the basic variable types.
integer, parameter, public dp
Routines needed for kpoint calculation.
subroutine, public rskp_transform(rmatrix, cmatrix, rsmat, ispin, xkp, cell_to_index, sab_nl, is_complex, rs_sign)
Transformation of real space matrices to a kpoint.
subroutine, public kpoint_density_transform(kpoint, denmat, wtype, tempmat, sab_nl, fmwork, for_aux_fit, pmat_ext)
generate real space density matrices in DBCSR format
subroutine, public kpoint_density_matrices(kpoint, energy_weighted, for_aux_fit)
Calculate kpoint density matrices (rho(k), owned by kpoint groups)
subroutine, public kpoint_set_mo_occupation(kpoint, smear, probe)
Given the eigenvalues of all kpoints, calculates the occupation numbers.
Types and basic routines needed for a kpoint calculation.
subroutine, public get_kpoint_info(kpoint, kp_scheme, nkp_grid, kp_shift, symmetry, verbose, full_grid, use_real_wfn, eps_geo, parallel_group_size, kp_range, nkp, xkp, wkp, para_env, blacs_env_all, para_env_kp, para_env_inter_kp, blacs_env, kp_env, kp_aux_env, mpools, iogrp, nkp_groups, kp_dist, cell_to_index, index_to_cell, sab_nl, sab_nl_nosym, inversion_symmetry_only, symmetry_backend, symmetry_reduction_method)
Retrieve information from a kpoint environment.
Definition of mathematical constants and functions.
complex(kind=dp), parameter, public z_one
complex(kind=dp), parameter, public gaussi
complex(kind=dp), parameter, public z_zero
Collection of simple mathematical functions and subroutines.
elemental real(kind=dp) function, public binomial(n, k)
The binomial coefficient n over k for 0 <= k <= n is calculated, otherwise zero is returned.
Interface to the message passing library MPI.
basic linear algebra operations for full matrixes
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 ...
collects routines that calculate density matrices
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 set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, mimic, ewald_env, ewald_pw, mpools, rho_external, external_vxc, mask, scf_control, rel_control, qs_charges, ks_env, ks_qmmm_env, wf_history, scf_env, active_space, input, oce, rho_atom_set, rho0_atom_set, rho0_mpole, run_rtp, rtp, rhoz_set, rhoz_tot, ecoul_1c, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, efield, rhoz_cneo_set, linres_control, xas_env, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, ls_scf_env, do_transport, transport_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, harris_env, gcp_env, mp2_env, bs_env, kg_env, force, kpoints, wanniercentres, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Set the QUICKSTEP environment.
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...
wrapper for the pools of matrixes
subroutine, public mpools_get(mpools, ao_mo_fm_pools, ao_ao_fm_pools, mo_mo_fm_pools, ao_mosub_fm_pools, mosub_mosub_fm_pools, maxao_maxmo_fm_pool, maxao_maxao_fm_pool, maxmo_maxmo_fm_pool)
returns various attributes of the mpools (notably the pools contained in it)
collects routines that perform operations directly related to MOs
subroutine, public make_basis_simple(vmatrix, ncol)
given a set of vectors, return an orthogonal (C^T C == 1) set spanning the same space (notice,...
subroutine, public make_basis_lowdin(vmatrix, ncol, matrix_s)
return a set of S orthonormal vectors (C^T S C == 1) where a Loedwin transformation is applied to kee...
subroutine, public make_basis_cholesky(vmatrix, ncol, ortho)
return a set of S orthonormal vectors (C^T S C == 1) where the cholesky decomposed form of S is passe...
subroutine, public make_basis_sm(vmatrix, ncol, matrix_s)
returns an S-orthonormal basis v (v^T S v ==1)
Definition and initialisation of the mo data type.
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.
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_set(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)
...
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
integer, parameter, public ot_method_nr
Storage of past states of the qs_env. Methods to interpolate (or actually normally extrapolate) the n...
subroutine, public wfi_create_for_kp(wf_history)
Adapts wf_history storage flags for k-point calculations. For ASPC, switches from Gamma WFN storage t...
subroutine, public wfi_purge_history(qs_env)
purges wf_history retaining only the latest snapshot
character(len=30) function, public wfi_get_method_label(method_nr)
returns a string describing the interpolation method
subroutine, public reorthogonalize_vectors(qs_env, v_matrix, n_col)
reorthogonalizes the mos
subroutine, public wfi_update(wf_history, qs_env, dt)
updates the snapshot buffer, taking a new snapshot
subroutine, public wfi_extrapolate(wf_history, qs_env, dt, extrapolation_method_nr, orthogonal_wf)
calculates the new starting state for the scf for the next wf optimization
subroutine, public wfi_create(wf_history, interpolation_method_nr, extrapolation_order, has_unit_metric)
...
interpolate the wavefunctions to speed up the convergence when doing MD
type(qs_wf_snapshot_type) function, pointer, public wfi_get_snapshot(wf_history, wf_index)
returns a snapshot, the first being the latest snapshot
subroutine, public wfi_release(wf_history)
releases a wf_history of a wavefunction (see doc/ReferenceCounting.html)
parameters that control an scf iteration
Represent a complex full matrix.
to create arrays of pools
represent a pool of elements with the same structure
keeps the information about the structure of a full matrix
Stores the state of a copy between cp_fm_start_copy_general and cp_fm_finish_copy_general.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
Keeps information about a specific k-point.
Contains information about kpoints.
stores all the informations relevant to an mpi environment
contained for different pw related things
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
container for the pools of matrixes used by qs
keeps the density in various representations, keeping track of which ones are valid.
keeps track of the previous wavefunctions and can extrapolate them for the next step of md
represent a past snapshot of the wavefunction. some elements might not be associated (to spare memory...