14 USE dbcsr_api,
ONLY: dbcsr_create,&
35 #include "./base/base_uses.f90"
41 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_mixing_utils'
57 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao, p_delta
58 TYPE(mp_para_env_type),
POINTER :: para_env
59 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: p_out
60 REAL(kind=
dp),
INTENT(INOUT) :: delta
62 CHARACTER(len=*),
PARAMETER :: routinen =
'self_consistency_check'
64 INTEGER :: handle, ic, ispin, nimg, nspins
66 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_q, p_in
68 CALL timeset(routinen, handle)
70 NULLIFY (matrix_q, p_in)
72 cpassert(
ASSOCIATED(p_out))
73 NULLIFY (matrix_q, p_in)
76 nspins =
SIZE(p_in, 1)
83 CALL dbcsr_set(matrix_q(ispin, ic)%matrix, 0.0_dp)
84 CALL cp_sm_mix(m1=p_out(ispin, ic)%matrix, m2=p_in(ispin, ic)%matrix, &
85 p_mix=1.0_dp, delta=tmp, para_env=para_env, &
86 m3=matrix_q(ispin, ic)%matrix)
87 delta = max(tmp, delta)
109 SUBROUTINE mixing_allocate(qs_env, mixing_method, p_mix_new, p_delta, nspins, mixing_store)
110 TYPE(qs_environment_type),
POINTER :: qs_env
111 INTEGER :: mixing_method
112 TYPE(dbcsr_p_type),
DIMENSION(:, :),
OPTIONAL, &
113 POINTER :: p_mix_new, p_delta
114 INTEGER,
INTENT(IN) :: nspins
115 TYPE(mixing_storage_type),
POINTER :: mixing_store
117 CHARACTER(LEN=*),
PARAMETER :: routinen =
'mixing_allocate'
119 INTEGER :: handle, i, ia, iat, ic, ikind, ispin, &
120 max_shell, na, natom, nbuffer, nel, &
122 LOGICAL :: charge_mixing
123 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s
124 TYPE(dbcsr_type),
POINTER :: refmatrix
125 TYPE(dft_control_type),
POINTER :: dft_control
126 TYPE(distribution_1d_type),
POINTER :: distribution_1d
127 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
129 TYPE(rho_atom_type),
DIMENSION(:),
POINTER :: rho_atom
131 CALL timeset(routinen, handle)
133 NULLIFY (matrix_s, dft_control, sab_orb, refmatrix, rho_atom)
136 matrix_s_kp=matrix_s, &
137 dft_control=dft_control)
139 charge_mixing = dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb &
140 .OR. dft_control%qs_control%semi_empirical
141 refmatrix => matrix_s(1, 1)%matrix
142 nimg = dft_control%nimages
145 IF (
PRESENT(p_mix_new))
THEN
146 IF (.NOT.
ASSOCIATED(p_mix_new))
THEN
150 ALLOCATE (p_mix_new(i, ic)%matrix)
151 CALL dbcsr_create(matrix=p_mix_new(i, ic)%matrix, template=refmatrix, &
152 name=
"SCF DENSITY", matrix_type=dbcsr_type_symmetric, nze=0)
154 CALL dbcsr_set(p_mix_new(i, ic)%matrix, 0.0_dp)
161 IF (
PRESENT(p_delta))
THEN
163 IF (.NOT.
ASSOCIATED(p_delta))
THEN
167 ALLOCATE (p_delta(i, ic)%matrix)
168 CALL dbcsr_create(matrix=p_delta(i, ic)%matrix, template=refmatrix, &
169 name=
"SCF DENSITY", matrix_type=dbcsr_type_symmetric, nze=0)
171 CALL dbcsr_set(p_delta(i, ic)%matrix, 0.0_dp)
175 cpassert(
ASSOCIATED(mixing_store))
179 IF (charge_mixing)
THEN
182 cpassert(.NOT. mixing_store%gmix_p)
183 IF (dft_control%qs_control%dftb)
THEN
185 ELSEIF (dft_control%qs_control%xtb)
THEN
188 cpabort(
'UNKNOWN METHOD')
190 nbuffer = mixing_store%nbuffer
191 mixing_store%ncall = 0
192 CALL get_qs_env(qs_env, local_particles=distribution_1d)
193 nkind =
SIZE(distribution_1d%n_el)
194 na = sum(distribution_1d%n_el(:))
195 IF (
ASSOCIATED(mixing_store%atlist))
DEALLOCATE (mixing_store%atlist)
196 ALLOCATE (mixing_store%atlist(na))
197 mixing_store%nat_local = na
198 mixing_store%max_shell = max_shell
201 nel = distribution_1d%n_el(ikind)
204 mixing_store%atlist(ia) = distribution_1d%list(ikind)%array(iat)
207 IF (
ASSOCIATED(mixing_store%acharge))
DEALLOCATE (mixing_store%acharge)
208 ALLOCATE (mixing_store%acharge(na, max_shell, nbuffer))
209 IF (
ASSOCIATED(mixing_store%dacharge))
DEALLOCATE (mixing_store%dacharge)
210 ALLOCATE (mixing_store%dacharge(na, max_shell, nbuffer))
213 IF (
ASSOCIATED(mixing_store%pulay_matrix))
DEALLOCATE (mixing_store%pulay_matrix)
214 ALLOCATE (mixing_store%pulay_matrix(nbuffer, nbuffer, nspins))
215 mixing_store%pulay_matrix = 0.0_dp
217 IF (
ASSOCIATED(mixing_store%abroy))
DEALLOCATE (mixing_store%abroy)
218 ALLOCATE (mixing_store%abroy(nbuffer, nbuffer))
219 mixing_store%abroy = 0.0_dp
220 IF (
ASSOCIATED(mixing_store%wbroy))
DEALLOCATE (mixing_store%wbroy)
221 ALLOCATE (mixing_store%wbroy(nbuffer))
222 mixing_store%wbroy = 0.0_dp
223 IF (
ASSOCIATED(mixing_store%dfbroy))
DEALLOCATE (mixing_store%dfbroy)
224 ALLOCATE (mixing_store%dfbroy(na, max_shell, nbuffer))
225 mixing_store%dfbroy = 0.0_dp
226 IF (
ASSOCIATED(mixing_store%ubroy))
DEALLOCATE (mixing_store%ubroy)
227 ALLOCATE (mixing_store%ubroy(na, max_shell, nbuffer))
228 mixing_store%ubroy = 0.0_dp
230 cpabort(
"multisecant_mixing not available")
235 nbuffer = mixing_store%nbuffer
236 mixing_store%ncall = 0
237 IF (.NOT.
ASSOCIATED(mixing_store%rhoin))
THEN
238 ALLOCATE (mixing_store%rhoin(nspins))
240 NULLIFY (mixing_store%rhoin(ispin)%cc)
244 IF (mixing_store%gmix_p .AND. dft_control%qs_control%gapw)
THEN
245 CALL get_qs_env(qs_env=qs_env, rho_atom_set=rho_atom)
246 natom =
SIZE(rho_atom)
247 IF (.NOT.
ASSOCIATED(mixing_store%paw))
THEN
248 ALLOCATE (mixing_store%paw(natom))
249 mixing_store%paw = .false.
250 ALLOCATE (mixing_store%cpc_h_in(natom, nspins))
251 ALLOCATE (mixing_store%cpc_s_in(natom, nspins))
254 NULLIFY (mixing_store%cpc_h_in(iat, ispin)%r_coef)
255 NULLIFY (mixing_store%cpc_s_in(iat, ispin)%r_coef)
264 IF (.NOT.
ASSOCIATED(mixing_store%res_buffer))
THEN
265 ALLOCATE (mixing_store%res_buffer(nbuffer, nspins))
268 NULLIFY (mixing_store%res_buffer(i, ispin)%cc)
276 IF (.NOT.
ASSOCIATED(mixing_store%pulay_matrix))
THEN
277 ALLOCATE (mixing_store%pulay_matrix(nbuffer, nbuffer, nspins))
280 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_buffer))
THEN
281 ALLOCATE (mixing_store%rhoin_buffer(nbuffer, nspins))
284 NULLIFY (mixing_store%rhoin_buffer(i, ispin)%cc)
288 IF (mixing_store%gmix_p)
THEN
289 IF (dft_control%qs_control%gapw)
THEN
290 IF (.NOT.
ASSOCIATED(mixing_store%cpc_h_in_buffer))
THEN
291 ALLOCATE (mixing_store%cpc_h_in_buffer(nbuffer, natom, nspins))
292 ALLOCATE (mixing_store%cpc_s_in_buffer(nbuffer, natom, nspins))
293 ALLOCATE (mixing_store%cpc_h_res_buffer(nbuffer, natom, nspins))
294 ALLOCATE (mixing_store%cpc_s_res_buffer(nbuffer, natom, nspins))
298 NULLIFY (mixing_store%cpc_h_in_buffer(i, iat, ispin)%r_coef)
299 NULLIFY (mixing_store%cpc_s_in_buffer(i, iat, ispin)%r_coef)
300 NULLIFY (mixing_store%cpc_h_res_buffer(i, iat, ispin)%r_coef)
301 NULLIFY (mixing_store%cpc_s_res_buffer(i, iat, ispin)%r_coef)
312 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_old))
THEN
313 ALLOCATE (mixing_store%rhoin_old(nspins))
315 NULLIFY (mixing_store%rhoin_old(ispin)%cc)
318 IF (.NOT.
ASSOCIATED(mixing_store%drho_buffer))
THEN
319 ALLOCATE (mixing_store%drho_buffer(nbuffer, nspins))
320 ALLOCATE (mixing_store%last_res(nspins))
323 NULLIFY (mixing_store%drho_buffer(i, ispin)%cc)
325 NULLIFY (mixing_store%last_res(ispin)%cc)
328 IF (mixing_store%gmix_p)
THEN
330 IF (dft_control%qs_control%gapw)
THEN
331 IF (.NOT.
ASSOCIATED(mixing_store%cpc_h_old))
THEN
332 ALLOCATE (mixing_store%cpc_h_old(natom, nspins))
333 ALLOCATE (mixing_store%cpc_s_old(natom, nspins))
336 NULLIFY (mixing_store%cpc_h_old(iat, ispin)%r_coef)
337 NULLIFY (mixing_store%cpc_s_old(iat, ispin)%r_coef)
341 IF (.NOT.
ASSOCIATED(mixing_store%dcpc_h_in))
THEN
342 ALLOCATE (mixing_store%dcpc_h_in(nbuffer, natom, nspins))
343 ALLOCATE (mixing_store%dcpc_s_in(nbuffer, natom, nspins))
344 ALLOCATE (mixing_store%cpc_h_lastres(natom, nspins))
345 ALLOCATE (mixing_store%cpc_s_lastres(natom, nspins))
349 NULLIFY (mixing_store%dcpc_h_in(i, iat, ispin)%r_coef)
350 NULLIFY (mixing_store%dcpc_s_in(i, iat, ispin)%r_coef)
352 NULLIFY (mixing_store%cpc_h_lastres(iat, ispin)%r_coef)
353 NULLIFY (mixing_store%cpc_s_lastres(iat, ispin)%r_coef)
363 IF (.NOT.
ASSOCIATED(mixing_store%norm_res_buffer))
THEN
364 ALLOCATE (mixing_store%norm_res_buffer(nbuffer, nspins))
369 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_buffer))
THEN
370 ALLOCATE (mixing_store%rhoin_buffer(nbuffer, nspins))
373 NULLIFY (mixing_store%rhoin_buffer(i, ispin)%cc)
381 CALL timestop(handle)
396 SUBROUTINE mixing_init(mixing_method, rho, mixing_store, para_env, rho_atom)
397 INTEGER,
INTENT(IN) :: mixing_method
398 TYPE(qs_rho_type),
POINTER :: rho
399 TYPE(mixing_storage_type),
POINTER :: mixing_store
400 TYPE(mp_para_env_type),
POINTER :: para_env
401 TYPE(rho_atom_type),
DIMENSION(:),
OPTIONAL, &
404 CHARACTER(len=*),
PARAMETER :: routinen =
'mixing_init'
406 INTEGER :: handle, iat, ib, ig, ig1, ig_count, &
407 iproc, ispin, n1, n2, natom, nbuffer, &
409 REAL(
dp) :: bconst, beta, fdamp, g2max, g2min, kmin
410 REAL(
dp),
DIMENSION(:),
POINTER :: g2
411 REAL(
dp),
DIMENSION(:, :),
POINTER :: g_vec
412 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: rho_ao_kp
413 TYPE(pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g
415 CALL timeset(routinen, handle)
417 NULLIFY (g2, g_vec, rho_ao_kp, rho_g)
418 CALL qs_rho_get(rho, rho_ao_kp=rho_ao_kp, rho_g=rho_g)
421 ng =
SIZE(rho_g(1)%pw_grid%gsq, 1)
422 nimg =
SIZE(rho_ao_kp, 2)
423 mixing_store%ig_max = ng
424 g2 => rho_g(1)%pw_grid%gsq
425 g_vec => rho_g(1)%pw_grid%g
427 IF (mixing_store%max_gvec_exp > 0._dp)
THEN
429 IF (g2(ig) > mixing_store%max_g2)
THEN
430 mixing_store%ig_max = ig
436 IF (.NOT.
ASSOCIATED(mixing_store%kerker_factor))
THEN
437 ALLOCATE (mixing_store%kerker_factor(ng))
439 IF (.NOT.
ASSOCIATED(mixing_store%special_metric))
THEN
440 ALLOCATE (mixing_store%special_metric(ng))
442 beta = mixing_store%beta
444 mixing_store%kerker_factor = 1.0_dp
445 mixing_store%special_metric = 1.0_dp
447 IF (rho_g(1)%pw_grid%have_g0) ig1 = 2
448 DO ig = ig1, mixing_store%ig_max
449 mixing_store%kerker_factor(ig) = max(g2(ig)/(g2(ig) + beta*beta), kmin)
450 mixing_store%special_metric(ig) = &
451 1.0_dp + 50.0_dp/8.0_dp*( &
452 1.0_dp + cos(g_vec(1, ig)) + cos(g_vec(2, ig)) + cos(g_vec(3, ig)) + &
453 cos(g_vec(1, ig))*cos(g_vec(2, ig)) + &
454 cos(g_vec(2, ig))*cos(g_vec(3, ig)) + &
455 cos(g_vec(1, ig))*cos(g_vec(3, ig)) + &
456 cos(g_vec(1, ig))*cos(g_vec(2, ig))*cos(g_vec(3, ig)))
459 nbuffer = mixing_store%nbuffer
461 IF (.NOT.
ASSOCIATED(mixing_store%rhoin(ispin)%cc))
THEN
462 ALLOCATE (mixing_store%rhoin(ispin)%cc(ng))
464 mixing_store%rhoin(ispin)%cc = rho_g(ispin)%array
466 IF (
ASSOCIATED(mixing_store%rhoin_buffer))
THEN
467 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_buffer(1, ispin)%cc))
THEN
469 ALLOCATE (mixing_store%rhoin_buffer(ib, ispin)%cc(ng))
472 mixing_store%rhoin_buffer(1, ispin)%cc(1:ng) = &
473 rho_g(ispin)%array(1:ng)
475 IF (
ASSOCIATED(mixing_store%res_buffer))
THEN
476 IF (.NOT.
ASSOCIATED(mixing_store%res_buffer(1, ispin)%cc))
THEN
478 ALLOCATE (mixing_store%res_buffer(ib, ispin)%cc(ng))
485 mixing_store%rhoin(1)%cc = rho_g(1)%array + rho_g(2)%array
486 mixing_store%rhoin(2)%cc = rho_g(1)%array - rho_g(2)%array
487 IF (
ASSOCIATED(mixing_store%rhoin_buffer))
THEN
488 mixing_store%rhoin_buffer(1, 1)%cc = rho_g(1)%array + rho_g(2)%array
489 mixing_store%rhoin_buffer(1, 2)%cc = rho_g(1)%array - rho_g(2)%array
493 IF (mixing_store%gmix_p)
THEN
494 IF (
PRESENT(rho_atom))
THEN
495 natom =
SIZE(rho_atom)
498 IF (
ASSOCIATED(rho_atom(iat)%cpc_s(ispin)%r_coef))
THEN
499 mixing_store%paw(iat) = .true.
500 n1 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 1)
501 n2 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 2)
502 IF (
ASSOCIATED(mixing_store%cpc_s_in))
THEN
503 IF (.NOT.
ASSOCIATED(mixing_store%cpc_s_in(iat, ispin)%r_coef))
THEN
504 ALLOCATE (mixing_store%cpc_s_in(iat, ispin)%r_coef(n1, n2))
505 ALLOCATE (mixing_store%cpc_h_in(iat, ispin)%r_coef(n1, n2))
507 mixing_store%cpc_h_in(iat, ispin)%r_coef = rho_atom(iat)%cpc_h(ispin)%r_coef
508 mixing_store%cpc_s_in(iat, ispin)%r_coef = rho_atom(iat)%cpc_s(ispin)%r_coef
518 IF (mixing_store%gmix_p .AND.
PRESENT(rho_atom))
THEN
521 IF (mixing_store%paw(iat))
THEN
522 n1 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 1)
523 n2 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 2)
524 IF (.NOT.
ASSOCIATED(mixing_store%cpc_h_in_buffer(1, iat, ispin)%r_coef))
THEN
526 ALLOCATE (mixing_store%cpc_s_in_buffer(ib, iat, ispin)%r_coef(n1, n2))
527 ALLOCATE (mixing_store%cpc_h_in_buffer(ib, iat, ispin)%r_coef(n1, n2))
528 ALLOCATE (mixing_store%cpc_s_res_buffer(ib, iat, ispin)%r_coef(n1, n2))
529 ALLOCATE (mixing_store%cpc_h_res_buffer(ib, iat, ispin)%r_coef(n1, n2))
533 mixing_store%cpc_h_in_buffer(ib, iat, ispin)%r_coef = 0.0_dp
534 mixing_store%cpc_s_in_buffer(ib, iat, ispin)%r_coef = 0.0_dp
535 mixing_store%cpc_h_res_buffer(ib, iat, ispin)%r_coef = 0.0_dp
536 mixing_store%cpc_s_res_buffer(ib, iat, ispin)%r_coef = 0.0_dp
544 IF (.NOT.
ASSOCIATED(mixing_store%rhoin_old(ispin)%cc))
THEN
545 ALLOCATE (mixing_store%rhoin_old(ispin)%cc(ng))
547 IF (.NOT.
ASSOCIATED(mixing_store%drho_buffer(1, ispin)%cc))
THEN
549 ALLOCATE (mixing_store%drho_buffer(ib, ispin)%cc(ng))
551 ALLOCATE (mixing_store%last_res(ispin)%cc(ng))
554 mixing_store%drho_buffer(ib, ispin)%cc = cmplx(0.0_dp, 0.0_dp, kind=
dp)
556 mixing_store%last_res(ispin)%cc = cmplx(0.0_dp, 0.0_dp, kind=
dp)
557 mixing_store%rhoin_old(ispin)%cc = cmplx(0.0_dp, 0.0_dp, kind=
dp)
559 IF (mixing_store%gmix_p)
THEN
560 IF (
PRESENT(rho_atom))
THEN
563 IF (mixing_store%paw(iat))
THEN
564 n1 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 1)
565 n2 =
SIZE(rho_atom(iat)%cpc_s(ispin)%r_coef, 2)
566 IF (.NOT.
ASSOCIATED(mixing_store%cpc_s_old(iat, ispin)%r_coef))
THEN
567 ALLOCATE (mixing_store%cpc_s_old(iat, ispin)%r_coef(n1, n2))
568 ALLOCATE (mixing_store%cpc_h_old(iat, ispin)%r_coef(n1, n2))
570 mixing_store%cpc_h_old(iat, ispin)%r_coef = 0.0_dp
571 mixing_store%cpc_s_old(iat, ispin)%r_coef = 0.0_dp
572 IF (.NOT.
ASSOCIATED(mixing_store%dcpc_s_in(1, iat, ispin)%r_coef))
THEN
574 ALLOCATE (mixing_store%dcpc_h_in(ib, iat, ispin)%r_coef(n1, n2))
575 ALLOCATE (mixing_store%dcpc_s_in(ib, iat, ispin)%r_coef(n1, n2))
577 ALLOCATE (mixing_store%cpc_h_lastres(iat, ispin)%r_coef(n1, n2))
578 ALLOCATE (mixing_store%cpc_s_lastres(iat, ispin)%r_coef(n1, n2))
581 mixing_store%dcpc_h_in(ib, iat, ispin)%r_coef = 0.0_dp
582 mixing_store%dcpc_s_in(ib, iat, ispin)%r_coef = 0.0_dp
584 mixing_store%cpc_h_lastres(iat, ispin)%r_coef = 0.0_dp
585 mixing_store%cpc_s_lastres(iat, ispin)%r_coef = 0.0_dp
592 IF (.NOT.
ASSOCIATED(mixing_store%p_metric))
THEN
593 ALLOCATE (mixing_store%p_metric(ng))
594 bconst = mixing_store%bconst
597 IF (g2(ig) > 1.e-10_dp) g2min = min(g2min, g2(ig))
601 g2max = max(g2max, g2(ig))
603 CALL para_env%min(g2min)
604 CALL para_env%max(g2max)
608 fdamp = (bconst - 1.0_dp)*g2min*g2max/(g2max - g2min*bconst)
610 mixing_store%p_metric(ig) = (g2(ig) + fdamp)/max(g2(ig), 1.e-10_dp)
612 IF (rho_g(1)%pw_grid%have_g0) mixing_store%p_metric(1) = bconst
615 IF (.NOT.
ASSOCIATED(mixing_store%ig_global_index))
THEN
616 ALLOCATE (mixing_store%ig_global_index(ng))
618 mixing_store%ig_global_index = 0
620 DO iproc = 0, para_env%num_pe - 1
621 IF (para_env%mepos == iproc)
THEN
623 ig_count = ig_count + 1
624 mixing_store%ig_global_index(ig) = ig_count
627 CALL para_env%bcast(ig_count, iproc)
631 CALL timestop(handle)
643 TYPE(mixing_storage_type),
INTENT(INOUT) :: mixing_store
645 mixing_store%acharge = 0.0_dp
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
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.
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
module that contains the definitions of the scf types
integer, parameter, public broyden_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, 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.
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
subroutine, public self_consistency_check(rho_ao, p_delta, para_env, p_out, delta)
...
Define the neighbor list data types and the corresponding functionality.
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...
groups fairly general SCF methods, so that modules other than qs_scf can use them too split off from ...
subroutine, public cp_sm_mix(m1, m2, p_mix, delta, para_env, m3)
Perform a mixing of the given matrixes into the first matrix m1 = m2 + p_mix (m1-m2)