(git:b77b4be)
Loading...
Searching...
No Matches
bse_util Module Reference

Auxiliary routines for GW + Bethe-Salpeter for computing electronic excitations. More...

Functions/Subroutines

subroutine, public mult_b_with_w (fm_mat_s_ij_bse, fm_mat_s_ia_bse, fm_mat_s_bar_ia_bse, fm_mat_s_bar_ij_bse, fm_mat_q_static_bse_gemm, dimen_ri, homo, virtual)
 Multiplies B-matrix (RI-3c-Integrals) with W (screening) to obtain \bar{B}.
 
subroutine, public fm_general_add_bse (fm_out, fm_in, beta, nrow_secidx_in, ncol_secidx_in, nrow_secidx_out, ncol_secidx_out, unit_nr, reordering, mp2_env)
 Adds and reorders full matrices with a combined index structure, e.g. adding W_ij,ab to A_ia, jb which needs MPI communication.
 
subroutine, public truncate_fm (fm_out, fm_in, ncol_in, nrow_out, ncol_out, unit_nr, mp2_env, nrow_offset, ncol_offset)
 Routine for truncating a full matrix as given by the energy cutoffs in the input file. Logic: Matrices have some dimension dimen_RI x nrow_in*ncol_in for the incoming (untruncated) matrix and dimen_RI x nrow_out*ncol_out for the truncated matrix. The truncation is done by resorting the indices via parallel communication.
 
subroutine, public deallocate_matrices_bse (fm_mat_s_bar_ia_bse, fm_mat_s_bar_ij_bse, fm_mat_s_trunc, fm_mat_s_ij_trunc, fm_mat_s_ab_trunc, fm_mat_q_static_bse_gemm, mp2_env)
 ...
 
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)
 ...
 
subroutine, public estimate_bse_resources (homo_red, virtual_red, unit_nr, bse_abba, para_env, diag_runtime_est)
 Roughly estimates the needed runtime and memory during the BSE run.
 
subroutine, public filter_eigvec_contrib (fm_eigvec, idx_homo, idx_virt, eigvec_entries, i_exc, virtual, num_entries, mp2_env)
 Filters eigenvector entries above a given threshold to describe excitations in the singleparticle basis.
 
subroutine, public determine_cutoff_indices (eigenval, homo, virtual, homo_red, virt_red, homo_incl, virt_incl, mp2_env)
 Reads cutoffs for BSE from mp2_env and compares to energies in Eigenval to extract reduced homo/virtual and.
 
subroutine, public truncate_bse_matrices (fm_mat_s_ia_bse, fm_mat_s_ij_bse, fm_mat_s_ab_bse, fm_mat_s_trunc, fm_mat_s_ij_trunc, fm_mat_s_ab_trunc, eigenval_scf, eigenval, eigenval_reduced, homo, virtual, dimen_ri, unit_nr, bse_lev_virt, homo_red, virt_red, mp2_env)
 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, unit_nr, mp2_env)
 ...
 
subroutine, public print_bse_nto_cubes (qs_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, mp2_env, qs_env)
 Checks BSE input section and adapts them if necessary.
 
subroutine, public get_multipoles_mo (fm_multipole_ai_trunc, fm_multipole_ij_trunc, fm_multipole_ab_trunc, qs_env, mo_coeff, rpoint, n_moments, homo_red, virtual_red, context_bse)
 ...
 
subroutine, public trace_exciton_descr (fm_a, fm_b, fm_c, alpha)
 Computes trace of form Tr{A^T B C} for exciton descriptors.
 

Detailed Description

Auxiliary routines for GW + Bethe-Salpeter for computing electronic excitations.

History
11.2023 created [Maximilian Graml]

Function/Subroutine Documentation

◆ mult_b_with_w()

subroutine, public bse_util::mult_b_with_w ( type(cp_fm_type), intent(in)  fm_mat_s_ij_bse,
type(cp_fm_type), intent(in)  fm_mat_s_ia_bse,
type(cp_fm_type), intent(out)  fm_mat_s_bar_ia_bse,
type(cp_fm_type), intent(out)  fm_mat_s_bar_ij_bse,
type(cp_fm_type), intent(in)  fm_mat_q_static_bse_gemm,
integer, intent(in)  dimen_ri,
integer, intent(in)  homo,
integer, intent(in)  virtual 
)

Multiplies B-matrix (RI-3c-Integrals) with W (screening) to obtain \bar{B}.

Parameters
fm_mat_S_ij_bse...
fm_mat_S_ia_bse...
fm_mat_S_bar_ia_bse...
fm_mat_S_bar_ij_bse...
fm_mat_Q_static_bse_gemm...
dimen_RI...
homo...
virtual...

