Matrix-free application of the BSE matrices A and B to trial vectors from RI slabs that are sliced along the RI index over all MPI ranks.
More...
|
| subroutine, public | bse_matvec_create (mv_env, fm_s_ia, fm_s_bar_ij, fm_s_ab, fm_s_bar_ia, eps_reduced, homo, virt, alpha, w_fac, do_abba, unit_nr, block_cols) |
| | Moves the RI slabs onto an npe x 1 process grid, such that every rank owns whole RI slices, and stores them as local 3-index arrays: the contraction over each P in bse_matvec_apply is then a local DGEMM and only the final sum over P crosses the ranks.
|
| subroutine, public | bse_matvec_release (mv_env) |
| | Frees the sliced slabs, the transition energies and the process grid of mv_env.
|
| subroutine, public | bse_matvec_vector_struct (mv_env, ncol_global, fm_struct) |
| | Matrix structure of a block of trial vectors: rows ia distributed, all columns local.
|
| subroutine, public | bse_matvec_apply (mv_env, fm_z, first_col, ncol, fm_az, fm_bz, first_col_bz) |
| | Applies A (and B) to ncol trial vectors without forming an N_ov x N_ov object, (A Z)_ia = (ε_a-ε_i) Z_ia + α sum_P B^P_ia sum_jb B^P_jb Z_jb - w sum_Pjb \bar{B}^P_ij B^P_ab Z_jb (B Z)_ia = α sum_P B^P_ia sum_jb B^P_jb Z_jb - w sum_Pjb \bar{B}^P_ib B^P_ja Z_jb α: exchange prefactor (2 singlet, 0 triplet), w: prefactor of the screened term, \bar{B}: slab bound by the caller of bse_matvec_create (B itself for TDHF and ALPHA screening, sum_Q [1+Q(0)]^-1_PQ B^Q otherwise); the sums over P run over the local RI slices and are completed by a sum over the ranks.
|
| subroutine, public | bse_matvec_diagonal (mv_env, precond_kind, diag) |
| | Diagonal used by the Davidson correction, either ε_a-ε_i or the full diagonal A_ia,ia = ε_a-ε_i + α sum_P (B^P_ia)^2 - w sum_P \bar{B}^P_ii B^P_aa with α, w and \bar{B} as in bse_matvec_apply.
|
| subroutine, public | bse_matvec_subblock (mv_env, ia_list, a_sub, b_sub) |
| | Exact A (and B) on a list of transitions, replicated on every rank, A_kl = δ_kl (ε_a-ε_i) + α sum_P B^P_ia B^P_jb - w sum_P \bar{B}^P_ij B^P_ab B_kl = α sum_P B^P_ia B^P_jb - w sum_P \bar{B}^P_ib B^P_ja with k = (i,a), l = (j,b) and α, w, \bar{B} as in bse_matvec_apply.
|
| subroutine, public | bse_matvec_selfcheck (mv_env, fm_a_explicit, unit_nr, fm_b_explicit) |
| | Debug check of the matrix-free application against the explicit matrices A (and B), dev = max_ia,k |(A Z)_ia,k - sum_jb A_ia,jb Z_jb,k| over up to eight unit vectors Z_ia,k = δ_ia,k and one dense vector Z_ia = sin(ia), the same for B, and max_ia |d_ia - A_ia,ia| for the diagonal.
|
Matrix-free application of the BSE matrices A and B to trial vectors from RI slabs that are sliced along the RI index over all MPI ranks.
- History
- 09.2026 created [Maximilian Graml]
| subroutine, public bse_matvec::bse_matvec_apply |
( |
type(bse_matvec_env_type), intent(in), target | mv_env, |
|
|
type(cp_fm_type), intent(in) | fm_z, |
|
|
integer, intent(in) | first_col, |
|
|
integer, intent(in) | ncol, |
|
|
type(cp_fm_type), intent(in) | fm_az, |
|
|
type(cp_fm_type), intent(in), optional | fm_bz, |
|
|
integer, intent(in), optional | first_col_bz ) |
Applies A (and B) to ncol trial vectors without forming an N_ov x N_ov object, (A Z)_ia = (ε_a-ε_i) Z_ia + α sum_P B^P_ia sum_jb B^P_jb Z_jb - w sum_Pjb \bar{B}^P_ij B^P_ab Z_jb (B Z)_ia = α sum_P B^P_ia sum_jb B^P_jb Z_jb - w sum_Pjb \bar{B}^P_ib B^P_ja Z_jb α: exchange prefactor (2 singlet, 0 triplet), w: prefactor of the screened term, \bar{B}: slab bound by the caller of bse_matvec_create (B itself for TDHF and ALPHA screening, sum_Q [1+Q(0)]^-1_PQ B^Q otherwise); the sums over P run over the local RI slices and are completed by a sum over the ranks.
- Parameters
-
| mv_env | slabs, prefactors and transition energies |
| fm_Z | trial vectors, columns first_col .. first_col+ncol-1 are read |
| first_col | first trial vector read, and first column written |
| ncol | number of trial vectors |
| fm_AZ | receives A Z in the same columns |
| fm_BZ | receives B Z in the same columns, or from first_col_BZ on |
| first_col_BZ | first column of fm_BZ written, first_col by default |
Definition at line 318 of file bse_matvec.F.
| subroutine, public bse_matvec::bse_matvec_subblock |
( |
type(bse_matvec_env_type), intent(in) | mv_env, |
|
|
integer, dimension(:), intent(in) | ia_list, |
|
|
real(kind=dp), dimension(:, :), intent(out) | a_sub, |
|
|
real(kind=dp), dimension(:, :), intent(out), optional | b_sub ) |
Exact A (and B) on a list of transitions, replicated on every rank, A_kl = δ_kl (ε_a-ε_i) + α sum_P B^P_ia B^P_jb - w sum_P \bar{B}^P_ij B^P_ab B_kl = α sum_P B^P_ia B^P_jb - w sum_P \bar{B}^P_ib B^P_ja with k = (i,a), l = (j,b) and α, w, \bar{B} as in bse_matvec_apply.
- Parameters
-
| mv_env | slabs, prefactors and transition energies |
| ia_list | global transition indices ia = (i-1)*virt + a of the block |
| A_sub | SIZE(ia_list) x SIZE(ia_list) |
| B_sub | same, only formed when present |
Definition at line 523 of file bse_matvec.F.
| subroutine, public bse_matvec::bse_matvec_selfcheck |
( |
type(bse_matvec_env_type), intent(in) | mv_env, |
|
|
type(cp_fm_type), intent(in) | fm_a_explicit, |
|
|
integer, intent(in) | unit_nr, |
|
|
type(cp_fm_type), intent(in), optional | fm_b_explicit ) |
Debug check of the matrix-free application against the explicit matrices A (and B), dev = max_ia,k |(A Z)_ia,k - sum_jb A_ia,jb Z_jb,k| over up to eight unit vectors Z_ia,k = δ_ia,k and one dense vector Z_ia = sin(ia), the same for B, and max_ia |d_ia - A_ia,ia| for the diagonal.
- Parameters
-
| mv_env | the environment under test |
| fm_A_explicit | A from create_A_and_B, N_ov x N_ov on the grid of the caller |
| unit_nr | output unit, positive on the writing rank only |
| fm_B_explicit | B, present for an ABBA run |
Definition at line 598 of file bse_matvec.F.