68#include "./base/base_uses.f90"
74 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_scf_loop_utils'
92 energy_only, just_energy, exit_inner_loop)
95 LOGICAL :: diis_step, energy_only, just_energy, &
101 energy_only = .false.
102 just_energy = .false.
107 scf_env%iter_count = 0
108 exit_inner_loop = .false.
123 SUBROUTINE qs_scf_new_mos(qs_env, scf_env, scf_control, scf_section, diis_step, &
129 LOGICAL :: diis_step, energy_only
133 CHARACTER(LEN=*),
PARAMETER :: routinen =
'qs_scf_new_mos'
135 INTEGER :: handle, ispin
136 LOGICAL :: disable_diis, has_unit_metric, &
138 REAL(kind=
dp) :: saved_eps_diis
139 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks, matrix_s
146 CALL timeset(routinen, handle)
148 NULLIFY (energy, ks_env, matrix_ks, matrix_s, rho, mos, dft_control)
151 matrix_s=matrix_s, energy=energy, &
153 matrix_ks=matrix_ks, rho=rho, mos=mos, &
154 dft_control=dft_control, &
155 has_unit_metric=has_unit_metric)
156 scf_env%iter_param = 0.0_dp
157 disable_diis = dft_control%qs_control%xtb_control%do_tblite .AND. &
159 IF (disable_diis)
THEN
160 saved_eps_diis = scf_control%eps_diis
161 scf_control%eps_diis = 0.0_dp
166 IF (dft_control%correct_el_density_dip)
THEN
167 scf_env%sum_zeff_corr = qs_env%total_zeff_corr
168 IF (abs(qs_env%total_zeff_corr) > 0.0_dp)
THEN
170 CALL cp_abort(__location__, &
171 "Please use ALGORITHM STANDARD in "// &
172 "SCF%DIAGONALIZATION if "// &
173 "CORE_CORRECTION /= 0.0 and "// &
174 "SURFACE_DIPOLE_CORRECTION TRUE ")
175 ELSEIF (dft_control%roks)
THEN
176 CALL cp_abort(__location__, &
177 "Combination of "// &
178 "CORE_CORRECTION /= 0.0 and "// &
179 "SURFACE_DIPOLE_CORRECTION TRUE "// &
180 "is not implemented with ROKS")
181 ELSEIF (scf_control%diagonalization%mom)
THEN
182 CALL cp_abort(__location__, &
183 "Combination of "// &
184 "CORE_CORRECTION /= 0.0 and "// &
185 "SURFACE_DIPOLE_CORRECTION TRUE "// &
186 "is not implemented with SCF%MOM")
191 SELECT CASE (scf_env%method)
193 CALL cp_abort(__location__, &
194 "unknown scf method: "// &
202 IF (abs(qs_env%total_zeff_corr) > 0.0_dp)
THEN
203 CALL cp_abort(__location__, &
204 "CORE_CORRECTION /= 0.0 plus SURFACE_DIPOLE_CORRECTION TRUE "// &
205 "requires SCF%DIAGONALIZATION: ALGORITHM STANDARD")
208 matrix_ks, matrix_s, scf_section, diis_step)
212 IF (dft_control%roks)
THEN
214 scf_control, scf_section, diis_step, &
217 IF (scf_control%diagonalization%mom)
THEN
219 matrix_s, scf_control, scf_section, &
222 IF (dft_control%hairy_probes .EQV. .true.)
THEN
224 matrix_s, scf_control, scf_section, &
229 matrix_s, scf_control, scf_section, &
233 IF (scf_control%do_diag_sub)
THEN
234 skip_diag_sub = (scf_env%subspace_env%eps_diag_sub > 0.0_dp) .AND. &
235 (scf_env%iter_count == 1 .OR. scf_env%iter_delta > scf_env%subspace_env%eps_diag_sub)
236 IF (.NOT. skip_diag_sub)
THEN
238 ks_env, scf_section, scf_control)
244 IF (dft_control%roks)
THEN
246 scf_control, scf_section, diis_step, &
250 scf_control, scf_section, &
255 CALL do_ot_diag(scf_env, mos, matrix_ks, matrix_s, &
256 scf_control, scf_section, diis_step)
259 IF ((scf_env%krylov_space%eps_std_diag > 0.0_dp) .AND. &
260 (scf_env%iter_count == 1 .OR. scf_env%iter_delta > scf_env%krylov_space%eps_std_diag))
THEN
261 IF (scf_env%krylov_space%always_check_conv)
THEN
263 scf_control, scf_section, check_moconv_only=.true.)
266 matrix_s, scf_control, scf_section, diis_step)
269 scf_control, scf_section)
271 IF (scf_control%do_diag_sub)
THEN
272 skip_diag_sub = (scf_env%subspace_env%eps_diag_sub > 0.0_dp) .AND. &
273 (scf_env%iter_count == 1 .OR. scf_env%iter_delta > scf_env%subspace_env%eps_diag_sub)
274 IF (.NOT. skip_diag_sub)
THEN
276 ks_env, scf_section, scf_control)
282 scf_section, .false.)
285 CALL qs_scf_loop_do_ot(qs_env, scf_env, scf_control%smear, mos, rho, &
286 qs_env%mo_derivs, energy%total, &
287 matrix_s, energy_only=energy_only, has_unit_metric=has_unit_metric)
289 IF (disable_diis) scf_control%eps_diis = saved_eps_diis
292 energy%efermi = 0.0_dp
294 DO ispin = 1,
SIZE(mos)
295 energy%kTS = energy%kTS + mos(ispin)%kTS
296 energy%efermi = energy%efermi + mos(ispin)%mu
298 energy%efermi = energy%efermi/real(
SIZE(mos), kind=
dp)
300 CALL timestop(handle)
321 CHARACTER(LEN=*),
PARAMETER :: routinen =
'qs_scf_new_mos_kp'
323 INTEGER :: handle, ispin
324 LOGICAL :: disable_diis, has_unit_metric
325 REAL(
dp) :: diis_error, saved_eps_diis
326 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_ks, matrix_s
332 CALL timeset(routinen, handle)
334 NULLIFY (dft_control, kpoints, matrix_ks, matrix_s)
336 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, kpoints=kpoints)
337 scf_env%iter_param = 0.0_dp
338 disable_diis = dft_control%qs_control%xtb_control%do_tblite .AND. &
340 IF (disable_diis)
THEN
341 saved_eps_diis = scf_control%eps_diis
342 scf_control%eps_diis = 0.0_dp
345 IF (dft_control%roks) &
346 cpabort(
"KP code: ROKS method not available: ")
348 SELECT CASE (scf_env%method)
350 CALL cp_abort(__location__, &
351 "KP code: Unknown scf method: "// &
355 CALL get_qs_env(qs_env, matrix_ks_kp=matrix_ks, matrix_s_kp=matrix_s)
356 IF (dft_control%hairy_probes .EQV. .true.)
THEN
357 scf_control%smear%do_smear = .false.
359 diis_step, diis_error, qs_env, probe)
362 diis_step, diis_error, qs_env)
365 scf_env%iter_param = diis_error
366 scf_env%iter_method =
"DIIS/Diag."
368 IF (scf_env%mixing_method == 0)
THEN
369 scf_env%iter_method =
"NoMix/Diag."
370 ELSE IF (scf_env%mixing_method == 1)
THEN
371 scf_env%iter_param = scf_env%p_mix_alpha
372 scf_env%iter_method =
"P_Mix/Diag."
373 ELSEIF (scf_env%mixing_method > 1)
THEN
374 scf_env%iter_param = scf_env%mixing_store%alpha
375 scf_env%iter_method = trim(scf_env%mixing_store%iter_method)//
"/Diag."
379 CALL get_qs_env(qs_env=qs_env, has_unit_metric=has_unit_metric)
380 cpassert(has_unit_metric)
382 CALL cp_abort(__location__, &
383 "KP code: Scf method not available: "// &
389 CALL cp_abort(__location__, &
390 "KP code: Scf method not available: "// &
395 IF (scf_env%mixing_method == 0)
THEN
396 scf_env%iter_method =
"NoMix/SMGL"
397 ELSE IF (scf_env%mixing_method == 1)
THEN
398 scf_env%iter_param = scf_env%p_mix_alpha
399 scf_env%iter_method =
"P_Mix/SMGL"
400 ELSE IF (scf_env%mixing_method > 1)
THEN
401 scf_env%iter_param = scf_env%mixing_store%alpha
402 scf_env%iter_method = trim(scf_env%mixing_store%iter_method)//
"/SMGL"
404 CALL run_smeagol_emtrans(qs_env, last=.false., iter=scf_env%iter_count, rho_ao_kp=scf_env%p_mix_new)
406 IF (disable_diis) scf_control%eps_diis = saved_eps_diis
410 energy%efermi = 0.0_dp
411 mos => kpoints%kp_env(1)%kpoint_env%mos
412 DO ispin = 1,
SIZE(mos, 2)
413 energy%kTS = energy%kTS + mos(1, ispin)%kTS
414 energy%efermi = energy%efermi + mos(1, ispin)%mu
416 energy%efermi = energy%efermi/real(
SIZE(mos, 2), kind=
dp)
418 CALL timestop(handle)
439 SUBROUTINE qs_scf_loop_do_ot(qs_env, scf_env, smear, mos, rho, mo_derivs, total_energy, &
440 matrix_s, energy_only, has_unit_metric)
445 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(INOUT) :: mos
448 REAL(kind=
dp),
INTENT(IN) :: total_energy
450 LOGICAL,
INTENT(INOUT) :: energy_only
451 LOGICAL,
INTENT(IN) :: has_unit_metric
453 CHARACTER(LEN=*),
PARAMETER :: routinen =
'qs_scf_loop_do_ot'
455 INTEGER :: handle, ispin
457 TYPE(
dbcsr_type),
POINTER :: orthogonality_metric
459 CALL timeset(routinen, handle)
464 IF (has_unit_metric)
THEN
465 NULLIFY (orthogonality_metric)
467 orthogonality_metric => matrix_s(1)%matrix
473 CALL ot_scf_mini(mos, mo_derivs, smear, orthogonality_metric, &
474 total_energy, energy_only, scf_env%iter_delta, &
477 DO ispin = 1,
SIZE(mos)
481 DO ispin = 1,
SIZE(mos)
483 rho_ao(ispin)%matrix, &
487 scf_env%iter_method = scf_env%qs_ot_env(1)%OT_METHOD_FULL
488 scf_env%iter_param = scf_env%qs_ot_env(1)%ds_min
489 qs_env%broyden_adaptive_sigma = scf_env%qs_ot_env(1)%broyden_adaptive_sigma
491 CALL timestop(handle)
493 END SUBROUTINE qs_scf_loop_do_ot
508 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp
514 SELECT CASE (scf_env%mixing_method)
517 scf_env%mixing_store, rho_ao_kp, para_env, scf_env%iter_delta, scf_env%iter_count, &
523 delta=scf_env%iter_delta)
526 CALL cp_abort(__location__, &
527 "unknown scf mixing method: "// &
543 outer_loop_converged, exit_outer_loop)
547 LOGICAL :: should_stop, outer_loop_converged, &
550 REAL(kind=
dp) :: outer_loop_eps
552 outer_loop_converged = .true.
553 IF (scf_control%outer_scf%have_scf)
THEN
555 scf_env%outer_scf%iter_count = scf_env%outer_scf%iter_count + 1
556 outer_loop_converged = .false.
560 outer_loop_eps = sqrt(maxval(scf_env%outer_scf%gradient(:, scf_env%outer_scf%iter_count)**2))
562 IF (outer_loop_eps < scf_control%outer_scf%eps_scf) outer_loop_converged = .true.
565 exit_outer_loop = should_stop .OR. outer_loop_converged .OR. &
566 scf_env%outer_scf%iter_count > scf_control%outer_scf%max_scf
582 exit_inner_loop, inner_loop_converged, output_unit)
586 LOGICAL :: should_stop, just_energy, &
587 exit_inner_loop, inner_loop_converged
588 INTEGER :: output_unit
590 inner_loop_converged = .false.
591 exit_inner_loop = .false.
594 start_time=qs_env%start_time)
595 IF (scf_env%iter_delta < scf_control%eps_scf)
THEN
596 IF (output_unit > 0)
THEN
597 WRITE (unit=output_unit, fmt=
"(/,T3,A,I5,A/)") &
598 "*** SCF run converged in ", scf_env%iter_count,
" steps ***"
600 inner_loop_converged = .true.
601 exit_inner_loop = .true.
602 ELSE IF (should_stop .OR. scf_env%iter_count >= scf_control%max_scf)
THEN
603 inner_loop_converged = .false.
604 IF (just_energy)
THEN
605 exit_inner_loop = .false.
607 exit_inner_loop = .true.
608 IF (output_unit > 0)
THEN
609 WRITE (unit=output_unit, fmt=
"(/,T3,A,I5,A/)") &
610 "Leaving inner SCF loop after reaching ", scf_env%iter_count,
" steps."
625 SUBROUTINE qs_scf_undo_mixing(scf_env, rho, dft_control, para_env, diis_step)
632 CHARACTER(len=default_string_length) :: name
633 INTEGER :: ic, ispin, nc
634 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp
638 IF (scf_env%mixing_method > 0)
THEN
640 nc =
SIZE(scf_env%p_mix_new, 2)
641 SELECT CASE (scf_env%mixing_method)
644 rho_ao_kp, para_env, scf_env%iter_delta, &
645 scf_env%iter_count, diis=diis_step, &
648 DO ispin = 1, dft_control%nspins
650 CALL dbcsr_copy(rho_ao_kp(ispin, ic)%matrix, scf_env%p_mix_new(ispin, ic)%matrix, name=name)
656 DO ispin = 1, dft_control%nspins
658 CALL dbcsr_copy(rho_ao_kp(ispin, ic)%matrix, scf_env%p_mix_new(ispin, ic)%matrix, name=name)
663 END SUBROUTINE qs_scf_undo_mixing
678 LOGICAL,
INTENT(IN) :: mix_rho
688 CALL gspace_mixing(qs_env, scf_env%mixing_method, scf_env%mixing_store, rho, &
689 para_env, scf_env%iter_count)
707 INTEGER,
INTENT(IN) :: output_unit
709 LOGICAL :: do_kpoints
716 NULLIFY (energy, rho, dft_control, ks_env)
718 CALL get_qs_env(qs_env=qs_env, energy=energy, ks_env=ks_env, &
719 rho=rho, dft_control=dft_control, para_env=para_env, &
720 do_kpoints=do_kpoints)
722 CALL cleanup_scf_loop(scf_env)
728 CALL qs_scf_undo_mixing(scf_env, rho, dft_control, para_env, diis_step)
743 SUBROUTINE cleanup_scf_loop(scf_env)
746 CHARACTER(len=*),
PARAMETER :: routinen =
'cleanup_scf_loop'
748 INTEGER :: handle, ispin
750 CALL timeset(routinen, handle)
752 SELECT CASE (scf_env%method)
754 DO ispin = 1,
SIZE(scf_env%qs_ot_env)
757 DEALLOCATE (scf_env%qs_ot_env)
771 CALL cp_abort(__location__, &
772 "unknown scf method method:"// &
776 CALL timestop(handle)
778 END SUBROUTINE cleanup_scf_loop
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
Routines to handle the external control of CP2K.
subroutine, public external_control(should_stop, flag, globenv, target_time, start_time, force_check)
External manipulations during a run : when the <PROJECT_NAME>.EXIT_$runtype command is sent the progr...
various routines to log and control the output. The idea is that decisions about where to log should ...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Types and basic routines needed for a kpoint calculation.
Interface to the message passing library MPI.
collects routines that calculate density matrices
module that contains the definitions of the scf types
integer, parameter, public new_pulay_mixing_nr
integer, parameter, public broyden_mixing_nr
integer, parameter, public modified_broyden_mixing_nr
integer, parameter, public no_mixing_nr
integer, parameter, public direct_mixing_nr
integer, parameter, public multisecant_mixing_nr
integer, parameter, public pulay_mixing_nr
integer, parameter, public gspace_mixing_nr
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 fb_env_do_diag(fb_env, qs_env, matrix_ks, matrix_s, scf_section, diis_step)
Do filtered matrix method diagonalisation.
subroutine, public gspace_mixing(qs_env, mixing_method, mixing_store, rho, para_env, iter_count)
Driver for the g-space mixing, calls the proper routine given the requested method.
subroutine, public qs_ks_did_change(ks_env, s_mstruct_changed, rho_changed, potential_changed, full_reset)
tells that some of the things relevant to the ks calculation did change. has to be called when change...
subroutine, public self_consistency_check(rho_ao, p_delta, para_env, p_out, delta)
...
Set occupation of molecular orbitals.
Definition and initialisation of the mo data type.
methods for deltaSCF calculations
subroutine, public do_mom_diag(scf_env, mos, matrix_ks, matrix_s, scf_control, scf_section, diis_step)
do an SCF iteration, then compute occupation numbers of the new molecular orbitals according to their...
basic functionality for using ot in the scf routines.
subroutine, public ot_scf_mini(mo_array, matrix_dedc, smear, matrix_s, energy, energy_only, delta, qs_ot_env)
performs the actual minimisation, needs only limited info updated for restricted calculations matrix_...
subroutine, public ot_scf_destroy(qs_ot_env)
...
Routines for performing an outer scf loop.
subroutine, public outer_loop_gradient(qs_env, scf_env)
computes the gradient wrt to the outer loop variables
methods of the rho structure (defined in qs_rho_types)
subroutine, public qs_rho_update_rho(rho_struct, qs_env, rho_xc_external, local_rho_set, task_list_external, task_list_external_soft, pw_env_external, para_env_external)
updates rho_r and rho_g to the rhorho_ao. if use_kinetic_energy_density also computes tau_r and tau_g...
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
Different diagonalization schemes that can be used for the iterative solution of the eigenvalue probl...
subroutine, public do_ot_diag(scf_env, mos, matrix_ks, matrix_s, scf_control, scf_section, diis_step)
the inner loop of scf, specific to iterative diagonalization using OT with S matrix; basically,...
subroutine, public do_block_davidson_diag(qs_env, scf_env, mos, matrix_ks, matrix_s, scf_control, scf_section, check_moconv_only)
iterative diagonalization using the block davidson space approach
subroutine, public do_roks_diag(scf_env, mos, matrix_ks, matrix_s, scf_control, scf_section, diis_step, orthogonal_basis)
Solve a set restricted open Kohn-Sham (ROKS) equations based on the alpha and beta Kohn-Sham matrices...
subroutine, public do_scf_diag_subspace(qs_env, scf_env, subspace_env, mos, rho, ks_env, scf_section, scf_control)
inner loop within MOS subspace, to refine occupation and density, before next diagonalization of the ...
subroutine, public do_block_krylov_diag(scf_env, mos, matrix_ks, scf_control, scf_section, check_moconv_only)
iterative diagonalization using the block Krylov-space approach
subroutine, public do_special_diag(scf_env, mos, matrix_ks, scf_control, scf_section, diis_step)
the inner loop of scf, specific to diagonalization without S matrix basically, in goes the ks matrix ...
subroutine, public do_general_diag(scf_env, mos, matrix_ks, matrix_s, scf_control, scf_section, diis_step, probe)
...
subroutine, public do_general_diag_kp(matrix_ks, matrix_s, kpoints, scf_env, scf_control, update_p, diis_step, diis_error, qs_env, probe)
Kpoint diagonalization routine Transforms matrices to kpoint, distributes kpoint groups,...
Utility routines for qs_scf.
subroutine, public qs_scf_check_inner_exit(qs_env, scf_env, scf_control, should_stop, just_energy, exit_inner_loop, inner_loop_converged, output_unit)
checks whether exit conditions for inner loop are satisfied
subroutine, public qs_scf_inner_finalize(scf_env, qs_env, diis_step, output_unit)
Performs the necessary steps before leaving innner scf loop.
subroutine, public qs_scf_set_loop_flags(scf_env, diis_step, energy_only, just_energy, exit_inner_loop)
computes properties for a given hamiltonian using the current wfn
subroutine, public qs_scf_rho_update(rho, qs_env, scf_env, ks_env, mix_rho)
Performs the updates rho (takes care of mixing as well)
subroutine, public qs_scf_new_mos_kp(qs_env, scf_env, scf_control, diis_step, probe)
Updates MOs and density matrix using diagonalization Kpoint code.
subroutine, public qs_scf_check_outer_exit(qs_env, scf_env, scf_control, should_stop, outer_loop_converged, exit_outer_loop)
checks whether exit conditions for outer loop are satisfied
subroutine, public qs_scf_density_mixing(scf_env, rho, para_env, diis_step)
Performs the requested density mixing if any needed.
subroutine, public qs_scf_new_mos(qs_env, scf_env, scf_control, scf_section, diis_step, energy_only, probe)
takes known energy and derivatives and produces new wfns and or density matrix
groups fairly general SCF methods, so that modules other than qs_scf can use them too split off from ...
subroutine, public scf_env_density_mixing(p_mix_new, mixing_store, rho_ao, para_env, iter_delta, iter_count, diis, invert)
perform (if requested) a density mixing
subroutine, public qs_scf_print_summary(output_unit, qs_env)
writes a summary of information after scf
module that contains the definitions of the scf types
integer, parameter, public ot_diag_method_nr
integer, parameter, public filter_matrix_diag_method_nr
integer, parameter, public block_davidson_diag_method_nr
integer, parameter, public smeagol_method_nr
integer, parameter, public ot_method_nr
integer, parameter, public special_diag_method_nr
integer, parameter, public block_krylov_diag_method_nr
integer, parameter, public general_diag_method_nr
parameters that control an scf iteration
subroutine, public run_smeagol_emtrans(qs_env, last, iter, rho_ao_kp)
Run NEGF/SMEAGOL transport calculation.
logical function, public tb_native_scc_mixer_active(dft_control)
Return whether the tblite native SCC mixer is active for this run.
Contains information about kpoints.
stores all the informations relevant to an mpi environment
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
keeps the density in various representations, keeping track of which ones are valid.
contains the parameters needed by a scf run