Definition at line 110 of file bse_util.F.

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

◆ fm_general_add_bse()

subroutine, public bse_util::fm_general_add_bse ( type(cp_fm_type), intent(inout)  fm_out,
type(cp_fm_type), intent(in)  fm_in,
real(kind=dp)  beta,
integer, intent(in)  nrow_secidx_in,
integer, intent(in)  ncol_secidx_in,
integer, intent(in)  nrow_secidx_out,
integer, intent(in)  ncol_secidx_out,
integer  unit_nr,
integer, dimension(4)  reordering,
type(mp2_type), intent(in)  mp2_env 
)

Adds and reorders full matrices with a combined index structure, e.g. adding W_ij,ab to A_ia, jb which needs MPI communication.

Parameters
fm_out...
fm_in...
beta...
nrow_secidx_in...
ncol_secidx_in...
nrow_secidx_out...
ncol_secidx_out...
unit_nr...
reordering...
mp2_env...

Definition at line 197 of file bse_util.F.

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

◆ truncate_fm()

subroutine, public bse_util::truncate_fm ( type(cp_fm_type), intent(inout)  fm_out,
type(cp_fm_type), intent(in)  fm_in,
integer  ncol_in,
integer  nrow_out,
integer  ncol_out,
integer  unit_nr,
type(mp2_type), intent(inout)  mp2_env,
integer, intent(in), optional  nrow_offset,
integer, intent(in), optional  ncol_offset 
)

Routine for truncating a full matrix as given by the energy cutoffs in the input file. Logic: Matrices have some dimension dimen_RI x nrow_in*ncol_in for the incoming (untruncated) matrix and dimen_RI x nrow_out*ncol_out for the truncated matrix. The truncation is done by resorting the indices via parallel communication.

Parameters
fm_out...
fm_in...
ncol_in...
nrow_out...
ncol_out...
unit_nr...
mp2_env...
nrow_offset...
ncol_offset...

Definition at line 456 of file bse_util.F.

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

◆ deallocate_matrices_bse()

