![]() |
(git:d3d49ac)
|
RT-BSE RI-RS kernels: SEX and Hartree evaluated by collocation on grid points r_l. Once-built grid objects: φ_µ(r_l) [grid×AO], Z_lP [grid×RI], V^aux_PQ = [M^-1 V^tr M^-1]_PQ [RI×RI], W^0_ll' = sum_PQ Z_lP (V + W^c(ω=0))_PQ Z_l'Q. Per-call kernels, collocation X = φ_µ(r_l) (AO domain, written φ_lµ below): SEX: ρ^grid_ll' = sum_µν φ_lµ Δρ_µν φ_l'ν ; Σ_µν = pref * sum_ll' φ_lµ [ρ^grid ∘ W^0]_ll' φ_l'ν Hartree: n_l = sum_µν φ_lµ Δρ_µν φ_lν ; v_l = sum_PQl' Z_lP V^aux_PQ Z_l'Q n_l' (applied factorized, stage 2) ; V^H_µν = sum_l φ_lµ v_l φ_lν (diagonal-only, no grid×grid) Independent of which GW variant produced bs_envfm_W_MIC_freq_zero. More...
Functions/Subroutines | |
| subroutine, public | rt_bse_ri_rs_ensure_grid (bs_env, qs_env) |
| Make sure the AO collocation φ_µ(r_l) (mat_phi_mu_l) and the RI fit coefficients Z_lP (mat_Z_lP) are populated in memory. If GW was run with RI-RS the grid is already built; otherwise build it here so the AO-RI GW + RI-RS RT-BSE combination is possible. | |
| subroutine, public | rt_bse_ri_rs_ensure_v_grid (bs_env, qs_env) |
| Build V^aux_PQ = [M^-1 V^tr M^-1]_PQ (truncated Coulomb in the RI basis, M^-1-sandwiched to match the W^MIC convention). The grid Coulomb V_ll' = sum_PQ Z_lP V^aux_PQ Z_l'Q is never materialized – the Hartree stage applies it factorized: v_l = sum_PQl' Z_lP V^aux_PQ Z_l'Q n_l' Needed by RT-BSE RI-RS Hartree. | |
| subroutine, public | rt_bse_ri_rs_ensure_w0_grid (bs_env, qs_env) |
| Build W^0_ll' = sum_PQ Z_lP (V + W^c(ω=0))_PQ Z_l'Q (statically screened W on the grid). Needed by RT-BSE RI-RS SEX/COH. Reuses bs_envfm_W_MIC_freq_zero which must already contain M^-1 W^c(ω=0) M^-1 (built by either GW path under the BSE rtp_method gate). W^0 enters only through the Hadamard ρ^grid ∘ W^0 – its elements are needed, so it is the one persistent grid×grid object of the kernel layer. | |
| subroutine, public | compute_sigma_ri_rs (bs_env, sigma_ao_fm, prefactor, rho_ao_fm, grid_diag_accum) |
| AO-domain SEX: Σ_µν = pref * sum_ll' φ_lµ [ρ^grid ∘ W^0]_ll' φ_l'ν, ρ^grid_ll' = sum_µν φ_lµ Δρ_µν φ_l'ν. The grid×grid ρ^grid is intrinsic to SEX – the Hadamard needs W^0's elements, so no factorized application exists (unlike the Hartree V_ll'). Real input, real output; used for COH (input S^-1) and the init reference (ρ^0); dynamic Δρ goes through the complex variant. Mirrors the AO-RI get_sigma(rtbse_env, sigma_fm, prefactor, rho_fm) API. | |
| subroutine, public | compute_sigma_ri_rs_complex (bs_env, sigma_ao_cfm, prefactor, rho_ao_cfm, grid_diag_re_accum, grid_diag_im_accum) |
| Complex-input AO SEX via Re/Im split: the kernel is real, so complex linearity holds as Σ[Δρ] = Σ[Re Δρ] + i Σ[Im Δρ]. Required for non-Hermitian Δρ inputs (TDA OV-only / ABBA OV+VO). | |
| subroutine, public | compute_hartree_ri_rs (bs_env, rho_ao_fm, v_h_ao_fm) |
| AO-domain Hartree via RI-RS: n_l = sum_µν φ_lµ Δρ_µν φ_lν = (φ ρ φ^T)_ll (diagonal of materialized grid×grid) ; v_l = sum_PQl' Z_lP V^aux_PQ Z_l'Q n_l' (factorized, stage 2) ; V^H_µν = sum_l φ_lµ v_l φ_lν (diagonal-only row-scale, stage 3) Real input, real output; complex inputs go through compute_hartree_ri_rs_complex. | |
| subroutine, public | hartree_potential_from_diag_ri_rs (bs_env, n_vec, v_h_ao_fm) |
| Hartree stages 2-3 from a precomputed grid density n_l (skips the stage-1 φρφ^T build): v_l = sum_PQl' Z_lP V^aux_PQ Z_l'Q n_l' (factorized Coulomb) ; V^H_µν = sum_l φ_lµ v_l φ_lν (Φ_lν = v_l φ_lν rowscale, then V^H = φ^T Φ). n_l is harvested as diag(φρφ^T) inside compute_sigma_ri_rs (the SEX grid kernel), so the Hartree never rebuilds the grid×grid product. Real in/out. | |
| subroutine, public | compute_hartree_ri_rs_from_diag (bs_env, n_re, v_h_ao_cfm, n_im) |
| Complex Hartree from precomputed grid diagonals: V^H = V^H[n_re] + i V^H[n_im], each via hartree_potential_from_diag_ri_rs (stages 2-3 only). n_re/n_im are the spin-summed grid densities harvested in the SEX kernel; this is the cross-spin / TDA complex consumer that replaces compute_hartree_ri_rs_complex when SEX already built the grid. n_im optional: when absent the result is purely real (matches the Re-only real-input Hartree). | |
| subroutine, public | compute_hartree_ri_rs_complex (bs_env, rho_ao_cfm, v_h_ao_cfm) |
| Complex-input Hartree potential via RI-RS. Re/Im split: feed each part to the real compute_hartree_ri_rs and reassemble. Real-input Hartree on a non-Hermitian input would silently drop Im and break Hermitian conjugacy of OV+VO contributions in TDA. | |
RT-BSE RI-RS kernels: SEX and Hartree evaluated by collocation on grid points r_l. Once-built grid objects: φ_µ(r_l) [grid×AO], Z_lP [grid×RI], V^aux_PQ = [M^-1 V^tr M^-1]_PQ [RI×RI], W^0_ll' = sum_PQ Z_lP (V + W^c(ω=0))_PQ Z_l'Q. Per-call kernels, collocation X = φ_µ(r_l) (AO domain, written φ_lµ below): SEX: ρ^grid_ll' = sum_µν φ_lµ Δρ_µν φ_l'ν ; Σ_µν = pref * sum_ll' φ_lµ [ρ^grid ∘ W^0]_ll' φ_l'ν Hartree: n_l = sum_µν φ_lµ Δρ_µν φ_lν ; v_l = sum_PQl' Z_lP V^aux_PQ Z_l'Q n_l' (applied factorized, stage 2) ; V^H_µν = sum_l φ_lµ v_l φ_lν (diagonal-only, no grid×grid) Independent of which GW variant produced bs_envfm_W_MIC_freq_zero.
| subroutine, public rt_bse_ri_rs::rt_bse_ri_rs_ensure_grid | ( | type(post_scf_bandstructure_type), pointer | bs_env, |
| type(qs_environment_type), pointer | qs_env | ||
| ) |
Make sure the AO collocation φ_µ(r_l) (mat_phi_mu_l) and the RI fit coefficients Z_lP (mat_Z_lP) are populated in memory. If GW was run with RI-RS the grid is already built; otherwise build it here so the AO-RI GW + RI-RS RT-BSE combination is possible.
| bs_env | ... |
| qs_env | ... |
Definition at line 83 of file rt_bse_ri_rs.F.
| subroutine, public rt_bse_ri_rs::rt_bse_ri_rs_ensure_v_grid | ( | type(post_scf_bandstructure_type), pointer | bs_env, |
| type(qs_environment_type), pointer | qs_env | ||
| ) |
Build V^aux_PQ = [M^-1 V^tr M^-1]_PQ (truncated Coulomb in the RI basis, M^-1-sandwiched to match the W^MIC convention). The grid Coulomb V_ll' = sum_PQ Z_lP V^aux_PQ Z_l'Q is never materialized – the Hartree stage applies it factorized: v_l = sum_PQl' Z_lP V^aux_PQ Z_l'Q n_l' Needed by RT-BSE RI-RS Hartree.
| bs_env | ... |
| qs_env | ... |
Definition at line 135 of file rt_bse_ri_rs.F.
| subroutine, public rt_bse_ri_rs::rt_bse_ri_rs_ensure_w0_grid | ( | type(post_scf_bandstructure_type), pointer | bs_env, |
| type(qs_environment_type), pointer | qs_env | ||
| ) |
Build W^0_ll' = sum_PQ Z_lP (V + W^c(ω=0))_PQ Z_l'Q (statically screened W on the grid). Needed by RT-BSE RI-RS SEX/COH. Reuses bs_envfm_W_MIC_freq_zero which must already contain M^-1 W^c(ω=0) M^-1 (built by either GW path under the BSE rtp_method gate). W^0 enters only through the Hadamard ρ^grid ∘ W^0 – its elements are needed, so it is the one persistent grid×grid object of the kernel layer.
| bs_env | ... |
| qs_env | ... |
Definition at line 196 of file rt_bse_ri_rs.F.
| subroutine, public rt_bse_ri_rs::compute_sigma_ri_rs | ( | type(post_scf_bandstructure_type), pointer | bs_env, |
| type(cp_fm_type), intent(inout) | sigma_ao_fm, | ||
| real(kind=dp), intent(in) | prefactor, | ||
| type(cp_fm_type), intent(in) | rho_ao_fm, | ||
| real(kind=dp), dimension(:), intent(inout), optional | grid_diag_accum | ||
| ) |
AO-domain SEX: Σ_µν = pref * sum_ll' φ_lµ [ρ^grid ∘ W^0]_ll' φ_l'ν, ρ^grid_ll' = sum_µν φ_lµ Δρ_µν φ_l'ν. The grid×grid ρ^grid is intrinsic to SEX – the Hadamard needs W^0's elements, so no factorized application exists (unlike the Hartree V_ll'). Real input, real output; used for COH (input S^-1) and the init reference (ρ^0); dynamic Δρ goes through the complex variant. Mirrors the AO-RI get_sigma(rtbse_env, sigma_fm, prefactor, rho_fm) API.
| bs_env | ... |
| sigma_AO_fm | result, AO x AO |
| prefactor | scaling applied to the final result |
| rho_AO_fm | input density-like matrix, AO x AO |
| grid_diag_accum | ... |
Definition at line 284 of file rt_bse_ri_rs.F.
| subroutine, public rt_bse_ri_rs::compute_sigma_ri_rs_complex | ( | type(post_scf_bandstructure_type), pointer | bs_env, |
| type(cp_cfm_type), intent(inout) | sigma_ao_cfm, | ||
| real(kind=dp), intent(in) | prefactor, | ||
| type(cp_cfm_type), intent(in) | rho_ao_cfm, | ||
| real(kind=dp), dimension(:), intent(inout), optional | grid_diag_re_accum, | ||
| real(kind=dp), dimension(:), intent(inout), optional | grid_diag_im_accum | ||
| ) |
Complex-input AO SEX via Re/Im split: the kernel is real, so complex linearity holds as Σ[Δρ] = Σ[Re Δρ] + i Σ[Im Δρ]. Required for non-Hermitian Δρ inputs (TDA OV-only / ABBA OV+VO).
| bs_env | ... |
| sigma_AO_cfm | result, AO x AO (complex) |
| prefactor | scaling applied to the final result |
| rho_AO_cfm | input AO x AO complex matrix |
| grid_diag_re_accum | optional: accumulate diag(φ.Re(ρ).φ^T) (bare; for the Hartree reuse) |
| grid_diag_im_accum | optional: accumulate diag(φ.Im(ρ).φ^T) (bare; for the Hartree reuse) |
Definition at line 374 of file rt_bse_ri_rs.F.
| subroutine, public rt_bse_ri_rs::compute_hartree_ri_rs | ( | type(post_scf_bandstructure_type), pointer | bs_env, |
| type(cp_fm_type), intent(in) | rho_ao_fm, | ||
| type(cp_fm_type), intent(inout) | v_h_ao_fm | ||
| ) |
AO-domain Hartree via RI-RS: n_l = sum_µν φ_lµ Δρ_µν φ_lν = (φ ρ φ^T)_ll (diagonal of materialized grid×grid) ; v_l = sum_PQl' Z_lP V^aux_PQ Z_l'Q n_l' (factorized, stage 2) ; V^H_µν = sum_l φ_lµ v_l φ_lν (diagonal-only row-scale, stage 3) Real input, real output; complex inputs go through compute_hartree_ri_rs_complex.
| bs_env | ... |
| rho_AO_fm | input AO x AO density matrix |
| V_H_AO_fm | output AO x AO Hartree potential |
Definition at line 428 of file rt_bse_ri_rs.F.
| subroutine, public rt_bse_ri_rs::hartree_potential_from_diag_ri_rs | ( | type(post_scf_bandstructure_type), pointer | bs_env, |
| real(kind=dp), dimension(:), intent(in) | n_vec, | ||
| type(cp_fm_type), intent(inout) | v_h_ao_fm | ||
| ) |
Hartree stages 2-3 from a precomputed grid density n_l (skips the stage-1 φρφ^T build): v_l = sum_PQl' Z_lP V^aux_PQ Z_l'Q n_l' (factorized Coulomb) ; V^H_µν = sum_l φ_lµ v_l φ_lν (Φ_lν = v_l φ_lν rowscale, then V^H = φ^T Φ). n_l is harvested as diag(φρφ^T) inside compute_sigma_ri_rs (the SEX grid kernel), so the Hartree never rebuilds the grid×grid product. Real in/out.
| bs_env | ... |
| n_vec | grid density n_l (length n_grid, replicated) |
| V_H_AO_fm | output AO x AO Hartree potential |
Definition at line 496 of file rt_bse_ri_rs.F.
| subroutine, public rt_bse_ri_rs::compute_hartree_ri_rs_from_diag | ( | type(post_scf_bandstructure_type), pointer | bs_env, |
| real(kind=dp), dimension(:), intent(in) | n_re, | ||
| type(cp_cfm_type), intent(inout) | v_h_ao_cfm, | ||
| real(kind=dp), dimension(:), intent(in), optional | n_im | ||
| ) |
Complex Hartree from precomputed grid diagonals: V^H = V^H[n_re] + i V^H[n_im], each via hartree_potential_from_diag_ri_rs (stages 2-3 only). n_re/n_im are the spin-summed grid densities harvested in the SEX kernel; this is the cross-spin / TDA complex consumer that replaces compute_hartree_ri_rs_complex when SEX already built the grid. n_im optional: when absent the result is purely real (matches the Re-only real-input Hartree).
| bs_env | ... |
| n_re | grid density Re part (length n_grid, replicated) |
| V_H_AO_cfm | output AO x AO complex Hartree potential |
| n_im | optional grid density Im part (length n_grid, replicated) |
Definition at line 562 of file rt_bse_ri_rs.F.
| subroutine, public rt_bse_ri_rs::compute_hartree_ri_rs_complex | ( | type(post_scf_bandstructure_type), pointer | bs_env, |
| type(cp_cfm_type), intent(in) | rho_ao_cfm, | ||
| type(cp_cfm_type), intent(inout) | v_h_ao_cfm | ||
| ) |
Complex-input Hartree potential via RI-RS. Re/Im split: feed each part to the real compute_hartree_ri_rs and reassemble. Real-input Hartree on a non-Hermitian input would silently drop Im and break Hermitian conjugacy of OV+VO contributions in TDA.
| bs_env | ... |
| rho_AO_cfm | input AO x AO complex density-like matrix |
| V_H_AO_cfm | output AO x AO complex Hartree potential |
Definition at line 606 of file rt_bse_ri_rs.F.