40 USE dbcsr_api,
ONLY: dbcsr_create,&
44 dbcsr_type_no_symmetry,&
45 dbcsr_type_real_default
112 #include "./base/base_uses.f90"
118 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_scf_initialization'
133 TYPE(qs_environment_type),
POINTER :: qs_env
134 TYPE(qs_scf_env_type),
POINTER :: scf_env
135 TYPE(scf_control_type),
OPTIONAL,
POINTER :: scf_control
136 TYPE(section_vals_type),
OPTIONAL,
POINTER :: scf_section
138 TYPE(dft_control_type),
POINTER :: dft_control
139 TYPE(scf_control_type),
POINTER :: my_scf_control
140 TYPE(section_vals_type),
POINTER :: dft_section, input, my_scf_section
142 CALL get_qs_env(qs_env, input=input, dft_control=dft_control)
144 IF (
PRESENT(scf_control))
THEN
145 my_scf_control => scf_control
147 CALL get_qs_env(qs_env, scf_control=my_scf_control)
151 IF (
PRESENT(scf_section))
THEN
152 my_scf_section => scf_section
157 CALL qs_scf_ensure_scf_env(qs_env, scf_env)
161 CALL qs_scf_ensure_mos(qs_env)
164 CALL qs_scf_ensure_diagonalization(scf_env, my_scf_section, qs_env, &
165 my_scf_control, qs_env%has_unit_metric)
167 CALL qs_scf_ensure_mixing(my_scf_control, my_scf_section, scf_env, dft_control)
169 CALL qs_scf_ensure_work_matrices(qs_env, scf_env)
171 CALL qs_scf_ensure_mixing_store(qs_env, scf_env)
174 IF (dft_control%qs_control%cdft)
THEN
175 CALL qs_scf_ensure_cdft_loop_vars(qs_env, scf_env, dft_control, &
176 scf_control=my_scf_control)
178 CALL qs_scf_ensure_outer_loop_vars(scf_env, my_scf_control)
181 CALL init_scf_run(scf_env, qs_env, my_scf_section, my_scf_control)
191 TYPE(qs_environment_type),
POINTER :: qs_env
192 TYPE(qs_scf_env_type),
POINTER :: scf_env
194 TYPE(dft_control_type),
POINTER :: dft_control
195 TYPE(scf_control_type),
POINTER :: scf_control
196 TYPE(section_vals_type),
POINTER :: dft_section, input, scf_section
198 CALL get_qs_env(qs_env, input=input, dft_control=dft_control)
200 CALL get_qs_env(qs_env, scf_control=scf_control)
204 CALL qs_scf_ensure_scf_env(qs_env, scf_env)
207 scf_control%use_diag = .true.
210 CALL qs_scf_ensure_mos(qs_env)
213 CALL qs_scf_ensure_diagonalization(scf_env, scf_section, qs_env, &
214 scf_control, qs_env%has_unit_metric)
215 CALL qs_scf_ensure_work_matrices(qs_env, scf_env)
217 CALL init_scf_run(scf_env, qs_env, scf_section, scf_control)
227 SUBROUTINE qs_scf_ensure_scf_env(qs_env, scf_env)
228 TYPE(qs_environment_type),
POINTER :: qs_env
229 TYPE(qs_scf_env_type),
POINTER :: scf_env
231 TYPE(pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g
232 TYPE(qs_rho_type),
POINTER :: rho
236 IF (.NOT.
ASSOCIATED(scf_env))
THEN
241 SELECT CASE (scf_env%mixing_method)
243 IF (
ASSOCIATED(scf_env%mixing_store))
THEN
249 IF (
ASSOCIATED(scf_env%mixing_store%rhoin))
THEN
250 IF (
SIZE(rho_g(1)%pw_grid%gsq) /=
SIZE(scf_env%mixing_store%rhoin(1)%cc))
THEN
252 DEALLOCATE (scf_env%mixing_store)
259 END SUBROUTINE qs_scf_ensure_scf_env
267 SUBROUTINE qs_scf_ensure_outer_loop_vars(scf_env, scf_control, nvar)
268 TYPE(qs_scf_env_type),
POINTER :: scf_env
269 TYPE(scf_control_type),
POINTER :: scf_control
270 INTEGER,
OPTIONAL :: nvar
272 INTEGER :: nhistory, nvariables
274 IF (scf_control%outer_scf%have_scf)
THEN
275 nhistory = scf_control%outer_scf%max_scf + 1
276 IF (
PRESENT(nvar))
THEN
285 ALLOCATE (scf_env%outer_scf%variables(nvariables, nhistory))
286 ALLOCATE (scf_env%outer_scf%count(nhistory))
287 scf_env%outer_scf%count = 0
288 ALLOCATE (scf_env%outer_scf%gradient(nvariables, nhistory))
289 ALLOCATE (scf_env%outer_scf%energy(nhistory))
292 END SUBROUTINE qs_scf_ensure_outer_loop_vars
301 SUBROUTINE qs_scf_ensure_cdft_loop_vars(qs_env, scf_env, dft_control, scf_control)
302 TYPE(qs_environment_type),
POINTER :: qs_env
303 TYPE(qs_scf_env_type),
POINTER :: scf_env
304 TYPE(dft_control_type),
POINTER :: dft_control
305 TYPE(scf_control_type),
POINTER :: scf_control
307 INTEGER :: nhistory, nvariables
308 LOGICAL :: do_kpoints
309 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: gradient_history, outer_scf_history, &
312 NULLIFY (outer_scf_history, gradient_history, variable_history)
313 CALL get_qs_env(qs_env=qs_env, do_kpoints=do_kpoints)
316 cpabort(
"CDFT calculation not possible with kpoints")
320 IF (.NOT. scf_control%outer_scf%have_scf) &
321 cpabort(
"Section SCF&OUTER_SCF must be active for CDFT calculations.")
323 IF (dft_control%qs_control%cdft_control%constraint_control%have_scf)
THEN
324 nhistory = dft_control%qs_control%cdft_control%constraint_control%max_scf + 1
327 dft_control%qs_control%cdft_control)
330 nvariables =
SIZE(dft_control%qs_control%cdft_control%target)
332 ALLOCATE (dft_control%qs_control%cdft_control%constraint%variables(nvariables, nhistory))
333 ALLOCATE (dft_control%qs_control%cdft_control%constraint%count(nhistory))
334 dft_control%qs_control%cdft_control%constraint%count = 0
335 ALLOCATE (dft_control%qs_control%cdft_control%constraint%gradient(nvariables, nhistory))
336 ALLOCATE (dft_control%qs_control%cdft_control%constraint%energy(nhistory))
337 CALL qs_scf_ensure_outer_loop_vars(scf_env, scf_control, nvariables)
342 IF (scf_control%outer_scf%have_scf)
THEN
344 dft_control%qs_control%cdft_control%ot_control%have_scf = .true.
345 dft_control%qs_control%cdft_control%ot_control%max_scf = scf_control%outer_scf%max_scf
346 dft_control%qs_control%cdft_control%ot_control%eps_scf = scf_control%outer_scf%eps_scf
347 dft_control%qs_control%cdft_control%ot_control%step_size = scf_control%outer_scf%step_size
348 dft_control%qs_control%cdft_control%ot_control%type = scf_control%outer_scf%type
349 dft_control%qs_control%cdft_control%ot_control%optimizer = scf_control%outer_scf%optimizer
350 dft_control%qs_control%cdft_control%ot_control%diis_buffer_length = scf_control%outer_scf%diis_buffer_length
351 dft_control%qs_control%cdft_control%ot_control%bisect_trust_count = scf_control%outer_scf%bisect_trust_count
352 CALL cdft_opt_type_copy(dft_control%qs_control%cdft_control%ot_control%cdft_opt_control, &
353 scf_control%outer_scf%cdft_opt_control)
355 nvariables =
SIZE(dft_control%qs_control%cdft_control%target)
356 IF (scf_control%outer_scf%extrapolation_order /= &
357 dft_control%qs_control%cdft_control%constraint_control%extrapolation_order &
358 .OR. nvariables /= 1)
THEN
359 DEALLOCATE (qs_env%outer_scf_history)
360 DEALLOCATE (qs_env%gradient_history)
361 DEALLOCATE (qs_env%variable_history)
362 nhistory = dft_control%qs_control%cdft_control%constraint_control%extrapolation_order
363 ALLOCATE (outer_scf_history(nvariables, nhistory))
364 ALLOCATE (gradient_history(nvariables, 2))
365 gradient_history = 0.0_dp
366 ALLOCATE (variable_history(nvariables, 2))
367 variable_history = 0.0_dp
368 CALL set_qs_env(qs_env, outer_scf_history=outer_scf_history, &
369 gradient_history=gradient_history, variable_history=variable_history)
375 END SUBROUTINE qs_scf_ensure_cdft_loop_vars
382 SUBROUTINE qs_scf_ensure_mixing_store(qs_env, scf_env)
383 TYPE(qs_environment_type),
POINTER :: qs_env
384 TYPE(qs_scf_env_type),
POINTER :: scf_env
386 TYPE(dft_control_type),
POINTER :: dft_control
388 NULLIFY (dft_control)
389 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control)
391 IF (scf_env%mixing_method > 0)
THEN
392 CALL mixing_allocate(qs_env, scf_env%mixing_method, scf_env%p_mix_new, &
393 scf_env%p_delta, dft_control%nspins, &
394 scf_env%mixing_store)
396 NULLIFY (scf_env%p_mix_new)
399 END SUBROUTINE qs_scf_ensure_mixing_store
408 SUBROUTINE qs_scf_ensure_work_matrices(qs_env, scf_env)
410 TYPE(qs_environment_type),
POINTER :: qs_env
411 TYPE(qs_scf_env_type),
POINTER :: scf_env
413 CHARACTER(LEN=*),
PARAMETER :: routinen =
'qs_scf_ensure_work_matrices'
415 INTEGER :: handle, is, nao, nrow_block, nw
416 LOGICAL :: do_kpoints
417 TYPE(cp_fm_pool_p_type),
DIMENSION(:),
POINTER :: ao_mo_fm_pools
418 TYPE(cp_fm_struct_type),
POINTER :: ao_ao_fmstruct, ao_mo_fmstruct
419 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s
420 TYPE(dbcsr_type),
POINTER :: ref_matrix
421 TYPE(dft_control_type),
POINTER :: dft_control
422 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
423 TYPE(scf_control_type),
POINTER :: scf_control
425 CALL timeset(routinen, handle)
427 NULLIFY (ao_mo_fm_pools, ao_mo_fmstruct, ao_ao_fmstruct, dft_control, matrix_s, mos)
430 dft_control=dft_control, &
431 matrix_s_kp=matrix_s, &
433 scf_control=scf_control, &
434 do_kpoints=do_kpoints)
435 CALL mpools_get(qs_env%mpools, ao_mo_fm_pools=ao_mo_fm_pools)
442 nrow_block=nrow_block, &
443 ncol_block=nrow_block, &
446 template_fmstruct=ao_mo_fmstruct)
450 IF (.NOT.
ASSOCIATED(scf_env%scf_work1))
THEN
451 nw = dft_control%nspins
452 IF (do_kpoints) nw = 4
453 ALLOCATE (scf_env%scf_work1(nw))
454 DO is = 1,
SIZE(scf_env%scf_work1)
456 matrix_struct=ao_ao_fmstruct, &
457 name=
"SCF-WORK_MATRIX-1-"//trim(adjustl(cp_to_string(is))))
460 IF ((.NOT.
ASSOCIATED(scf_env%ortho)) .AND. &
464 ALLOCATE (scf_env%ortho)
466 matrix_struct=ao_ao_fmstruct, &
467 name=
"SCF-ORTHO_MATRIX")
470 ref_matrix => matrix_s(1, 1)%matrix
471 CALL dbcsr_init_p(scf_env%ortho_dbcsr)
472 CALL dbcsr_create(scf_env%ortho_dbcsr, template=ref_matrix, &
473 matrix_type=dbcsr_type_no_symmetry)
474 CALL dbcsr_init_p(scf_env%buf1_dbcsr)
475 CALL dbcsr_create(scf_env%buf1_dbcsr, template=ref_matrix, &
476 matrix_type=dbcsr_type_no_symmetry)
477 CALL dbcsr_init_p(scf_env%buf2_dbcsr)
478 CALL dbcsr_create(scf_env%buf2_dbcsr, template=ref_matrix, &
479 matrix_type=dbcsr_type_no_symmetry)
481 (scf_control%level_shift /= 0.0_dp .AND. &
483 ALLOCATE (scf_env%ortho_m1)
485 matrix_struct=ao_ao_fmstruct, &
486 name=
"SCF-ORTHO_MATRIX-1")
489 IF (.NOT.
ASSOCIATED(scf_env%scf_work2))
THEN
490 ALLOCATE (scf_env%scf_work2)
492 matrix_struct=ao_ao_fmstruct, &
493 name=
"SCF-WORK_MATRIX-2")
497 IF (dft_control%dft_plus_u)
THEN
499 IF (.NOT.
ASSOCIATED(scf_env%scf_work2))
THEN
500 ALLOCATE (scf_env%scf_work2)
502 matrix_struct=ao_ao_fmstruct, &
503 name=
"SCF-WORK_MATRIX-2")
505 IF (.NOT.
ASSOCIATED(scf_env%s_half))
THEN
506 ALLOCATE (scf_env%s_half)
508 matrix_struct=ao_ao_fmstruct, &
509 name=
"S**(1/2) MATRIX")
515 IF (.NOT.
ASSOCIATED(scf_env%scf_work1))
THEN
517 ALLOCATE (scf_env%scf_work1(nw))
518 DO is = 1,
SIZE(scf_env%scf_work1)
520 matrix_struct=ao_ao_fmstruct, &
521 name=
"SCF-WORK_MATRIX-1-"//trim(adjustl(cp_to_string(is))))
528 CALL timestop(handle)
530 END SUBROUTINE qs_scf_ensure_work_matrices
536 SUBROUTINE qs_scf_ensure_mos(qs_env)
537 TYPE(qs_environment_type),
POINTER :: qs_env
539 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_scf_ensure_mos'
541 INTEGER :: handle, ic, ik, ikk, ispin, nmo, nmo_mat
542 TYPE(cp_fm_pool_p_type),
DIMENSION(:),
POINTER :: ao_mo_fm_pools
543 TYPE(cp_fm_type),
POINTER :: mo_coeff, mo_coeff_last
544 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: mo_derivs
545 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s
546 TYPE(dbcsr_type),
POINTER :: mo_coeff_b
547 TYPE(dft_control_type),
POINTER :: dft_control
548 TYPE(kpoint_type),
POINTER :: kpoints
549 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos, mos_last_converged
550 TYPE(mo_set_type),
DIMENSION(:, :),
POINTER :: mos_k
551 TYPE(xas_environment_type),
POINTER :: xas_env
553 CALL timeset(routinen, handle)
555 NULLIFY (ao_mo_fm_pools, dft_control, mos, xas_env, matrix_s, mos_last_converged, mo_coeff_last)
558 dft_control=dft_control, &
560 matrix_s_kp=matrix_s, &
562 CALL mpools_get(qs_env%mpools, ao_mo_fm_pools=ao_mo_fm_pools)
563 IF (dft_control%switch_surf_dip)
THEN
564 CALL get_qs_env(qs_env, mos_last_converged=mos_last_converged)
567 nmo_mat = dft_control%nspins
568 IF (dft_control%restricted) nmo_mat = 1
571 cpassert(
ASSOCIATED(mos))
572 DO ispin = 1,
SIZE(mos)
573 CALL get_mo_set(mos(ispin), mo_coeff=mo_coeff, mo_coeff_b=mo_coeff_b)
574 IF (.NOT.
ASSOCIATED(mo_coeff))
THEN
576 fm_pool=ao_mo_fm_pools(ispin)%pool, &
577 name=
"qs_env%mo"//trim(adjustl(cp_to_string(ispin))))
579 IF (.NOT.
ASSOCIATED(mo_coeff_b))
THEN
581 CALL dbcsr_init_p(mos(ispin)%mo_coeff_b)
583 sym=dbcsr_type_no_symmetry)
587 IF (qs_env%requires_mo_derivs)
THEN
589 IF (.NOT.
ASSOCIATED(mo_derivs))
THEN
590 ALLOCATE (mo_derivs(nmo_mat))
591 DO ispin = 1, nmo_mat
592 CALL get_mo_set(mos(ispin), mo_coeff_b=mo_coeff_b)
593 NULLIFY (mo_derivs(ispin)%matrix)
594 CALL dbcsr_init_p(mo_derivs(ispin)%matrix)
595 CALL dbcsr_create(mo_derivs(ispin)%matrix, template=mo_coeff_b, &
596 name=
"mo_derivs", matrix_type=dbcsr_type_no_symmetry, &
597 nze=0, data_type=dbcsr_type_real_default)
607 IF (dft_control%do_admm)
THEN
608 IF (dft_control%restricted) cpabort(
"ROKS with ADMM is not implemented")
612 IF (dft_control%switch_surf_dip)
THEN
613 cpassert(
ASSOCIATED(mos_last_converged))
614 DO ispin = 1,
SIZE(mos_last_converged)
615 CALL get_mo_set(mos_last_converged(ispin), mo_coeff=mo_coeff_last)
616 IF (.NOT.
ASSOCIATED(mo_coeff_last))
THEN
618 fm_ref=mos(ispin)%mo_coeff, &
619 name=
"qs_env%mos_last_converged"//trim(adjustl(cp_to_string(ispin))))
624 CALL get_qs_env(qs_env=qs_env, kpoints=kpoints)
625 IF (kpoints%nkp /= 0)
THEN
627 IF (qs_env%requires_mo_derivs)
THEN
628 cpwarn(
"MO derivative methods flag has been switched off for kpoint calculation")
631 qs_env%requires_mo_derivs = .false.
633 IF (dft_control%do_xas_calculation) &
634 cpabort(
"No XAS implemented with kpoints")
635 DO ik = 1,
SIZE(kpoints%kp_env)
636 CALL mpools_get(kpoints%mpools, ao_mo_fm_pools=ao_mo_fm_pools)
637 mos_k => kpoints%kp_env(ik)%kpoint_env%mos
638 ikk = kpoints%kp_range(1) + ik - 1
639 cpassert(
ASSOCIATED(mos_k))
640 DO ispin = 1,
SIZE(mos_k, 2)
641 DO ic = 1,
SIZE(mos_k, 1)
642 CALL get_mo_set(mos_k(ic, ispin), mo_coeff=mo_coeff, mo_coeff_b=mo_coeff_b)
643 IF (.NOT.
ASSOCIATED(mo_coeff))
THEN
645 fm_pool=ao_mo_fm_pools(ispin)%pool, &
646 name=
"kpoints_"//trim(adjustl(cp_to_string(ikk)))// &
647 "%mo"//trim(adjustl(cp_to_string(ispin))))
650 cpassert(.NOT.
ASSOCIATED(mo_coeff_b))
656 CALL timestop(handle)
658 END SUBROUTINE qs_scf_ensure_mos
667 SUBROUTINE qs_scf_ensure_mixing(scf_control, scf_section, scf_env, dft_control)
668 TYPE(scf_control_type),
POINTER :: scf_control
669 TYPE(section_vals_type),
POINTER :: scf_section
670 TYPE(qs_scf_env_type),
POINTER :: scf_env
671 TYPE(dft_control_type),
POINTER :: dft_control
673 TYPE(section_vals_type),
POINTER :: mixing_section
675 SELECT CASE (scf_control%mixing_method)
678 scf_env%p_mix_alpha = 1.0_dp
680 scf_env%mixing_method = scf_control%mixing_method
682 IF (.NOT.
ASSOCIATED(scf_env%mixing_store))
THEN
683 ALLOCATE (scf_env%mixing_store)
685 dft_control%qs_control%cutoff)
688 cpabort(
"Unknown mixing method")
695 scf_env%p_mix_alpha = 1.0_dp
696 scf_env%skip_diis = .true.
699 IF (scf_control%use_diag .AND. scf_env%mixing_method ==
no_mixing_nr)
THEN
700 cpabort(
"Diagonalization procedures without mixing are not recommendable")
704 scf_env%skip_diis = .true.
705 scf_env%p_mix_alpha = scf_env%mixing_store%alpha
706 IF (scf_env%mixing_store%beta == 0.0_dp)
THEN
707 cpabort(
"Mixing employing the Kerker damping factor needs BETA /= 0.0")
712 scf_env%p_mix_alpha = scf_env%mixing_store%alpha
713 IF (scf_control%eps_diis < scf_control%eps_scf)
THEN
714 scf_env%skip_diis = .true.
715 cpwarn(
"the DIIS scheme is disabled, since EPS_DIIS < EPS_SCF")
719 END SUBROUTINE qs_scf_ensure_mixing
730 SUBROUTINE qs_scf_ensure_diagonalization(scf_env, scf_section, qs_env, &
731 scf_control, has_unit_metric)
732 TYPE(qs_scf_env_type),
POINTER :: scf_env
733 TYPE(section_vals_type),
POINTER :: scf_section
734 TYPE(qs_environment_type),
POINTER :: qs_env
735 TYPE(scf_control_type),
POINTER :: scf_control
736 LOGICAL :: has_unit_metric
738 INTEGER :: ispin, nao, nmo
739 LOGICAL :: do_kpoints, need_coeff_b, not_se_or_tb
740 TYPE(cp_fm_type),
POINTER :: mo_coeff
741 TYPE(dft_control_type),
POINTER :: dft_control
742 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
744 CALL get_qs_env(qs_env=qs_env, do_kpoints=do_kpoints, dft_control=dft_control, mos=mos)
745 not_se_or_tb = .NOT. (dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb .OR. &
746 dft_control%qs_control%semi_empirical)
747 need_coeff_b = .false.
748 scf_env%needs_ortho = .false.
750 IF (scf_control%use_diag)
THEN
752 IF (dft_control%restricted) &
753 cpabort(
"OT only for restricted (ROKS)")
754 SELECT CASE (scf_control%diagonalization%method)
756 IF (.NOT. not_se_or_tb) &
757 cpabort(
"TB and SE not possible with OT diagonalization")
759 SELECT CASE (scf_control%diagonalization%method)
763 scf_env%needs_ortho = (.NOT. has_unit_metric) .AND. (.NOT. do_kpoints)
764 IF (has_unit_metric)
THEN
769 IF (dft_control%roks) &
770 cpabort(
"ROKS with OT diagonalization not possible")
772 cpabort(
"OT diagonalization not possible with kpoint calculations")
774 need_coeff_b = .true.
778 IF (dft_control%roks) &
779 cpabort(
"ROKS with block PF diagonalization not possible")
781 cpabort(
"Block Krylov diagonalization not possible with kpoint calculations")
783 scf_env%needs_ortho = .true.
784 IF (.NOT.
ASSOCIATED(scf_env%krylov_space)) &
790 cpabort(
"Block Davidson diagonalization not possible with kpoint calculations")
792 IF (.NOT.
ASSOCIATED(scf_env%block_davidson_env)) &
795 DO ispin = 1, dft_control%nspins
796 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, nao=nao, nmo=nmo)
799 need_coeff_b = .true.
812 cpabort(
"Unknown diagonalization method")
815 IF (scf_control%do_diag_sub)
THEN
816 scf_env%needs_ortho = .true.
817 IF (.NOT.
ASSOCIATED(scf_env%subspace_env)) &
819 dft_control%qs_control%cutoff)
822 cpabort(
"No subspace diagonlization with kpoint calculation")
825 ELSEIF (scf_control%use_ot)
THEN
827 need_coeff_b = .true.
828 IF (sum(abs(scf_control%added_mos)) > 0) &
829 cpabort(
"OT with ADDED_MOS/=0 not implemented")
830 IF (dft_control%restricted .AND. dft_control%nspins .NE. 2) &
831 cpabort(
"nspin must be 2 for restricted (ROKS)")
833 cpabort(
"OT not possible with kpoint calculations")
835 cpabort(
"OT or DIAGONALIZATION have to be set")
837 DO ispin = 1, dft_control%nspins
838 mos(ispin)%use_mo_coeff_b = need_coeff_b
841 END SUBROUTINE qs_scf_ensure_diagonalization
854 SUBROUTINE init_scf_run(scf_env, qs_env, scf_section, scf_control)
856 TYPE(qs_scf_env_type),
POINTER :: scf_env
857 TYPE(qs_environment_type),
POINTER :: qs_env
858 TYPE(section_vals_type),
POINTER :: scf_section
859 TYPE(scf_control_type),
POINTER :: scf_control
861 CHARACTER(LEN=*),
PARAMETER :: routinen =
'init_scf_run'
863 INTEGER :: after, handle, ikind, iw, nao, ndep, &
865 LOGICAL :: dft_plus_u_atom, do_kpoints, &
866 init_u_ramping_each_scf, omit_headers, &
867 s_minus_half_available
868 REAL(kind=
dp) :: u_ramping
869 TYPE(cp_logger_type),
POINTER :: logger
870 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_s
871 TYPE(dft_control_type),
POINTER :: dft_control
872 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
873 TYPE(mp_para_env_type),
POINTER :: para_env
874 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
875 TYPE(qs_kind_type),
POINTER :: qs_kind
876 TYPE(qs_rho_type),
POINTER :: rho
877 TYPE(xas_environment_type),
POINTER :: xas_env
879 CALL timeset(routinen, handle)
881 NULLIFY (qs_kind_set, matrix_s, dft_control, mos, qs_kind, rho, xas_env)
885 cpassert(
ASSOCIATED(scf_env))
886 cpassert(
ASSOCIATED(qs_env))
889 s_minus_half_available = .false.
891 dft_control=dft_control, &
892 qs_kind_set=qs_kind_set, &
895 nelectron_total=scf_env%nelectron, &
896 do_kpoints=do_kpoints, &
904 "PRINT%PROGRAM_RUN_INFO")
908 IF (scf_env%needs_ortho)
THEN
919 CALL cp_fm_to_fm(scf_env%ortho, scf_env%ortho_m1)
923 CALL cp_fm_power(scf_env%ortho, scf_env%scf_work2, -0.5_dp, &
924 scf_control%eps_eigval, ndep)
925 IF (scf_control%level_shift /= 0.0_dp)
THEN
927 CALL cp_fm_power(scf_env%ortho_m1, scf_env%scf_work2, 0.5_dp, &
928 scf_control%eps_eigval, ndep)
930 s_minus_half_available = .true.
934 qs_env%input,
"DFT%PRINT%AO_MATRICES/ORTHO"),
cp_p_file))
THEN
938 CALL section_vals_val_get(qs_env%input,
"DFT%PRINT%AO_MATRICES%OMIT_HEADERS", l_val=omit_headers)
939 after = min(max(after, 1), 16)
941 para_env, output_unit=iw, omit_headers=omit_headers)
943 "DFT%PRINT%AO_MATRICES/ORTHO")
950 IF (dft_control%dft_plus_u)
THEN
953 IF (s_minus_half_available)
THEN
958 CALL cp_fm_power(scf_env%s_half, scf_env%scf_work2, 0.5_dp, &
959 scf_control%eps_eigval, ndep)
962 DO ikind = 1,
SIZE(qs_kind_set)
963 qs_kind => qs_kind_set(ikind)
965 dft_plus_u_atom=dft_plus_u_atom, &
966 u_ramping=u_ramping, &
967 init_u_ramping_each_scf=init_u_ramping_each_scf)
968 IF (dft_plus_u_atom .AND. (u_ramping /= 0.0_dp))
THEN
969 IF (init_u_ramping_each_scf)
THEN
970 CALL set_qs_kind(qs_kind=qs_kind, u_minus_j=0.0_dp)
978 IF (output_unit > 0)
THEN
979 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
980 "Number of independent orbital functions:", nao - ndep
983 "PRINT%PROGRAM_RUN_INFO")
986 IF (scf_control%outer_scf%have_scf)
THEN
991 IF (
ASSOCIATED(qs_env%xas_env))
THEN
998 CALL scf_env_initial_rho_setup(scf_env, qs_env=qs_env, &
999 scf_section=scf_section, scf_control=scf_control)
1003 IF (
ASSOCIATED(qs_env%wf_history))
THEN
1005 IF (.NOT.
ASSOCIATED(qs_env%wf_history%past_states(1)%snapshot))
THEN
1006 CALL wfi_update(qs_env%wf_history, qs_env=qs_env, dt=1.0_dp)
1007 ALLOCATE (qs_env%wf_history%past_states(1)%snapshot%rho_frozen)
1008 CALL qs_rho_create(qs_env%wf_history%past_states(1)%snapshot%rho_frozen)
1010 rho_output=qs_env%wf_history%past_states(1)%snapshot%rho_frozen, &
1017 IF (qs_env%qmmm)
THEN
1018 IF (qs_env%qmmm .AND. qs_env%qmmm_env_qm%image_charge)
THEN
1020 qmmm_env=qs_env%qmmm_env_qm)
1024 CALL timestop(handle)
1026 END SUBROUTINE init_scf_run
1038 SUBROUTINE scf_env_initial_rho_setup(scf_env, qs_env, scf_section, scf_control)
1039 TYPE(qs_scf_env_type),
POINTER :: scf_env
1040 TYPE(qs_environment_type),
POINTER :: qs_env
1041 TYPE(section_vals_type),
POINTER :: scf_section
1042 TYPE(scf_control_type),
POINTER :: scf_control
1044 CHARACTER(len=*),
PARAMETER :: routinen =
'scf_env_initial_rho_setup'
1046 INTEGER :: extrapolation_method_nr, handle, ispin, &
1048 LOGICAL :: orthogonal_wf
1049 TYPE(cp_fm_type),
POINTER :: mo_coeff
1050 TYPE(cp_logger_type),
POINTER :: logger
1051 TYPE(dft_control_type),
POINTER :: dft_control
1052 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
1053 TYPE(mp_para_env_type),
POINTER :: para_env
1054 TYPE(qs_rho_type),
POINTER :: rho
1055 TYPE(rho_atom_type),
DIMENSION(:),
POINTER :: rho_atom
1057 CALL timeset(routinen, handle)
1058 NULLIFY (mo_coeff, rho, dft_control, para_env, mos)
1060 cpassert(
ASSOCIATED(scf_env))
1061 cpassert(
ASSOCIATED(qs_env))
1066 dft_control=dft_control, &
1070 IF (
ASSOCIATED(qs_env%wf_history))
THEN
1072 qs_env=qs_env, dt=1.0_dp, &
1073 extrapolation_method_nr=extrapolation_method_nr, &
1074 orthogonal_wf=orthogonal_wf)
1076 IF ((.NOT. orthogonal_wf) .AND. &
1079 DO ispin = 1,
SIZE(mos)
1080 CALL get_mo_set(mos(ispin), mo_coeff=mo_coeff, nmo=nmo)
1082 CALL set_mo_occupation(mo_set=mos(ispin), &
1083 smear=scf_control%smear)
1088 extension=
".scfLog")
1089 IF (output_unit > 0)
THEN
1090 WRITE (unit=output_unit, fmt=
"(/,T2,A,I0)") &
1091 "Extrapolation method: "// &
1094 WRITE (unit=output_unit, fmt=
"(T2,A,I0,A)") &
1095 "Extrapolation order: ", &
1096 max((min(qs_env%wf_history%memory_depth, qs_env%wf_history%snapshot_count) - 1), 0)
1101 "PRINT%PROGRAM_RUN_INFO")
1109 IF (scf_env%mixing_method > 1)
THEN
1110 IF (dft_control%qs_control%gapw)
THEN
1111 CALL get_qs_env(qs_env=qs_env, rho_atom_set=rho_atom)
1112 CALL mixing_init(scf_env%mixing_method, rho, scf_env%mixing_store, &
1113 para_env, rho_atom=rho_atom)
1114 ELSEIF (dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb)
THEN
1116 ELSEIF (dft_control%qs_control%semi_empirical)
THEN
1117 cpabort(
'SE Code not possible')
1119 CALL mixing_init(scf_env%mixing_method, rho, scf_env%mixing_store, &
1124 DO ispin = 1,
SIZE(mos)
1125 IF (mos(ispin)%use_mo_coeff_b)
THEN
1127 mos(ispin)%mo_coeff_b)
1131 CALL timestop(handle)
1133 END SUBROUTINE scf_env_initial_rho_setup
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
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.
subroutine, public cp_dbcsr_m_by_n_from_row_template(matrix, template, n, sym, data_type)
Utility function to create dbcsr matrix, m x n matrix (n arbitrary) with the same processor grid and ...
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
subroutine, public write_fm_with_basis_info(blacs_matrix, before, after, qs_env, para_env, first_row, last_row, first_col, last_col, output_unit, omit_headers)
Print a spherical matrix of blacs type.
basic linear algebra operations for full matrices
subroutine, public cp_fm_triangular_invert(matrix_a, uplo_tr)
inverts a triangular matrix
various cholesky decomposition related routines
subroutine, public cp_fm_cholesky_decompose(matrix, n, info_out)
used to replace a symmetric positive def. matrix M with its cholesky decomposition U: M = U^T * U,...
used for collecting some of the diagonalization schemes available for cp_fm_type. cp_fm_power also mo...
subroutine, public cp_fm_power(matrix, work, exponent, threshold, n_dependent, verbose, eigvals)
...
pool for for elements that are retained and released
type(cp_fm_struct_type) function, pointer, public fm_pool_get_el_struct(pool)
returns the structure of the elements in this 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_get(fmstruct, para_env, context, descriptor, ncol_block, nrow_block, nrow_global, ncol_global, first_p_pos, row_indices, col_indices, nrow_local, ncol_local, nrow_locals, ncol_locals, local_leading_dimension)
returns the values of various attributes of the 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_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_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_to_fm_triangular(msource, mtarget, uplo)
copy just a triangular matrix
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
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)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
Defines the basic variable types.
integer, parameter, public dp
Types and basic routines needed for a kpoint calculation.
Interface to the message passing library MPI.
Routines for image charge calculation within QM/MM.
subroutine, public conditional_calc_image_matrix(qs_env, qmmm_env)
calculate image matrix T depending on constraints on image atoms in case coefficients are estimated n...
module that contains the algorithms to perform an itrative diagonalization by the block-Davidson appr...
subroutine, public block_davidson_allocate(bdav_env, mo_coeff, nao, nmo)
...
subroutine, public block_davidson_env_create(bdav_env, nspins, scf_section)
...
Control parameters for optimizers that work with CDFT constraints.
subroutine, public cdft_opt_type_copy(new, old)
copies settings between two CDFT optimizer control objects retaining both
module that contains the definitions of the scf types
subroutine, public mixing_storage_release(mixing_store)
releases a mixing_storage
integer, parameter, public no_mixing_nr
integer, parameter, public direct_mixing_nr
subroutine, public mixing_storage_create(mixing_store, mixing_section, mixing_method, ecut)
creates a mixing_storage
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_RI_aux_kp, matrix_s, matrix_s_RI_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, 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, rhs)
Get the QUICKSTEP environment.
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, 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, 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, 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, rhs)
Set the QUICKSTEP environment.
subroutine, public fb_distribution_build(fb_env, qs_env, scf_section)
Build local atoms associated to filter matrix algorithm for each MPI process, trying to balance the l...
subroutine, public fb_env_read_input(fb_env, scf_section)
Read input sections for filter matrix method.
subroutine, public fb_env_build_atomic_halos(fb_env, qs_env, scf_section)
Builds an fb_atomic_halo_list object using information from fb_env.
subroutine, public fb_env_write_info(fb_env, qs_env, scf_section)
Write out parameters used for the filter matrix method to output.
subroutine, public fb_env_build_rcut_auto(fb_env, qs_env)
Automatically generate the cutoff radii of atoms used for constructing the atomic halos,...
logical function, public fb_env_has_data(fb_env)
Checks if a fb_env object is associated with an actual data content or not.
subroutine, public fb_env_create(fb_env)
creates an empty fb_env object
Routines to somehow generate an initial guess.
subroutine, public calculate_first_density_matrix(scf_env, qs_env)
can use a variety of methods to come up with an initial density matrix and optionally an initial wave...
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_r3d_rs_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, U_of_dft_plus_u, J_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, J0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public set_qs_kind(qs_kind, paw_atom, ghost, floating, hard_radius, hard0_radius, covalent_radius, vdw_radius, lmax_rho0, zeff, no_optimize, dispersion, u_minus_j, reltmat, dftb_parameter, xtb_parameter, elec_conf, pao_basis_size)
Set the components of an atomic kind data set.
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)
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
Set occupation of molecular orbitals.
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.
subroutine, public init_mo_set(mo_set, fm_pool, fm_ref, fm_struct, name)
initializes an allocated mo_set. eigenvalues, mo_coeff, occupation_numbers are valid only after this ...
Routines for performing an outer scf loop.
subroutine, public outer_loop_switch(scf_env, scf_control, cdft_control, dir)
switch between two outer_scf envs stored in cdft_control
subroutine, public outer_loop_extrapolate(qs_env)
uses the outer_scf_history to extrapolate new values for the variables and updates their value in qs_...
integer function, public outer_loop_variables_count(scf_control, cdft_control)
returns the number of variables that is employed in the outer loop. with a CDFT constraint this value...
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...
subroutine, public duplicate_rho_type(rho_input, rho_output, qs_env)
Duplicates a pointer physically.
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...
subroutine, public qs_rho_create(rho)
Allocates a new instance of rho.
Different diagonalization schemes that can be used for the iterative solution of the eigenvalue probl...
subroutine, public diag_subspace_allocate(subspace_env, qs_env, mos)
...
Utility routines for qs_scf.
subroutine, public qs_scf_env_init_basic(qs_env, scf_env)
initializes input parameters if needed for non-scf calclulations using diagonalization
subroutine, public qs_scf_env_initialize(qs_env, scf_env, scf_control, scf_section)
initializes input parameters if needed or restores values from previous runs to fill scf_env with the...
module that contains the algorithms to perform an itrative diagonalization by the block-Lanczos appro...
subroutine, public krylov_space_allocate(krylov_space, scf_control, mos)
allocates matrices and vectros used in the construction of the krylov space and for the lanczos refin...
subroutine, public qs_scf_initial_info(output_unit, mos, dft_control)
writes basic information at the beginning of an scf run
module that contains the definitions of the scf types
integer, parameter, public ot_diag_method_nr
subroutine, public krylov_space_create(krylov_space, scf_section)
creates krylov space
subroutine, public diag_subspace_env_create(subspace_env, scf_section, ecut)
creates subspace-rotation environment
integer, parameter, public filter_matrix_diag_method_nr
integer, parameter, public block_davidson_diag_method_nr
integer, parameter, public ot_method_nr
subroutine, public scf_env_create(scf_env)
allocates and initialize an scf_env
integer, parameter, public special_diag_method_nr
integer, parameter, public block_krylov_diag_method_nr
integer, parameter, public general_diag_method_nr
Storage of past states of the qs_env. Methods to interpolate (or actually normally extrapolate) the n...
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
parameters that control an scf iteration
define create destroy get and put information in xas_env to calculate the x-ray absorption spectra
Initialize the XAS orbitals for specific core excitations Either the GS orbitals are used as initial ...
subroutine, public xas_initialize_rho(qs_env, scf_env, scf_control)
Once the mos and the occupation numbers are initialized the electronic density of the excited state c...