subroutine, public bse_util::deallocate_matrices_bse ( type(cp_fm_type), intent(inout)  fm_mat_s_bar_ia_bse,
type(cp_fm_type), intent(inout)  fm_mat_s_bar_ij_bse,
type(cp_fm_type), intent(inout)  fm_mat_s_trunc,
type(cp_fm_type), intent(inout)  fm_mat_s_ij_trunc,
type(cp_fm_type), intent(inout)  fm_mat_s_ab_trunc,
type(cp_fm_type), intent(inout)  fm_mat_q_static_bse_gemm,
type(mp2_type mp2_env 
)

...

Parameters
fm_mat_S_bar_ia_bse...
fm_mat_S_bar_ij_bse...
fm_mat_S_trunc...
fm_mat_S_ij_trunc...
fm_mat_S_ab_trunc...
fm_mat_Q_static_bse_gemm...
mp2_env...

Definition at line 749 of file bse_util.F.

Here is the caller graph for this function:

◆ comp_eigvec_coeff_bse()

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.

Parameters
fm_work...
eig_vals...
beta...
gamma...
do_transpose...

Definition at line 786 of file bse_util.F.

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

◆ sort_excitations()

subroutine, public bse_util::sort_excitations ( integer, dimension(:), allocatable  idx_prim,
integer, dimension(:), allocatable  idx_sec,
real(kind=dp), dimension(:), allocatable  eigvec_entries 
)

...

Parameters
idx_prim...
idx_sec...
eigvec_entries...

Definition at line 851 of file bse_util.F.

Here is the caller graph for this function:

◆ estimate_bse_resources()

subroutine, public bse_util::estimate_bse_resources ( integer  homo_red,
integer  virtual_red,
integer  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.

Parameters
homo_red...
virtual_red...
unit_nr...
bse_abba...
para_env...
diag_runtime_est...

Definition at line 934 of file bse_util.F.

Here is the caller graph for this function:

◆ filter_eigvec_contrib()

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(mp2_type), intent(inout)  mp2_env 
)

Filters eigenvector entries above a given threshold to describe excitations in the singleparticle basis.

Parameters
fm_eigvec...
idx_homo...
idx_virt...
eigvec_entries...
i_exc...
virtual...
num_entries...
mp2_env...

Definition at line 992 of file bse_util.F.

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

◆ determine_cutoff_indices()

subroutine, public bse_util::determine_cutoff_indices ( real(kind=dp), dimension(:), intent(in)  eigenval,
integer, intent(in)  homo,
integer, intent(in)  virtual,
integer, intent(out)  homo_red,
integer, intent(out)  virt_red,
integer, intent(out)  homo_incl,
integer, intent(out)  virt_incl,
type(mp2_type), intent(inout)  mp2_env 
)

Reads cutoffs for BSE from mp2_env and compares to energies in Eigenval to extract reduced homo/virtual and.

Parameters
Eigenvalarray (1d) with energies, can be e.g. from GW or DFT
homoTotal number of occupied orbitals
virtualTotal number of unoccupied orbitals
homo_redTotal number of occupied orbitals to include after cutoff
virt_redTotal number of unoccupied orbitals to include after ctuoff
homo_inclFirst occupied index to include after cutoff
virt_inclLast unoccupied index to include after cutoff
mp2_env...

Definition at line 1125 of file bse_util.F.

Here is the caller graph for this function:

◆ truncate_bse_matrices()

subroutine, public bse_util::truncate_bse_matrices ( type(cp_fm_type), intent(in)  fm_mat_s_ia_bse,
type(cp_fm_type), intent(in)  fm_mat_s_ij_bse,
type(cp_fm_type), intent(in)  fm_mat_s_ab_bse,
type(cp_fm_type), intent(inout)  fm_mat_s_trunc,
type(cp_fm_type), intent(inout)  fm_mat_s_ij_trunc,
type(cp_fm_type), intent(inout)  fm_mat_s_ab_trunc,
real(kind=dp), dimension(:)  eigenval_scf,
real(kind=dp), dimension(:)  eigenval,
real(kind=dp), dimension(:), allocatable  eigenval_reduced,
integer, intent(in)  homo,
integer, intent(in)  virtual,
integer, intent(in)  dimen_ri,
integer, intent(in)  unit_nr,
integer, intent(in)  bse_lev_virt,
integer, intent(out)  homo_red,
integer, intent(out)  virt_red,
type(mp2_type), intent(inout)  mp2_env 
)

Determines indices within the given energy cutoffs and truncates Eigenvalues and matrices.

Parameters
fm_mat_S_ia_bse...
fm_mat_S_ij_bse...
fm_mat_S_ab_bse...
fm_mat_S_trunc...
fm_mat_S_ij_trunc...
fm_mat_S_ab_trunc...
Eigenval_scf...
Eigenval...
Eigenval_reduced...
homo...
virtual...
dimen_RI...
unit_nr...
bse_lev_virt...
homo_red...
virt_red...
mp2_env...

Definition at line 1204 of file bse_util.F.

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

◆ reshuffle_eigvec()

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,
integer, intent(in)  unit_nr,
type(mp2_type), intent(inout)  mp2_env 
)

...

Parameters
fm_eigvec...
fm_eigvec_reshuffled...
homo...
virtual...
n_exc...
do_transpose...
unit_nr...
mp2_env...

Definition at line 1349 of file bse_util.F.

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

◆ print_bse_nto_cubes()

subroutine, public bse_util::print_bse_nto_cubes ( type(qs_environment_type), pointer  qs_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.

Parameters
qs_env...
mos...
istate...
info_approximation...
stride...
append_cube...
print_section...

Definition at line 1423 of file bse_util.F.

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

◆ adapt_bse_input_params()

subroutine, public bse_util::adapt_bse_input_params ( integer, intent(in)  homo,
integer, intent(in)  virtual,
integer, intent(in)  unit_nr,
type(mp2_type mp2_env,
type(qs_environment_type), pointer  qs_env 
)

Checks BSE input section and adapts them if necessary.

Parameters
homo...
virtual...
unit_nr...
mp2_env...
qs_env...

Definition at line 1519 of file bse_util.F.

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

◆ get_multipoles_mo()

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(qs_environment_type), pointer  qs_env,
type(cp_fm_type), dimension(:), intent(in)  mo_coeff,
real(dp), dimension(:), intent(inout), allocatable  rpoint,
integer, intent(in)  n_moments,
integer, intent(in)  homo_red,
integer, intent(in)  virtual_red,
type(cp_blacs_env_type), pointer  context_bse 
)

...

Parameters
fm_multipole_ai_trunc...
fm_multipole_ij_trunc...
fm_multipole_ab_trunc...
qs_env...
mo_coeff...
rpoint...
n_moments...
homo_red...
virtual_red...
context_BSE...

Definition at line 1712 of file bse_util.F.

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

◆ trace_exciton_descr()

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.

Parameters
fm_AFull Matrix, typically X or Y, in format homo x virtual
fm_B...
fm_C...
alpha...

Definition at line 1892 of file bse_util.F.

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