27 USE dbcsr_api,
ONLY: &
28 dbcsr_add, dbcsr_create, dbcsr_dot, dbcsr_get_info, dbcsr_iterator_blocks_left, &
29 dbcsr_iterator_next_block, dbcsr_iterator_start, dbcsr_iterator_stop, dbcsr_iterator_type, &
30 dbcsr_multiply, dbcsr_p_type, dbcsr_release, dbcsr_scale_by_vector, dbcsr_set, dbcsr_type, &
31 dbcsr_type_antisymmetric, dbcsr_type_no_symmetry, dbcsr_type_symmetric
38 lri_environment_type,&
65 #include "./base/base_uses.f90"
73 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'ri_environment_methods'
89 TYPE(lri_environment_type),
POINTER :: lri_env
90 TYPE(qs_environment_type),
POINTER :: qs_env
91 LOGICAL,
INTENT(IN) :: calculate_forces
93 CALL calculate_ri_integrals(lri_env, qs_env, calculate_forces)
104 SUBROUTINE calculate_ri_integrals(lri_env, qs_env, calculate_forces)
106 TYPE(lri_environment_type),
POINTER :: lri_env
107 TYPE(qs_environment_type),
POINTER :: qs_env
108 LOGICAL,
INTENT(IN) :: calculate_forces
110 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_ri_integrals'
111 REAL(kind=
dp),
DIMENSION(2),
PARAMETER :: fx = (/0.0_dp, 1.0_dp/)
113 INTEGER :: handle, i, i1, i2, iatom, ispin, izero, &
114 j, j1, j2, jatom, m, n, nbas
115 INTEGER,
DIMENSION(:, :),
POINTER :: bas_ptr
116 REAL(kind=
dp) :: fpre
117 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eval
118 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: avec, fblk, fout
119 TYPE(cp_blacs_env_type),
POINTER :: blacs_env
120 TYPE(dbcsr_iterator_type) :: iter
121 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_p
122 TYPE(dbcsr_type) :: emat
123 TYPE(dbcsr_type),
POINTER :: fmat
124 TYPE(dft_control_type),
POINTER :: dft_control
125 TYPE(mp_para_env_type),
POINTER :: para_env
126 TYPE(qs_ks_env_type),
POINTER :: ks_env
127 TYPE(qs_rho_type),
POINTER :: rho
129 CALL timeset(routinen, handle)
131 cpassert(
ASSOCIATED(lri_env))
132 cpassert(
ASSOCIATED(qs_env))
136 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control)
137 NULLIFY (rho, matrix_p)
140 IF (calculate_forces)
THEN
145 CALL dbcsr_create(fmat, template=matrix_p(1)%matrix)
146 DO ispin = 1, dft_control%nspins
147 fpre = lri_env%ri_fit%ftrm1n(ispin)/lri_env%ri_fit%ntrm1n
148 CALL dbcsr_add(fmat, matrix_p(ispin)%matrix, fx(ispin), -fpre)
151 basis_type_a=
"ORB", basis_type_b=
"ORB", sab_nl=lri_env%soo_list, &
152 calculate_forces=.true., matrix_p=fmat)
153 CALL dbcsr_release(fmat)
157 basis_type_a=
"ORB", basis_type_b=
"ORB", sab_nl=lri_env%soo_list)
161 basis_type_a=
"RI_HXC", basis_type_b=
"RI_HXC", sab_nl=lri_env%saa_list)
162 IF (calculate_forces)
THEN
164 bas_ptr => lri_env%ri_fit%bas_ptr
165 avec => lri_env%ri_fit%avec
166 fout => lri_env%ri_fit%fout
168 CALL dbcsr_create(fmat, template=lri_env%ri_smat(1)%matrix)
170 CALL dbcsr_set(fmat, 0.0_dp)
171 CALL dbcsr_iterator_start(iter, fmat)
172 DO WHILE (dbcsr_iterator_blocks_left(iter))
173 CALL dbcsr_iterator_next_block(iter, iatom, jatom, fblk)
174 i1 = bas_ptr(1, iatom)
175 i2 = bas_ptr(2, iatom)
176 j1 = bas_ptr(1, jatom)
177 j2 = bas_ptr(2, jatom)
178 IF (iatom <= jatom)
THEN
179 DO ispin = 1, dft_control%nspins
184 fblk(n, m) = fblk(n, m) + fout(i, ispin)*avec(j, ispin) + avec(i, ispin)*fout(j, ispin)
189 DO ispin = 1, dft_control%nspins
194 fblk(m, n) = fblk(m, n) + fout(i, ispin)*avec(j, ispin) + avec(i, ispin)*fout(j, ispin)
199 IF (iatom == jatom)
THEN
200 fblk(:, :) = 0.25_dp*fblk(:, :)
202 fblk(:, :) = 0.5_dp*fblk(:, :)
205 CALL dbcsr_iterator_stop(iter)
208 basis_type_a=
"RI_HXC", basis_type_b=
"RI_HXC", sab_nl=lri_env%saa_list, &
209 calculate_forces=.true., matrix_p=fmat)
210 CALL dbcsr_release(fmat)
215 ALLOCATE (lri_env%ri_sinv(1)%matrix)
216 SELECT CASE (lri_env%ri_sinv_app)
220 CALL dbcsr_create(lri_env%ri_sinv(1)%matrix, template=lri_env%ri_smat(1)%matrix)
221 CALL invert_hotelling(lri_env%ri_sinv(1)%matrix, lri_env%ri_smat(1)%matrix, &
222 threshold=1.e-10_dp, use_inv_as_guess=.false., &
223 norm_convergence=1.e-10_dp, filter_eps=1.e-12_dp, silent=.false.)
225 CALL dbcsr_create(emat, matrix_type=dbcsr_type_no_symmetry, template=lri_env%ri_smat(1)%matrix)
226 CALL get_qs_env(qs_env=qs_env, para_env=para_env, blacs_env=blacs_env)
227 CALL dbcsr_get_info(lri_env%ri_smat(1)%matrix, nfullrows_total=nbas)
228 ALLOCATE (eval(nbas))
229 CALL cp_dbcsr_syevd(lri_env%ri_smat(1)%matrix, emat, eval, para_env, blacs_env)
232 IF (eval(i) < 1.0e-10_dp)
THEN
236 eval(i) = sqrt(1.0_dp/eval(i))
239 CALL dbcsr_scale_by_vector(emat, eval, side=
'right')
240 CALL dbcsr_create(lri_env%ri_sinv(1)%matrix, template=lri_env%ri_smat(1)%matrix)
241 CALL dbcsr_multiply(
"N",
"T", 1.0_dp, emat, emat, 0.0_dp, lri_env%ri_sinv(1)%matrix)
243 CALL dbcsr_release(emat)
245 CALL dbcsr_create(lri_env%ri_sinv(1)%matrix, template=lri_env%ri_smat(1)%matrix)
246 CALL invert_hotelling(lri_env%ri_sinv(1)%matrix, lri_env%ri_smat(1)%matrix, &
247 threshold=1.e-5_dp, use_inv_as_guess=.false., &
248 norm_convergence=1.e-4_dp, filter_eps=1.e-4_dp, silent=.false.)
250 cpabort(
"Unknown RI_SINV type")
255 vecr=lri_env%ri_fit%nvec, &
256 vecx=lri_env%ri_fit%rm1n, &
257 matp=lri_env%ri_sinv(1)%matrix, &
258 solver=lri_env%ri_sinv_app, &
259 ptr=lri_env%ri_fit%bas_ptr)
262 lri_env%ri_fit%ntrm1n = sum(lri_env%ri_fit%nvec(:)*lri_env%ri_fit%rm1n(:))
265 IF (
ASSOCIATED(lri_env%o3c))
THEN
268 ALLOCATE (lri_env%o3c)
271 lri_env%orb_basis, lri_env%orb_basis, lri_env%ri_basis, &
272 lri_env%soo_list, lri_env%soa_list)
276 CALL timestop(handle)
278 END SUBROUTINE calculate_ri_integrals
290 TYPE(dbcsr_type) :: mat
291 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: vecr
292 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: vecx
293 TYPE(dbcsr_type) :: matp
294 CHARACTER(LEN=*),
INTENT(IN) :: solver
295 INTEGER,
DIMENSION(:, :),
INTENT(IN) :: ptr
297 CHARACTER(LEN=*),
PARAMETER :: routinen =
'ri_metric_solver'
299 INTEGER :: handle, max_iter, n
301 REAL(kind=
dp) :: rerror, threshold
302 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: vect
304 CALL timeset(routinen, handle)
306 threshold = 1.e-10_dp
314 converged=converged, threshold=threshold, max_iter=max_iter)
315 CASE (
"INVS",
"INVF")
317 CALL ri_matvec(matp, vecr, vecx, ptr)
320 converged=converged, threshold=threshold, max_iter=max_iter)
322 cpabort(
"Unknown RI solver")
325 IF (.NOT. converged)
THEN
330 CALL ri_matvec(mat, vecx, vect, ptr)
331 vect(:) = vect(:) - vecr(:)
332 rerror = maxval(abs(vect(:)))
334 IF (rerror > threshold)
THEN
335 cpwarn(
"RI solver: CG did not converge properly")
339 CALL timestop(handle)
357 lri_rho_struct, atomic_kind_set, para_env)
359 TYPE(lri_environment_type),
POINTER :: lri_env
360 TYPE(qs_environment_type),
POINTER :: qs_env
361 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: pmatrix
362 TYPE(qs_rho_type),
INTENT(IN) :: lri_rho_struct
363 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
364 TYPE(mp_para_env_type),
POINTER :: para_env
366 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_ri_densities'
368 INTEGER :: atom_a, handle, i1, i2, iatom, ikind, &
369 ispin, n, natom, nspin
370 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_of_kind, kind_of
371 INTEGER,
DIMENSION(:, :),
POINTER :: bas_ptr
372 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tot_rho_r
373 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: avec
374 TYPE(lri_density_type),
POINTER :: lri_density
375 TYPE(lri_kind_type),
DIMENSION(:),
POINTER :: lri_coef
376 TYPE(pw_c1d_gs_type),
DIMENSION(:),
POINTER :: rho_g
377 TYPE(pw_r3d_rs_type),
DIMENSION(:),
POINTER :: rho_r
379 CALL timeset(routinen, handle)
381 nspin =
SIZE(pmatrix, 1)
383 CALL calculate_tvec_ri(lri_env, lri_env%o3c, para_env)
384 CALL calculate_avec_ri(lri_env, pmatrix)
386 CALL get_qs_env(qs_env, lri_density=lri_density, natom=natom)
387 IF (
ASSOCIATED(lri_density))
THEN
390 ALLOCATE (lri_density)
393 lri_density%nspin = nspin
397 avec => lri_env%ri_fit%avec
398 bas_ptr => lri_env%ri_fit%bas_ptr
399 ALLOCATE (atom_of_kind(natom), kind_of(natom))
402 lri_coef => lri_density%lri_coefs(ispin)%lri_kinds
404 ikind = kind_of(iatom)
405 atom_a = atom_of_kind(iatom)
406 i1 = bas_ptr(1, iatom)
407 i2 = bas_ptr(2, iatom)
409 lri_coef(ikind)%acoef(atom_a, 1:n) = avec(i1:i2, ispin)
412 CALL set_qs_env(qs_env, lri_density=lri_density)
413 DEALLOCATE (atom_of_kind, kind_of)
415 CALL qs_rho_get(lri_rho_struct, rho_r=rho_r, rho_g=rho_g, tot_rho_r=tot_rho_r)
417 lri_coef => lri_density%lri_coefs(ispin)%lri_kinds
419 lri_coef, tot_rho_r(ispin),
"RI_HXC", .false.)
422 CALL timestop(handle)
432 SUBROUTINE calculate_tvec_ri(lri_env, o3c, para_env)
434 TYPE(lri_environment_type),
POINTER :: lri_env
435 TYPE(o3c_container_type),
POINTER :: o3c
436 TYPE(mp_para_env_type),
POINTER :: para_env
438 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_tvec_ri'
439 INTEGER,
PARAMETER :: msweep = 32
441 INTEGER :: handle, i1, i2, ibl, ibu, il, ispin, &
442 isweep, it, iu, katom, m, ma, mba, &
443 mepos, natom, nspin, nsweep, nthread
444 INTEGER,
DIMENSION(2, msweep) :: nlimit
445 INTEGER,
DIMENSION(:, :),
POINTER :: bas_ptr
446 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: ta
447 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: rm1t, tvec, tvl
448 TYPE(o3c_iterator_type) :: o3c_iterator
450 CALL timeset(routinen, handle)
452 nspin =
SIZE(lri_env%ri_fit%tvec, 2)
453 bas_ptr => lri_env%ri_fit%bas_ptr
454 tvec => lri_env%ri_fit%tvec
456 natom =
SIZE(bas_ptr, 2)
460 IF (natom < 1000)
THEN
463 nsweep = min(nthread, msweep)
467 DO isweep = 1, nsweep
468 nlimit(1:2, isweep) =
get_limit(natom, nsweep, isweep - 1)
472 DO isweep = 1, nsweep
473 il = nlimit(1, isweep)
474 iu = nlimit(2, isweep)
480 ALLOCATE (ta(mba, nthread))
492 DO WHILE (
o3c_iterate(o3c_iterator, mepos=mepos) == 0)
494 IF (katom < il .OR. katom > iu) cycle
495 i1 = bas_ptr(1, katom) - ibl + 1
496 i2 = bas_ptr(2, katom) - ibl + 1
498 ta(i1:i2, mepos + 1) = ta(i1:i2, mepos + 1) + tvl(1:m, ispin)
505 tvec(ibl:ibu, ispin) = tvec(ibl:ibu, ispin) + ta(1:mba, it)
512 CALL para_env%sum(tvec)
514 rm1t => lri_env%ri_fit%rm1t
518 vecr=tvec(:, ispin), &
519 vecx=rm1t(:, ispin), &
520 matp=lri_env%ri_sinv(1)%matrix, &
521 solver=lri_env%ri_sinv_app, &
525 CALL timestop(handle)
527 END SUBROUTINE calculate_tvec_ri
535 SUBROUTINE calculate_avec_ri(lri_env, pmatrix)
537 TYPE(lri_environment_type),
POINTER :: lri_env
538 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: pmatrix
540 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calculate_avec_ri'
542 INTEGER :: handle, ispin, nspin
543 REAL(kind=
dp) :: etr, nelec, nrm1t
544 REAL(kind=
dp),
DIMENSION(:),
POINTER :: nvec, rm1n
545 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: avec, rm1t, tvec
546 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: smatrix
548 CALL timeset(routinen, handle)
550 nspin =
SIZE(pmatrix)
552 smatrix => lri_env%ob_smat
555 CALL dbcsr_dot(smatrix(1)%matrix, pmatrix(ispin)%matrix, etr)
556 lri_env%ri_fit%echarge(ispin) = etr
559 tvec => lri_env%ri_fit%tvec
560 rm1t => lri_env%ri_fit%rm1t
561 nvec => lri_env%ri_fit%nvec
562 rm1n => lri_env%ri_fit%rm1n
566 nelec = lri_env%ri_fit%echarge(ispin)
567 nrm1t = sum(nvec(:)*rm1t(:, ispin))
568 lri_env%ri_fit%lambda(ispin) = 2.0_dp*(nrm1t - nelec)/lri_env%ri_fit%ntrm1n
572 avec => lri_env%ri_fit%avec
574 avec(:, ispin) = rm1t(:, ispin) - 0.5_dp*lri_env%ri_fit%lambda(ispin)*rm1n(:)
577 CALL timestop(handle)
579 END SUBROUTINE calculate_avec_ri
588 SUBROUTINE ri_matvec(mat, vi, vo, ptr)
590 TYPE(dbcsr_type) :: mat
591 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: vi
592 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: vo
593 INTEGER,
DIMENSION(:, :),
INTENT(IN) :: ptr
595 CHARACTER(LEN=*),
PARAMETER :: routinen =
'ri_matvec'
597 CHARACTER :: matrix_type
598 INTEGER :: group_handle, handle, iatom, jatom, m1, &
601 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: block
602 TYPE(dbcsr_iterator_type) :: iter
603 TYPE(mp_comm_type) :: group
605 CALL timeset(routinen, handle)
607 CALL dbcsr_get_info(mat, matrix_type=matrix_type, group=group_handle)
608 CALL group%set_handle(group_handle)
610 SELECT CASE (matrix_type)
611 CASE (dbcsr_type_no_symmetry)
613 CASE (dbcsr_type_symmetric)
615 CASE (dbcsr_type_antisymmetric)
616 cpabort(
"NYI, antisymmetric matrix not permitted")
618 cpabort(
"Unknown matrix type, ...")
622 CALL dbcsr_iterator_start(iter, mat)
623 DO WHILE (dbcsr_iterator_blocks_left(iter))
624 CALL dbcsr_iterator_next_block(iter, iatom, jatom, block)
631 cpassert(nb ==
SIZE(block, 1))
632 cpassert(mb ==
SIZE(block, 2))
633 vo(n1:n2) = vo(n1:n2) + matmul(block, vi(m1:m2))
634 IF (symm .AND. (iatom /= jatom))
THEN
635 vo(m1:m2) = vo(m1:m2) + matmul(transpose(block), vi(n1:n2))
638 CALL dbcsr_iterator_stop(iter)
642 CALL timestop(handle)
644 END SUBROUTINE ri_matvec
arnoldi iteration using dbcsr
subroutine, public arnoldi_conjugate_gradient(matrix_a, vec_x, matrix_p, converged, threshold, max_iter)
Wrapper for conjugated gradient algorithm for Ax=b.
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
methods related to the blacs parallel environment
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
Interface to (sca)lapack for the Cholesky based procedures.
subroutine, public cp_dbcsr_syevd(matrix, eigenvectors, eigenvalues, para_env, blacs_env)
...
DBCSR operations in CP2K.
Routines useful for iterative matrix calculations.
subroutine, public invert_hotelling(matrix_inverse, matrix, threshold, use_inv_as_guess, norm_convergence, filter_eps, accelerator_order, max_iter_lanczos, eps_lanczos, silent)
invert a symmetric positive definite matrix by Hotelling's method explicit symmetrization makes this ...
Defines the basic variable types.
integer, parameter, public dp
contains the types and subroutines for dealing with the lri_env lri : local resolution of the identit...
subroutine, public allocate_lri_coefs(lri_env, lri_density, atomic_kind_set)
creates and initializes lri_coefs
subroutine, public lri_density_release(lri_density)
releases the given lri_density
subroutine, public lri_density_create(lri_density)
creates and initializes an lri_density environment
Interface to the message passing library MPI.
Calculate the plane wave density by collocating the primitive Gaussian functions (pgf).
subroutine, public calculate_lri_rho_elec(lri_rho_g, lri_rho_r, qs_env, lri_coef, total_rho, basis_type, exact_1c_terms, pmat, atomlist)
Collocates the fitted lri density on a grid.
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.
Methods used with 3-center overlap type integrals containers.
subroutine, public calculate_o3c_integrals(o3c, calculate_forces, matrix_p)
...
subroutine, public contract12_o3c(o3c, matrix_p)
Contraction of 3-tensor over indices 1 and 2 (assuming symmetry) t(k) = sum_ij (ijk)*p(ij)
3-center overlap type integrals containers
subroutine, public get_o3c_iterator_info(o3c_iterator, mepos, iatom, jatom, katom, ikind, jkind, kkind, rij, rik, cellj, cellk, integral, tvec, force_i, force_j, force_k)
...
subroutine, public o3c_iterator_create(o3c, o3c_iterator, nthread)
...
subroutine, public release_o3c_container(o3c_container)
...
subroutine, public o3c_iterator_release(o3c_iterator)
...
integer function, public o3c_iterate(o3c_iterator, mepos)
...
subroutine, public init_o3c_container(o3c, nspin, basis_set_list_a, basis_set_list_b, basis_set_list_c, sab_nl, sac_nl, only_bc_same_center)
...
Calculation of overlap matrix, its derivatives and forces.
subroutine, public build_overlap_matrix(ks_env, matrix_s, matrixkp_s, matrix_name, nderivative, basis_type_a, basis_type_b, sab_nl, calculate_forces, matrix_p, matrixkp_p)
Calculation of the overlap matrix over Cartesian Gaussian functions.
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...
Calculates integral matrices for RIGPW method.
subroutine, public build_ri_matrices(lri_env, qs_env, calculate_forces)
creates and initializes an lri_env
subroutine, public ri_metric_solver(mat, vecr, vecx, matp, solver, ptr)
solver for RI systems (R*x=n)
subroutine, public calculate_ri_densities(lri_env, qs_env, pmatrix, lri_rho_struct, atomic_kind_set, para_env)
performs the fitting of the density and distributes the fitted density on the grid
All kind of helpful little routines.
pure integer function, dimension(2), public get_limit(m, n, me)
divide m entries into n parts, return size of part me