![]() |
(git:6344619)
|
DBCSR collocation, layouts and panel contractions for real-space resolution of the identity. More...
Functions/Subroutines | |
| subroutine, public | atomic_basis_at_grid_point (ri_rs, basis_set_ao, matrix_template, para_env, eps_filter, msg_elem_limit, unit_nr, periodic_images) |
| Builds the grid-by-AO collocation matrix with bounded dense evaluation panels. The molecular path uses atom-aligned row blocks and minimum-image AO values. The Gamma path uses uniform row blocks and sums neighbouring periodic images. | |
| subroutine, public | setup_square_topology (matrix_template, dim_type, square_dist, blk_sizes, mapped_dist) |
| Creates a square topology from a selected row or column layout. | |
| subroutine, public | release_dbcsr_topology_and_matrices (dist, mapped_dist, m1, m2, m3, m4) |
| Releases RI-RS topology mappings and temporary DBCSR matrices. | |
| subroutine, public | reserve_blocks_within_radius (matrix, centers, radius) |
| Reserves grid blocks with block-centre distances within a fixed radius. | |
| subroutine, public | print_matrix_occupation (matrix, label, para_env, unit_nr, msg_elem_limit, suffix) |
| Prints the percentage of non-zero elements in a distributed RI-RS matrix. | |
| subroutine, public | mask_grid_blocks_near_panel (centroids, blk0, blk1, cutoff, used) |
| Marks the grid blocks whose centroid lies within cutoff of the bounding box of the panel [blk0, blk1]'s chunk centroids. | |
| subroutine, public | panel_template_elems (r_blk_sizes, centroids, used, blk0, blk1, cutoff, nze_tmpl) |
| Exact allocated-element count of the geo template of panel [blk0, blk1]: the very same per-block-pair centroid test as build_geo_template_panel, so this is the true DBCSR data size of A_pan/B_pan (DBCSR stores whole blocks). | |
| subroutine, public | panel_mem_estimate_gb (nze_tmpl, pan_rows, width, n_grid_total, n_ri, n_ao, n_procs, mem_gb) |
| Per-rank peak memory (GB) of one panel step of the neighborhood-restricted contractions: up to three grid x grid panels (two A operands and the shared B operand) plus the grid x RI intermediates (tmp2 and the accumulation operand) and the grid x AO intermediate (tmpA), whose column support is the panel's geometric neighborhood fraction f_near = width/n_grid. Used by planning and memory reporting. | |
| subroutine, public | contract_grid_panels (l_a, m_a, l_b, m_b, l_out, mat_out, scale, eps, para_env, pan_first, pan_last, lb_eq_la, lout_eq_la, zero_out, centroids, cutoff, grid_occupation) |
| Projects two operators onto grid panels, takes their Hadamard product, and back-projects it: out += scale * L_out^T (A_grid ∘ B_grid) L_out, where A_grid = L_A M_A L_A^T and B_grid = L_B M_B L_B^T. Each L has shape (grid, basis), and its M has shape (basis, basis). The three L matrices must share the ordered grid rows, row blocking and process grid. Only panel x grid slabs are formed; contributions are accumulated over all panels. The sequence of EPS_FILTER screening and floating-point reductions may differ from a full-grid evaluation. | |
| subroutine, public | build_ri_rs_bare_aux_interaction (qs_env, metric_inverse, trunc_coulomb, auto_ri, mat_z_lp, matrix_v_aux) |
| Build the unfiltered auxiliary interaction M^-1 V^tr M^-1 in the Z-column layout. AUTO_RI uses its already transformed Coulomb matrix in the optimized auxiliary basis. Filtering and cache lifetime are owned by the caller. | |
| subroutine, public | resolve_grid_panels (ri_rs, para_env, msg_elem_limit, pan_first, pan_last, cutoff) |
| Resolve and cache grid-panel boundaries for RI-RS streaming contractions. | |
DBCSR collocation, layouts and panel contractions for real-space resolution of the identity.
| subroutine, public ri_rs_matrices::atomic_basis_at_grid_point | ( | type(ri_rs_env), intent(inout) | ri_rs, |
| type(gto_basis_set_p_type), dimension(:), intent(in) | basis_set_ao, | ||
| type(dbcsr_type), intent(in) | matrix_template, | ||
| type(mp_para_env_type), pointer | para_env, | ||
| real(kind=dp), intent(in) | eps_filter, | ||
| integer(kind=int_8), intent(in) | msg_elem_limit, | ||
| integer, intent(in) | unit_nr, | ||
| logical, intent(in) | periodic_images ) |
Builds the grid-by-AO collocation matrix with bounded dense evaluation panels. The molecular path uses atom-aligned row blocks and minimum-image AO values. The Gamma path uses uniform row blocks and sums neighbouring periodic images.
| ri_rs | grid, borrowed geometry references and output collocation matrix |
| basis_set_AO | AO basis sets, one per atomic kind |
| matrix_template | template for the process grid and AO column block sizes |
| para_env | parallel environment |
| eps_filter | block screening threshold |
| msg_elem_limit | maximum number of elements per DBCSR message |
| unit_nr | output unit |
| periodic_images | select neighbouring-image summation for Gamma |
Definition at line 69 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::setup_square_topology | ( | type(dbcsr_type), intent(in) | matrix_template, |
| character(len=*), intent(in) | dim_type, | ||
| type(dbcsr_distribution_type), intent(out) | square_dist, | ||
| integer, dimension(:), intent(out), pointer | blk_sizes, | ||
| integer, dimension(:), intent(out), pointer | mapped_dist ) |
Creates a square topology from a selected row or column layout.
| matrix_template | source matrix |
| dim_type | ROW or COL |
| square_dist | output distribution |
| blk_sizes | borrowed block sizes |
| mapped_dist | owned mapping in the other process-grid direction |
Definition at line 212 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::release_dbcsr_topology_and_matrices | ( | type(dbcsr_distribution_type), intent(inout), optional | dist, |
| integer, dimension(:), intent(inout), optional, pointer | mapped_dist, | ||
| type(dbcsr_type), intent(inout), optional | m1, | ||
| type(dbcsr_type), intent(inout), optional | m2, | ||
| type(dbcsr_type), intent(inout), optional | m3, | ||
| type(dbcsr_type), intent(inout), optional | m4 ) |
Releases RI-RS topology mappings and temporary DBCSR matrices.
| dist | distribution to release |
| mapped_dist | owned mapping to deallocate |
| m1 | optional matrix |
| m2 | optional matrix |
| m3 | optional matrix |
| m4 | optional matrix |
Definition at line 268 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::reserve_blocks_within_radius | ( | type(dbcsr_type), intent(inout) | matrix, |
| real(kind=dp), dimension(:, :), intent(in) | centers, | ||
| real(kind=dp), intent(in) | radius ) |
Reserves grid blocks with block-centre distances within a fixed radius.
| matrix | target matrix |
| centers | block-centre coordinates |
| radius | truncation radius |
Definition at line 304 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::print_matrix_occupation | ( | type(dbcsr_type), intent(in) | matrix, |
| character(len=*), intent(in) | label, | ||
| type(mp_para_env_type), intent(in) | para_env, | ||
| integer, intent(in) | unit_nr, | ||
| integer(kind=int_8), intent(in) | msg_elem_limit, | ||
| character(len=*), intent(in), optional | suffix ) |
Prints the percentage of non-zero elements in a distributed RI-RS matrix.
| matrix | Distributed matrix whose occupation is reported |
| label | Mathematical matrix label used in the output |
| para_env | communicator shared by all matrix ranks |
| unit_nr | output unit; nonpositive values suppress printing |
| msg_elem_limit | maximum number of elements per DBCSR message |
| suffix | Optional text appended to the matrix label |
Definition at line 357 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::mask_grid_blocks_near_panel | ( | real(kind=dp), dimension(:, :), intent(in) | centroids, |
| integer, intent(in) | blk0, | ||
| integer, intent(in) | blk1, | ||
| real(kind=dp), intent(in) | cutoff, | ||
| logical, dimension(:), intent(out), allocatable | used ) |
Marks the grid blocks whose centroid lies within cutoff of the bounding box of the panel [blk0, blk1]'s chunk centroids.
| centroids | ... |
| blk0 | ... |
| blk1 | ... |
| cutoff | ... |
| used | ... |
Definition at line 415 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::panel_template_elems | ( | integer, dimension(:), intent(in) | r_blk_sizes, |
| real(kind=dp), dimension(:, :), intent(in) | centroids, | ||
| logical, dimension(:), intent(in) | used, | ||
| integer, intent(in) | blk0, | ||
| integer, intent(in) | blk1, | ||
| real(kind=dp), intent(in) | cutoff, | ||
| integer(kind=int_8), intent(out) | nze_tmpl ) |
Exact allocated-element count of the geo template of panel [blk0, blk1]: the very same per-block-pair centroid test as build_geo_template_panel, so this is the true DBCSR data size of A_pan/B_pan (DBCSR stores whole blocks).
| r_blk_sizes | ... |
| centroids | ... |
| used | ... |
| blk0 | ... |
| blk1 | ... |
| cutoff | ... |
| nze_tmpl | ... |
Definition at line 460 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::panel_mem_estimate_gb | ( | integer(kind=int_8), intent(in) | nze_tmpl, |
| integer, intent(in) | pan_rows, | ||
| integer, intent(in) | width, | ||
| integer, intent(in) | n_grid_total, | ||
| integer, intent(in) | n_ri, | ||
| integer, intent(in) | n_ao, | ||
| integer, intent(in) | n_procs, | ||
| real(kind=dp), intent(out) | mem_gb ) |
Per-rank peak memory (GB) of one panel step of the neighborhood-restricted contractions: up to three grid x grid panels (two A operands and the shared B operand) plus the grid x RI intermediates (tmp2 and the accumulation operand) and the grid x AO intermediate (tmpA), whose column support is the panel's geometric neighborhood fraction f_near = width/n_grid. Used by planning and memory reporting.
| nze_tmpl | ... |
| pan_rows | ... |
| width | ... |
| n_grid_total | ... |
| n_RI | ... |
| n_ao | ... |
| n_procs | ... |
| mem_GB | ... |
Definition at line 520 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::contract_grid_panels | ( | type(dbcsr_type), intent(inout), target | l_a, |
| type(dbcsr_type), dimension(:), intent(inout) | m_a, | ||
| type(dbcsr_type), intent(inout), target | l_b, | ||
| type(dbcsr_type), intent(inout) | m_b, | ||
| type(dbcsr_type), intent(inout), target | l_out, | ||
| type(dbcsr_p_type), dimension(:), intent(in) | mat_out, | ||
| real(kind=dp), intent(in) | scale, | ||
| real(kind=dp), intent(in) | eps, | ||
| type(mp_para_env_type), intent(in), pointer | para_env, | ||
| integer, dimension(:), intent(in) | pan_first, | ||
| integer, dimension(:), intent(in) | pan_last, | ||
| logical, intent(in) | lb_eq_la, | ||
| logical, intent(in) | lout_eq_la, | ||
| logical, intent(in) | zero_out, | ||
| real(kind=dp), dimension(:, :), intent(in), optional | centroids, | ||
| real(kind=dp), intent(in), optional | cutoff, | ||
| real(kind=dp), intent(out), optional | grid_occupation ) |
Projects two operators onto grid panels, takes their Hadamard product, and back-projects it: out += scale * L_out^T (A_grid ∘ B_grid) L_out, where A_grid = L_A M_A L_A^T and B_grid = L_B M_B L_B^T. Each L has shape (grid, basis), and its M has shape (basis, basis). The three L matrices must share the ordered grid rows, row blocking and process grid. Only panel x grid slabs are formed; contributions are accumulated over all panels. The sequence of EPS_FILTER screening and floating-point reductions may differ from a full-grid evaluation.
The physical contractions and their signs/spin factors are specified in gw_ri_rs_kernels: χ: L_A=L_B=ϕ, M_A=G_occ, M_B=G_vir, L_out=Z -> RI x RI Σx: L_A=ϕ, M_A=D, L_B=Z, M_B=M^-1 V^tr M^-1, L_out=ϕ -> AO x AO Σc: L_A=ϕ, M_A=[G_occ,G_vir], L_B=Z, M_B=W, L_out=ϕ -> two AO x AO outputs. The second Σc output reuses the same W grid panel; its projection and back-projection otherwise follow the same operations as the first output.
| L_A | grid-by-basis collocation or fitting matrix for the first operand |
| M_A | one or two square operators, with row/column blocking matching the columns of L_A |
| L_B | grid-by-basis collocation or fitting matrix for the second operand |
| M_B | second square operator, with row/column blocking matching the columns of L_B |
| L_out | grid-by-output-basis matrix for back-projection |
| mat_out | borrowed pointers to pre-created outputs, one per M_A, with the column blocking of L_out |
| scale | prefactor of the Hadamard product, including the caller's sign/spin convention |
| eps | DBCSR multiplication screening threshold |
| para_env | communicator containing all matrix ranks |
| pan_first | first global grid row-block of each ordered, nonoverlapping panel |
| pan_last | last global grid row-block of each panel; panels together cover the grid |
| lb_eq_la | L_B equals L_A in values and layout, allowing their grid/AO slices to be shared |
| lout_eq_la | L_out equals L_A in values and layout, allowing back-projection slices to be shared |
| zero_out | clear the output matrices before accumulating, otherwise add to their existing values |
| centroids | optional global grid-block centres, paired with a positive cutoff for truncation |
| cutoff | retain grid-block pairs within this centroid distance; nonpositive disables truncation |
| grid_occupation | allocated-element fraction of the first grid operand before the Hadamard product |
Definition at line 1006 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::build_ri_rs_bare_aux_interaction | ( | type(qs_environment_type), pointer | qs_env, |
| type(cp_fm_type), intent(in) | metric_inverse, | ||
| type(libint_potential_type), intent(in) | trunc_coulomb, | ||
| type(auto_ri_type), intent(in) | auto_ri, | ||
| type(dbcsr_type), intent(in) | mat_z_lp, | ||
| type(dbcsr_type), intent(out) | matrix_v_aux ) |
Build the unfiltered auxiliary interaction M^-1 V^tr M^-1 in the Z-column layout. AUTO_RI uses its already transformed Coulomb matrix in the optimized auxiliary basis. Filtering and cache lifetime are owned by the caller.
| qs_env | electronic-structure environment for ordinary RI integrals |
| metric_inverse | inverse auxiliary metric |
| trunc_coulomb | Coulomb operator for ordinary RI integrals |
| auto_ri | optimized auxiliary basis and its Coulomb matrix |
| mat_Z_lP | template defining the auxiliary blocking and process grid |
| matrix_V_aux | output bare interaction in the auxiliary basis |
Definition at line 1206 of file ri_rs_matrices.F.
| subroutine, public ri_rs_matrices::resolve_grid_panels | ( | type(ri_rs_env), intent(inout) | ri_rs, |
| type(mp_para_env_type), pointer | para_env, | ||
| integer(kind=int_8), intent(in) | msg_elem_limit, | ||
| integer, dimension(:), intent(out), allocatable | pan_first, | ||
| integer, dimension(:), intent(out), allocatable | pan_last, | ||
| real(kind=dp), intent(in) | cutoff ) |
Resolve and cache grid-panel boundaries for RI-RS streaming contractions.
| ri_rs | collocation and fitting matrices, grid geometry and owned panel cache |
| para_env | parallel environment |
| msg_elem_limit | maximum number of elements per DBCSR message |
| pan_first | ... |
| pan_last | ... |
| cutoff | grid-centroid distance cutoff; zero disables geometric truncation |
Definition at line 1250 of file ri_rs_matrices.F.