(git:d3d49ac)
Loading...
Searching...
No Matches
gw_non_periodic_ri_rs.F File Reference

Go to the source code of this file.

Modules

module  gw_non_periodic_ri_rs
 GW using RI-RS Approximation for molecules.
 

Functions/Subroutines

subroutine, public gw_non_periodic_ri_rs::gw_calc_non_periodic_ri_rs (qs_env, bs_env)
 GW calculation using RI-RS formalism for molecules.
 
subroutine, public gw_non_periodic_ri_rs::precompute_ri_rs_radii (qs_env, bs_env)
 Compute per-atom AO and RI basis radii from the most diffuse Gaussian primitive in the AO ("ORB") and RI auxiliary ("RI_AUX") basis sets. Stores results in bs_envri_rsradius_ao_per_atom(:) and bs_envri_rsradius_ri_per_atom(:) and prints a per-atom table. Radius: r_kind = sqrt(-log(eps) / alpha_min_kind) with eps = eps_filter.
 
subroutine, public gw_non_periodic_ri_rs::ri_rs_grid_assembler (qs_env, bs_env, ri_rs_grid_points)
 Compute grid points for RI-RS Right now based on Ivan and Xavier implementation JCP 150, 174120 (2019), JCTC 17, 2383 (2021)
 
subroutine, public gw_non_periodic_ri_rs::atomic_basis_at_grid_point (qs_env, bs_env, ri_rs_grid_points, mat_phi_mu_l)
 Evaluates the AO basis on the RI-RS grid and stores it as the sparse DBCSR matrix Φ_μl = Φ_μ(r_l) (rows = grid points in atom-aligned blocks of at most max_elements_per_block points, columns = one block per atom's full AO set). Grid points outside the reach of an atom's most diffuse Gaussian (or the CUTOFF_RADIUS_RL_AO) are skipped, and only blocks with at least one element > eps_filter are stored. This locality is the source of ALL grid-dimension sparsity used downstream. Also caches the atom centers and the per-chunk centroids needed by the optional CUTOFF_RADIUS_G_W / CUTOFF_RADIUS_RL_W operator truncations.
 
subroutine, public gw_non_periodic_ri_rs::get_basis_offsets (particle_set, qs_kind_set, first_sgf, total_sgf)
 Computes the AO basis offsets: first_sgf(iatom) is the global index of the first spherical Gaussian function (SGF) of iatom, first_sgf(natom+1) = total_sgf + 1, and total_sgf is the total number of AO basis functions.
 
subroutine, public gw_non_periodic_ri_rs::compute_coeff_z_lp (qs_env, bs_env, ri_rs_grid_points, mat_phi_mu_l, mat_z_lp)
 Computes the RI-RS fitting coefficients Z_lP by solving, independently for every RI atom P, a Jacobi-conditioned, Tikhonov-regularized linear system restricted to the grid points r_l inside P's integration sphere |r_l - R_P| <= cutoff_ri(P): D_ll' = [ Σ_μ Φ_μ(r_l) Φ_μ(r_l') ]² (squared grid Gram matrix, Eq. 13) D_lP = Σ_μν Φ_μ(r_l) Φ_ν(r_l) (μν|P) (grid-RI right-hand side, Eq. 15) d_l = 1 / sqrt(D_ll) (Jacobi conditioning vector) D'_ll' = d_l D_ll' d_l' + λ δ_ll' (λ = TIKHONOV_SIGMA regularization) Σ_l' D'_ll' Z'_l'P = d_l D_lP (Cholesky solve, Eq. 14) Z_lP = d_l Z'_l'P (undo the conditioning) Work is distributed over atoms in two phases (planned by classify_z_lp_atoms and lpt_assign_atoms): Phase A solves "small" atoms with single-rank LAPACK (dpotrf/dpotrs); Phase B solves "big" atoms, whose dense Gram matrix would exceed one rank's memory, with ScaLAPACK (pdpotrf/pdpotrs) over rank subgroups of size G. The solved Z columns are scattered into the sparse global mat_Z_lP. If a Z_lP restart file exists, it is read instead and the solve is skipped entirely.
 
subroutine, public gw_non_periodic_ri_rs::solve_d_lp_distributed (phi_local, d_vec, d_lp, n_loc, n_ao, n_rhs, tikhonov, para_env_sub, blacs_env_sub, fm_struct_d, fm_struct_b, fm_d, fm_b, info)
 Distributed pdpotrf/pdpotrs solve of D x = b for one atom of the RI-RS Z_lP build (Phase B, "big" atoms), called with a subgroup of cooperating ranks and an associated BLACS context. Each rank in the subgroup holds the (replicated) phi_local and the (replicated) RHS d_lp; it builds its own block-cyclic slice of the squared+Jacobi-scaled Gram matrix D via tiled DGEMM, factorizes via cp_fm_cholesky_decompose (UPLO='U'), and solves with cp_fm_cholesky_solve. The replicated d_lp is updated in place via cp_fm_get_submatrix.