(git:6344619)
Loading...
Searching...
No Matches
ri_rs_fitting Module Reference

Shared numerical operations for computing the RI-RS matrix Z_lP. More...

Functions/Subroutines

subroutine, public solve_ri_rs_fit (phi_local, d_lp, tikhonov, para_env_sub, blacs_env_sub)
 Computes the regularized RI-RS fit from an AO collocation matrix and a replicated RHS.
subroutine, public evaluate_ri_rs_fit (phi, int_3c, tikhonov, normalized_error, fit_successful, ao_gradient, max_abs_error, workspace_budget_bytes)
 Evaluate the normalized cluster residual and its exact derivative in AO space.
subroutine, public store_z_lp_columns (mat_z_lp, z_local, local_grid_idx, n_local_grid, n_loc_ri, atom_p, r_blk_sizes, row_offset, eps_filter)
 Stores dense Z_lP columns in the distributed block-sparse matrix.

Detailed Description

Shared numerical operations for computing the RI-RS matrix Z_lP.

History
09.2026 created Jan Wilhelm

Function/Subroutine Documentation

◆ solve_ri_rs_fit()

subroutine, public ri_rs_fitting::solve_ri_rs_fit ( real(kind=dp), dimension(:, :), intent(in) phi_local,
real(kind=dp), dimension(:, :), intent(inout) d_lp,
real(kind=dp), intent(in) tikhonov,
type(mp_para_env_type), optional, pointer para_env_sub,
type(cp_blacs_env_type), optional, pointer blacs_env_sub )

Computes the regularized RI-RS fit from an AO collocation matrix and a replicated RHS.

    D_ll' = [Σ_μ ϕ_μ(r_l) ϕ_μ(r_l')]²,
    d_l = 1/sqrt(max(D_ll, jacobi_floor)),
    D'_ll' = d_l D_ll' d_l' + λ δ_ll',
    Σ_l' D'_ll' Z'_l'P = d_l d_lP,
    Z_lP = d_l Z'_lP.

  The RI-RS least-squares construction and balancing are described by Duchemin and
  Blase, arXiv:1902.00066, Sec. II.3. Here jacobi_floor bounds D_ll from below in
  both the LAPACK and ScaLAPACK paths. The regularization λ is added after Jacobi
  scaling; in the unscaled system its diagonal contribution is λ/d_l².
Parameters
phi_localAO values on the fitting grid, replicated within the solve subgroup
d_lpreplicated RHS d_lP on entry and fitted coefficients Z_lP on return
tikhonovregularization parameter λ in the Jacobi-scaled space
para_env_suboptional subgroup communicator for the distributed solve
blacs_env_suboptional BLACS context, supplied together with para_env_sub

Definition at line 63 of file ri_rs_fitting.F.

Here is the caller graph for this function:

◆ evaluate_ri_rs_fit()

subroutine, public ri_rs_fitting::evaluate_ri_rs_fit ( real(kind=dp), dimension(:, :), intent(in) phi,
real(kind=dp), dimension(:, :, :), intent(in) int_3c,
real(kind=dp), intent(in) tikhonov,
real(kind=dp), intent(out) normalized_error,
logical, intent(out) fit_successful,
real(kind=dp), dimension(:, :), intent(out), optional ao_gradient,
real(kind=dp), intent(out), optional max_abs_error,
real(kind=dp), intent(in), optional workspace_budget_bytes )

Evaluate the normalized cluster residual and its exact derivative in AO space.

  V_l = sqrt(d_l) phi_l, S = V V^T, K = S∘S + λI, and K Z' = b, with
  b_lP = V_l^T B_P V_l. B_P is the symmetric matrix defined by the upper AO triangle.
  The objective is ||B - A Z'||²/||B||², A_:l = svec(V_l V_l^T), without a penalty term.
  For λ>0 the derivative includes the response of the regularized coefficients.
  Each RI-column panel reuses V B_P for the RHS and gradient before releasing the panel.
  The balancing convention and RI-RS reference are given in solve_ri_rs_fit.
Parameters
phiunscaled AO values indexed (grid point, AO)
int_3cthree-center integrals indexed (AO, AO, RI); only the upper AO triangle is used
tikhonovregularization in the Jacobi-scaled space
normalized_errornormalized squared residual
fit_successfulfalse if the target is empty or the regularized fit cannot be solved
ao_gradientoptional derivative with respect to the unscaled AO values
max_abs_erroroptional largest absolute unweighted integral error
workspace_budget_bytesoptional total budget for evaluator-owned gradient workspaces; the caller deducts its own arrays first. Reserve all fixed workspaces before sizing the product cache. An absent or nonpositive budget streams one RI column.

Definition at line 192 of file ri_rs_fitting.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ store_z_lp_columns()

subroutine, public ri_rs_fitting::store_z_lp_columns ( type(dbcsr_type), intent(inout) mat_z_lp,
real(kind=dp), dimension(:, :), intent(in) z_local,
integer, dimension(:), intent(in) local_grid_idx,
integer, intent(in) n_local_grid,
integer, intent(in) n_loc_ri,
integer, intent(in) atom_p,
integer, dimension(:), intent(in) r_blk_sizes,
integer, dimension(:), intent(in) row_offset,
real(kind=dp), intent(in) eps_filter )

Stores dense Z_lP columns in the distributed block-sparse matrix.

Parameters
mat_Z_lP...
Z_local...
local_grid_idx...
n_local_grid...
n_loc_ri...
atom_P...
r_blk_sizes...
row_offset...
eps_filter...

Definition at line 454 of file ri_rs_fitting.F.

Here is the call graph for this function:
Here is the caller graph for this function: