![]() |
(git:6344619)
|
Auxiliary routines for GW + Bethe-Salpeter for computing electronic excitations. More...
Functions/Subroutines | |
| pure integer function, public | ia_of_occ_virt (i_occ, a_virt, virt) |
| Compound transition index ia = (i-1)*virt + a of the pair (i, a): a is the fast index. | |
| pure integer function, public | occ_of_ia (ia, virt) |
| Occupied level of the compound transition index ia = (i-1)*virt + a. | |
| pure integer function, public | virt_of_ia (ia, virt) |
| Virtual level of the compound transition index ia = (i-1)*virt + a. | |
| subroutine, public | screen_slabs (fm_eps_inv, fm_s_ij, fm_s_ia, dimen_ri_red, homo, virtual, fm_s_bar_ij, fm_s_bar_ia, do_abba) |
| The screened slabs \bar{B}^P_ij = sum_Q [1+Q(0)]^-1_PQ B^Q_ij and \bar{B}^P_ia = sum_Q [1+Q(0)]^-1_PQ B^Q_ia, P, Q ≤ dimen_RI_red. | |
| subroutine, public | comp_eigvec_coeff_bse (fm_work, eig_vals, beta, gamma, do_transpose) |
| Routine for computing the coefficients of the eigenvectors of the BSE matrix from a multiplication with the eigenvalues. | |
| subroutine, public | sort_excitations (idx_prim, idx_sec, eigvec_entries, idx_spin) |
| Sorts excitation entries by ascending primary index, reordering the secondary index, the eigenvector coefficients and - open shell - the spin index alongside. | |
| subroutine, public | estimate_bse_resources (n_ov_joint, unit_nr, bse_abba, para_env, diag_runtime_est) |
| Roughly estimates the needed runtime and memory during the BSE run. | |
| pure real(kind=dp) function, public | fulldiag_memory_estimate_gb (n_ov_joint, do_abba) |
| Peak memory of the full diagonalization in GB, all ranks together: n_ov^2 doubles times the matrices held at once, 2 for TDA (A and W_ijab), 10 for ABBA (B, C and the six that build C added). | |
| subroutine, public | filter_eigvec_contrib (fm_eigvec, idx_homo, idx_virt, eigvec_entries, i_exc, virtual, num_entries, bse_env, offsets, virtual_per_spin, idx_spin) |
| Filters eigenvector entries above a given threshold to describe excitations in the singleparticle basis. | |
| subroutine, public | get_bse_spin_block_layout (homo_red, virt_red, n_ov, offsets, n_ov_joint) |
| Spin-block layout for the open-shell (joint) BSE matrix: per-spin OV-pair counts and the block offsets into the joint matrix of dimension n_ov_joint = sum_sigma homo*virtual. | |
| subroutine, public | bse_window_from_dft (eigenval_scf, n_mo, homo, cutoff_occ, cutoff_empty, window, warn) |
| The active MO window on the DFT axis: one absolute MO range for every spin; when the spin windows differ, the smallest range covering all of them. | |
| subroutine, public | bse_window_from_mos (mos, cutoff_occ, cutoff_empty, window, warn) |
| The active MO window of bse_window_from_dft, from the DFT eigenvalues of the MO sets. | |
| subroutine, public | truncate_bse_matrices (fm_s_ia_full, fm_s_ij_full, fm_s_ab_full, eigenval_scf, eigenval, eigenval_reduced_scf, eigenval_reduced_qp, homo, virtual, dimen_ri, unit_nr, ispin, bse_env, window, print_window) |
| Determines indices within the given energy cutoffs and truncates Eigenvalues and matrices. | |
| subroutine, public | reshuffle_eigvec (fm_eigvec, fm_eigvec_reshuffled, homo, virtual, n_exc, do_transpose) |
| ... | |
| subroutine, public | print_bse_nto_cubes (bse_env, mos, istate, info_approximation, stride, append_cube, print_section) |
| Borrowed from the tddfpt module with slight adaptions. | |
| subroutine, public | adapt_bse_input_params (homo, virtual, unit_nr, bse_env) |
| Checks BSE input section and adapts them if necessary. | |
| subroutine, public | adapt_bse_screening (bse_env, unit_nr) |
| Resolve SCREENING_IN_W and its factor before constructing the dielectric matrix or slabs. | |
| subroutine, public | get_multipoles_mo (fm_multipole_ai_trunc, fm_multipole_ij_trunc, fm_multipole_ab_trunc, matrix_multipole, mos, mo_coeff, homo_red, virtual_red, context_bse, ispin) |
| The multipoles in the MO window, D^k_pq = sum_µν C_µp M^k_µν C_νq, cut to the ai, ij and ab blocks of the window; M^k_µν are the AO multipoles of get_multipoles_ao. | |
| subroutine, public | trace_exciton_descr (fm_a, fm_b, fm_c, alpha) |
| Computes trace of form Tr{A^T B C} for exciton descriptors. | |
| subroutine, public | assemble_joint_ov_slab (fm_s_ia, offsets, n_ov, dimen_ri, fm_s_joint) |
| Column-concatenate per-spin ia-slabs into the joint dimen_RI x n_ov_joint slab. Sigma-block of spin isp occupies columns offsets(isp)+1 .. offsets(isp)+n_ov(isp). fm_S_joint must be pre-created and zeroed by the caller. | |
Auxiliary routines for GW + Bethe-Salpeter for computing electronic excitations.
| pure integer function, public bse_util::ia_of_occ_virt | ( | integer, intent(in) | i_occ, |
| integer, intent(in) | a_virt, | ||
| integer, intent(in) | virt ) |
Compound transition index ia = (i-1)*virt + a of the pair (i, a): a is the fast index.
| i_occ | occupied level |
| a_virt | virtual level |
| virt | number of virtual levels |
Definition at line 94 of file bse_util.F.
| pure integer function, public bse_util::occ_of_ia | ( | integer, intent(in) | ia, |
| integer, intent(in) | virt ) |
Occupied level of the compound transition index ia = (i-1)*virt + a.
| ia | compound transition index |
| virt | number of virtual levels |
Definition at line 109 of file bse_util.F.
| pure integer function, public bse_util::virt_of_ia | ( | integer, intent(in) | ia, |
| integer, intent(in) | virt ) |
Virtual level of the compound transition index ia = (i-1)*virt + a.
| ia | compound transition index |
| virt | number of virtual levels |
Definition at line 124 of file bse_util.F.
| subroutine, public bse_util::screen_slabs | ( | type(cp_fm_type), intent(in) | fm_eps_inv, |
| type(cp_fm_type), intent(in) | fm_s_ij, | ||
| type(cp_fm_type), intent(in) | fm_s_ia, | ||
| integer, intent(in) | dimen_ri_red, | ||
| integer, intent(in) | homo, | ||
| integer, intent(in) | virtual, | ||
| type(cp_fm_type), intent(out) | fm_s_bar_ij, | ||
| type(cp_fm_type), intent(out) | fm_s_bar_ia, | ||
| logical, intent(in) | do_abba ) |
The screened slabs \bar{B}^P_ij = sum_Q [1+Q(0)]^-1_PQ B^Q_ij and \bar{B}^P_ia = sum_Q [1+Q(0)]^-1_PQ B^Q_ia, P, Q ≤ dimen_RI_red.
| fm_eps_inv | [1+Q(0)]^-1_PQ |
| fm_S_ij | B^P_ij of the window, dimen_RI x homo^2 |
| fm_S_ia | B^P_ia of the window, dimen_RI x homo*virtual |
| dimen_RI_red | reduced RI dimension, the contraction length |
| homo | occupied levels in the window |
| virtual | virtual levels in the window |
| fm_S_bar_ij | \bar{B}^P_ij, created here on fm_S_ij's structure |
| fm_S_bar_ia | \bar{B}^P_ia, created here on fm_S_ia's structure for ABBA only |
| do_abba | whether the coupling matrix B needs the screened ia slab |
Definition at line 146 of file bse_util.F.
| subroutine, public bse_util::comp_eigvec_coeff_bse | ( | type(cp_fm_type), intent(inout) | fm_work, |
| real(kind=dp), dimension(:), intent(in), allocatable | eig_vals, | ||
| real(kind=dp), intent(in) | beta, | ||
| real(kind=dp), intent(in), optional | gamma, | ||
| logical, intent(in), optional | do_transpose ) |
Routine for computing the coefficients of the eigenvectors of the BSE matrix from a multiplication with the eigenvalues.
| fm_work | ... |
| eig_vals | ... |
| beta | ... |
| gamma | ... |
| do_transpose | ... |
Definition at line 189 of file bse_util.F.
| subroutine, public bse_util::sort_excitations | ( | integer, dimension(:), allocatable | idx_prim, |
| integer, dimension(:), allocatable | idx_sec, | ||
| real(kind=dp), dimension(:), allocatable | eigvec_entries, | ||
| integer, dimension(:), optional, allocatable | idx_spin ) |
Sorts excitation entries by ascending primary index, reordering the secondary index, the eigenvector coefficients and - open shell - the spin index alongside.
| idx_prim | Primary index of each entry; sorted in place and used as the sort key |
| idx_sec | Secondary index of each entry, reordered to follow idx_prim |
| eigvec_entries | Eigenvector coefficients of each entry, reordered to follow idx_prim |
| idx_spin | Optional spin index of each entry (open shell), reordered to follow idx_prim |
Definition at line 256 of file bse_util.F.
| subroutine, public bse_util::estimate_bse_resources | ( | integer, intent(in) | n_ov_joint, |
| integer, intent(in) | unit_nr, | ||
| logical | bse_abba, | ||
| type(mp_para_env_type), pointer | para_env, | ||
| real(kind=dp) | diag_runtime_est ) |
Roughly estimates the needed runtime and memory during the BSE run.
| n_ov_joint | ... |
| unit_nr | ... |
| bse_abba | ... |
| para_env | ... |
| diag_runtime_est | ... |
Definition at line 352 of file bse_util.F.
| pure real(kind=dp) function, public bse_util::fulldiag_memory_estimate_gb | ( | integer, intent(in) | n_ov_joint, |
| logical, intent(in) | do_abba ) |
Peak memory of the full diagonalization in GB, all ranks together: n_ov^2 doubles times the matrices held at once, 2 for TDA (A and W_ijab), 10 for ABBA (B, C and the six that build C added).
| n_ov_joint | transition pairs in the active window, summed over spins |
| do_abba | full problem, not TDA |
Definition at line 396 of file bse_util.F.
| subroutine, public bse_util::filter_eigvec_contrib | ( | type(cp_fm_type), intent(in) | fm_eigvec, |
| integer, dimension(:), allocatable | idx_homo, | ||
| integer, dimension(:), allocatable | idx_virt, | ||
| real(kind=dp), dimension(:), allocatable | eigvec_entries, | ||
| integer | i_exc, | ||
| integer | virtual, | ||
| integer | num_entries, | ||
| type(bse_env_type), intent(in) | bse_env, | ||
| integer, dimension(:), intent(in), optional | offsets, | ||
| integer, dimension(:), intent(in), optional | virtual_per_spin, | ||
| integer, dimension(:), optional, allocatable | idx_spin ) |
Filters eigenvector entries above a given threshold to describe excitations in the singleparticle basis.
| fm_eigvec | ... |
| idx_homo | ... |
| idx_virt | ... |
| eigvec_entries | ... |
| i_exc | ... |
| virtual | ... |
| num_entries | ... |
| bse_env | the BSE environment (settings) |
| offsets | ... |
| virtual_per_spin | ... |
| idx_spin | ... |
Definition at line 428 of file bse_util.F.
| subroutine, public bse_util::get_bse_spin_block_layout | ( | integer, dimension(:), intent(in) | homo_red, |
| integer, dimension(:), intent(in) | virt_red, | ||
| integer, dimension(:), intent(out) | n_ov, | ||
| integer, dimension(:), intent(out) | offsets, | ||
| integer, intent(out) | n_ov_joint ) |
Spin-block layout for the open-shell (joint) BSE matrix: per-spin OV-pair counts and the block offsets into the joint matrix of dimension n_ov_joint = sum_sigma homo*virtual.
| homo_red | per-spin (reduced) number of occupied levels |
| virt_red | per-spin (reduced) number of virtual levels |
| n_ov | per-spin OV-pair count (OUT) |
| offsets | per-spin block offset into the joint matrix (OUT) |
| n_ov_joint | total joint dimension (OUT) |
Definition at line 548 of file bse_util.F.
| subroutine, public bse_util::bse_window_from_dft | ( | real(kind=dp), dimension(:, :), intent(in) | eigenval_scf, |
| integer, dimension(:), intent(in) | n_mo, | ||
| integer, dimension(:), intent(in) | homo, | ||
| real(kind=dp), intent(in) | cutoff_occ, | ||
| real(kind=dp), intent(in) | cutoff_empty, | ||
| type(mo_window_type), intent(out) | window, | ||
| logical, intent(in) | warn ) |
The active MO window on the DFT axis: one absolute MO range for every spin; when the spin windows differ, the smallest range covering all of them.
| eigenval_scf | DFT eigenvalues (level, spin) |
| n_mo | number of MOs per spin |
| homo | occupied MOs per spin |
| cutoff_occ | ENERGY_CUTOFF_OCC in Hartree, zero or negative for no cutoff |
| cutoff_empty | ENERGY_CUTOFF_EMPTY in Hartree, zero or negative for no cutoff |
| window | first and last MO to keep |
| warn | warn when the spin windows differ; false for a second call in the same run |
Definition at line 575 of file bse_util.F.
| subroutine, public bse_util::bse_window_from_mos | ( | type(mo_set_type), dimension(:), intent(in) | mos, |
| real(kind=dp), intent(in) | cutoff_occ, | ||
| real(kind=dp), intent(in) | cutoff_empty, | ||
| type(mo_window_type), intent(out) | window, | ||
| logical, intent(in) | warn ) |
The active MO window of bse_window_from_dft, from the DFT eigenvalues of the MO sets.
| mos | MO sets per spin |
| cutoff_occ | ENERGY_CUTOFF_OCC in Hartree, zero or negative for no cutoff |
| cutoff_empty | ENERGY_CUTOFF_EMPTY in Hartree, zero or negative for no cutoff |
| window | first and last MO to keep, one absolute range for every spin |
| warn | warn when the spin windows differ |
Definition at line 613 of file bse_util.F.
| subroutine, public bse_util::truncate_bse_matrices | ( | type(cp_fm_type), intent(in) | fm_s_ia_full, |
| type(cp_fm_type), intent(in) | fm_s_ij_full, | ||
| type(cp_fm_type), intent(in) | fm_s_ab_full, | ||
| real(kind=dp), dimension(:) | eigenval_scf, | ||
| real(kind=dp), dimension(:) | eigenval, | ||
| real(kind=dp), dimension(:), allocatable | eigenval_reduced_scf, | ||
| real(kind=dp), dimension(:), allocatable | eigenval_reduced_qp, | ||
| integer, intent(in) | homo, | ||
| integer, intent(in) | virtual, | ||
| integer, intent(in) | dimen_ri, | ||
| integer, intent(in) | unit_nr, | ||
| integer, intent(in) | ispin, | ||
| type(bse_env_type), intent(inout) | bse_env, | ||
| type(mo_window_type), intent(in) | window, | ||
| logical, intent(in) | print_window ) |
Determines indices within the given energy cutoffs and truncates Eigenvalues and matrices.
| fm_S_ia_full | ... |
| fm_S_ij_full | ... |
| fm_S_ab_full | ... |
| Eigenval_scf | ... |
| Eigenval | ... |
| Eigenval_reduced_scf | DFT energies of the window, allocated here |
| Eigenval_reduced_qp | quasiparticle energies of the window, allocated here |
| homo | ... |
| virtual | ... |
| dimen_RI | ... |
| unit_nr | ... |
| ispin | spin of the slabs, selects the GW-corrected virtual count |
| bse_env | the BSE environment (settings; the GW-corrected level counts); receives the window's slabs fm_S_ia, fm_S_ij, fm_S_ab and its level counts homo_red, virt_red of spin ispin |
| window | Absolute MO window to retain. |
| print_window | Whether to print the cutoff summary. |
Definition at line 656 of file bse_util.F.
| subroutine, public bse_util::reshuffle_eigvec | ( | type(cp_fm_type), intent(in) | fm_eigvec, |
| type(cp_fm_type), intent(inout) | fm_eigvec_reshuffled, | ||
| integer, intent(in) | homo, | ||
| integer, intent(in) | virtual, | ||
| integer, intent(in) | n_exc, | ||
| logical, intent(in) | do_transpose ) |
...
| fm_eigvec | ... |
| fm_eigvec_reshuffled | ... |
| homo | ... |
| virtual | ... |
| n_exc | ... |
| do_transpose | ... |
Definition at line 794 of file bse_util.F.
| subroutine, public bse_util::print_bse_nto_cubes | ( | type(bse_env_type), intent(in) | bse_env, |
| type(mo_set_type), dimension(:), intent(in) | mos, | ||
| integer, intent(in) | istate, | ||
| character(len=10) | info_approximation, | ||
| integer, dimension(:), pointer | stride, | ||
| logical, intent(in) | append_cube, | ||
| type(section_vals_type), pointer | print_section ) |
Borrowed from the tddfpt module with slight adaptions.
| bse_env | the BSE environment (the QS objects the cube writer reads) |
| mos | ... |
| istate | ... |
| info_approximation | ... |
| stride | ... |
| append_cube | ... |
| print_section | ... |
Definition at line 862 of file bse_util.F.
| subroutine, public bse_util::adapt_bse_input_params | ( | integer, intent(in) | homo, |
| integer, intent(in) | virtual, | ||
| integer, intent(in) | unit_nr, | ||
| type(bse_env_type), intent(inout) | bse_env ) |
Checks BSE input section and adapts them if necessary.
| homo | ... |
| virtual | ... |
| unit_nr | ... |
| bse_env | the BSE environment; the settings are normalised in place |
Definition at line 959 of file bse_util.F.
| subroutine, public bse_util::adapt_bse_screening | ( | type(bse_env_type), intent(inout) | bse_env, |
| integer, intent(in) | unit_nr ) |
Resolve SCREENING_IN_W and its factor before constructing the dielectric matrix or slabs.
| bse_env | screening method and factor, normalised in place |
| unit_nr | output unit, positive on the writing rank only |
Definition at line 1120 of file bse_util.F.
| subroutine, public bse_util::get_multipoles_mo | ( | type(cp_fm_type), dimension(:), intent(inout), allocatable | fm_multipole_ai_trunc, |
| type(cp_fm_type), dimension(:), intent(inout), allocatable | fm_multipole_ij_trunc, | ||
| type(cp_fm_type), dimension(:), intent(inout), allocatable | fm_multipole_ab_trunc, | ||
| type(dbcsr_p_type), dimension(:), intent(in) | matrix_multipole, | ||
| type(mo_set_type), dimension(:), intent(in) | mos, | ||
| type(cp_fm_type), dimension(:), intent(in) | mo_coeff, | ||
| integer, intent(in) | homo_red, | ||
| integer, intent(in) | virtual_red, | ||
| type(cp_blacs_env_type), pointer | context_bse, | ||
| integer, intent(in), optional | ispin ) |
The multipoles in the MO window, D^k_pq = sum_µν C_µp M^k_µν C_νq, cut to the ai, ij and ab blocks of the window; M^k_µν are the AO multipoles of get_multipoles_ao.
| fm_multipole_ai_trunc | D^k_ai, one entry per component k |
| fm_multipole_ij_trunc | D^k_ij |
| fm_multipole_ab_trunc | D^k_ab |
| matrix_multipole | M^k_µν, one entry per component k (x, y, z, then xx, xy, xz, yy, yz, zz) |
| mos | MO sets of the reference, for the AO layout and the occupied count |
| mo_coeff | C_µp of the spin |
| homo_red | occupied levels in the window |
| virtual_red | virtual levels in the window |
| context_BSE | ... |
| ispin | spin channel whose mo_set supplies homo/nao (default 1); open-shell beta needs 2 |
Definition at line 1178 of file bse_util.F.
| subroutine, public bse_util::trace_exciton_descr | ( | type(cp_fm_type), intent(in) | fm_a, |
| type(cp_fm_type), intent(in) | fm_b, | ||
| type(cp_fm_type), intent(in) | fm_c, | ||
| real(kind=dp), intent(out) | alpha ) |
Computes trace of form Tr{A^T B C} for exciton descriptors.
| fm_A | Full Matrix, typically X or Y, in format homo x virtual |
| fm_B | ... |
| fm_C | ... |
| alpha | ... |
Definition at line 1333 of file bse_util.F.
| subroutine, public bse_util::assemble_joint_ov_slab | ( | type(cp_fm_type), dimension(:), intent(in) | fm_s_ia, |
| integer, dimension(:), intent(in) | offsets, | ||
| integer, dimension(:), intent(in) | n_ov, | ||
| integer, intent(in) | dimen_ri, | ||
| type(cp_fm_type), intent(inout) | fm_s_joint ) |
Column-concatenate per-spin ia-slabs into the joint dimen_RI x n_ov_joint slab. Sigma-block of spin isp occupies columns offsets(isp)+1 .. offsets(isp)+n_ov(isp). fm_S_joint must be pre-created and zeroed by the caller.
| fm_S_ia | per-spin ia-slabs, shape (dimen_RI, n_ov(isp)) per spin |
| offsets | per-spin column offsets into fm_S_joint (0-based) |
| n_ov | per-spin OV-pair counts |
| dimen_RI | RI auxiliary basis dimension (row count) |
| fm_S_joint | pre-created output slab (dimen_RI x n_ov_joint) |
Definition at line 1377 of file bse_util.F.