ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
LR_Util::ExcitonPlotter< T > Class Template Reference

#include <exciton_plotter.h>

Collaboration diagram for LR_Util::ExcitonPlotter< T >:

Public Member Functions

 ExcitonPlotter (const int nspin_global, const int naos, const std::vector< int > &nocc, const std::vector< int > &nvirt, const psi::Psi< T > &psi_ks_in, const UnitCell &ucell_in, const K_Vectors &kv_in, const Grid_Driver &gd_in, const std::vector< double > &orb_cutoff_in, const Parallel_Grid &Pgrid_in, const ModulePW::PW_Basis &rho_basis_in, const std::vector< Parallel_Blkcyclic > &pX_in, const Parallel_Blkcyclic &pc_in, const Parallel_Orbitals &pmat_in, const std::string &output_dir_in, const double *eig, const T *X, const bool openshell, const LCAO_Orbitals *orb)
 Construct an exciton density plotter for TDA excitons. Supports average density (integrating out one particle coordinate) and conditional density (fixing the hole position and evaluating the coherent electron wavefunction).
std::vector< container::Tensor > cal_effective_dmk_hole (const int istate)
 Compute effective DMK for average hole density Produces D_hole(k)^T, where D_hole(k) = C_occ(k) * (X_k^H * X_k) * C_occ(k)^H, matching the AO-index order expected by DensityMatrix::cal_dmr(). Marginalizes over conduction bands: M_k[v,v'] = Sum_c A_{kvc} * conj(A_{kv'c}).
std::vector< container::Tensor > cal_effective_dmk_elec (const int istate)
 Compute effective DMK for average electron density Produces D_elec(k)^T, where D_elec(k) = C_virt(k) * (X_k * X_k^H) * C_virt(k)^H, matching the AO-index order expected by DensityMatrix::cal_dmr(). Marginalizes over valence bands: N_k[c,c'] = Sum_v A_{kvc} * conj(A_{kvc'}).
void plot_average_density (const int istate, const std::string &type)
 Plot average hole or electron density as a .cube file Integrates out the other particle coordinate. The effective DMK is Hermitian, so DMR's real part suffices for cal_gint_rho — no squaring needed.
void plot_average_slice (const int istate, const std::string &type, const std::string &plane, double slice_pos, int npoints, const std::vector< int > &range)
 Plot average hole or electron density on a 2D cross-section Evaluates the Hermitian effective density matrix directly on the requested plane and writes a data file readable by plot_cond_silce.py.
void plot_cond_slice (const int istate, const std::array< double, 3 > &r_fix, const std::string &plane, double slice_pos, int npoints, const std::vector< int > &range, const std::string &type)
 Compute conditional electron or hole density on a 2D BvK cross-section Evaluates psi_cond(r) on a regular grid in the chosen plane (ab, bc, or ca), spanning an explicitly selected range of primitive cells. Uses full Bloch-summed orbital evaluation with home-cell caching for efficiency. Writes a data file with grid + metadata readable by plot_cond_silce.py.

Private Member Functions

std::vector< std::vector< std::complex< double > > > build_conditional_coefficients (int istate, const std::array< double, 3 > &r_fix, bool plot_electron)
 Build one effective AO coefficient vector per k-point for a conditional electron or hole wavefunction.

Private Attributes

const int nspin_x = 1
 1 for singlet/triplet, 2 for up/down (open-shell)
const int naos
 number of atomic-orbital basis functions
const std::vector< int > & nocc
 number of occupied bands per spin
const std::vector< int > & nvirt
 number of virtual bands per spin
const int nk
 number of k-points
const int ldim
 local leading dimension of X (data size per state)
const double * eig
 excitation energies (Ry)
const T * X
 BSE eigenvector amplitudes.
const K_Vectors & kv
 k-point list
std::vector< psi::Psi< T > > psi_ks_vec
 KS wavefunction per spin.
const UnitCell & ucell
 unit cell
const std::vector< double > & orb_cutoff_
 orbital cutoff radii
const Grid_Driver & gd_
 grid driver for neighbor search
const Parallel_Grid & Pgrid
 parallel real-space grid
const ModulePW::PW_Basis & rho_basis
 plane-wave basis for density grid
const std::string output_dir_
 output directory for density files
const Parallel_Blkcyclic & pc
 KS-orbital distribution reserved for MPI plotting.
const Parallel_Orbitals & pmat
 parallel distribution for AO matrices
const LCAO_Orbitals * orb_ = nullptr
 orbital data for single-point evaluation
OrbitalEvaluator orb_eval_
 single-point NAO evaluator (initialized if orb_ != nullptr)

Constructor & Destructor Documentation

◆ ExcitonPlotter()

template<typename T>
LR_Util::ExcitonPlotter< T >::ExcitonPlotter ( const int nspin_global,
const int naos,
const std::vector< int > & nocc,
const std::vector< int > & nvirt,
const psi::Psi< T > & psi_ks_in,
const UnitCell & ucell_in,
const K_Vectors & kv_in,
const Grid_Driver & gd_in,
const std::vector< double > & orb_cutoff_in,
const Parallel_Grid & Pgrid_in,
const ModulePW::PW_Basis & rho_basis_in,
const std::vector< Parallel_Blkcyclic > & pX_in,
const Parallel_Blkcyclic & pc_in,
const Parallel_Orbitals & pmat_in,
const std::string & output_dir_in,
const double * eig,
const T * X,
const bool openshell,
const LCAO_Orbitals * orb )
inline

Construct an exciton density plotter for TDA excitons. Supports average density (integrating out one particle coordinate) and conditional density (fixing the hole position and evaluating the coherent electron wavefunction).

Parameters
nspin_globalglobal number of spin channels
naosnumber of atomic-orbital basis functions
noccnumber of occupied bands per spin
nvirtnumber of virtual bands per spin
psi_ks_inKohn-Sham wavefunction coefficients
ucell_inunit cell
kv_ink-point list
gd_ingrid driver for neighbor-list search
orb_cutoff_inorbital cutoff radii per atom type
Pgrid_inparallel grid for real-space decomposition
rho_basis_inplane-wave basis for the real-space grid
pX_in2D block-cyclic distribution for X matrix
pc_in2D block-cyclic distribution for KS orbitals (reserved for distributed plotting)
pmat_inparallel distribution for AO matrices
output_dir_inoutput directory for generated density files
two_fermi_inwhether spin channels use separate Fermi energies
eigexcitation energies in Ry
XBSE eigenvector amplitudes (TDA)
openshelltrue for spin-unrestricted (nspin_x=2)
orboptional LCAO_Orbitals pointer (required for conditional density)
Here is the call graph for this function:

Member Function Documentation

◆ build_conditional_coefficients()

template<typename T>
std::vector< std::vector< std::complex< double > > > LR_Util::ExcitonPlotter< T >::build_conditional_coefficients ( int istate,
const std::array< double, 3 > & r_fix,
bool plot_electron )
private

Build one effective AO coefficient vector per k-point for a conditional electron or hole wavefunction.

Here is the caller graph for this function:

◆ cal_effective_dmk_elec()

template<typename T>
std::vector< container::Tensor > LR_Util::ExcitonPlotter< T >::cal_effective_dmk_elec ( const int istate)

Compute effective DMK for average electron density Produces D_elec(k)^T, where D_elec(k) = C_virt(k) * (X_k * X_k^H) * C_virt(k)^H, matching the AO-index order expected by DensityMatrix::cal_dmr(). Marginalizes over valence bands: N_k[c,c'] = Sum_v A_{kvc} * conj(A_{kvc'}).

Parameters
istateBSE state index
Returns
dmk_per_kpoint
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_effective_dmk_hole()

template<typename T>
std::vector< container::Tensor > LR_Util::ExcitonPlotter< T >::cal_effective_dmk_hole ( const int istate)

Compute effective DMK for average hole density Produces D_hole(k)^T, where D_hole(k) = C_occ(k) * (X_k^H * X_k) * C_occ(k)^H, matching the AO-index order expected by DensityMatrix::cal_dmr(). Marginalizes over conduction bands: M_k[v,v'] = Sum_c A_{kvc} * conj(A_{kv'c}).

Parameters
istateBSE state index
Returns
dmk_per_kpoint
Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot_average_density()

template<typename T>
void LR_Util::ExcitonPlotter< T >::plot_average_density ( const int istate,
const std::string & type )

Plot average hole or electron density as a .cube file Integrates out the other particle coordinate. The effective DMK is Hermitian, so DMR's real part suffices for cal_gint_rho — no squaring needed.

Parameters
istateBSE state index
type"hole" for average hole density, "elec" for average electron density
Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot_average_slice()

template<typename T>
void LR_Util::ExcitonPlotter< T >::plot_average_slice ( const int istate,
const std::string & type,
const std::string & plane,
double slice_pos,
int npoints,
const std::vector< int > & range )

Plot average hole or electron density on a 2D cross-section Evaluates the Hermitian effective density matrix directly on the requested plane and writes a data file readable by plot_cond_silce.py.

Parameters
istateBSE state index
type"hole" for average hole density, "elec" for average electron density
planecross-section plane: "ab", "bc", or "ca"
slice_posoffset along the perpendicular direction (Bohr)
npointsdesired grid resolution
rangein-plane cell range {ustart, uend, vstart, vend}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot_cond_slice()

template<typename T>
void LR_Util::ExcitonPlotter< T >::plot_cond_slice ( const int istate,
const std::array< double, 3 > & r_fix,
const std::string & plane,
double slice_pos,
int npoints,
const std::vector< int > & range,
const std::string & type )

Compute conditional electron or hole density on a 2D BvK cross-section Evaluates psi_cond(r) on a regular grid in the chosen plane (ab, bc, or ca), spanning an explicitly selected range of primitive cells. Uses full Bloch-summed orbital evaluation with home-cell caching for efficiency. Writes a data file with grid + metadata readable by plot_cond_silce.py.

Parameters
istateBSE state index
r_fixfixed opposite-particle position {x, y, z} in Bohr
planecross-section plane: "ab", "bc", or "ca"
slice_posoffset along the perpendicular direction (Bohr)
npointsdesired grid resolution (pts per cell ≈ npoints / total_cells)
rangein-plane cell range {ustart, uend, vstart, vend}
type"elec" or "hole"
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ eig

template<typename T>
const double* LR_Util::ExcitonPlotter< T >::eig
private

excitation energies (Ry)

◆ gd_

template<typename T>
const Grid_Driver& LR_Util::ExcitonPlotter< T >::gd_
private

grid driver for neighbor search

◆ kv

template<typename T>
const K_Vectors& LR_Util::ExcitonPlotter< T >::kv
private

k-point list

◆ ldim

template<typename T>
const int LR_Util::ExcitonPlotter< T >::ldim
private

local leading dimension of X (data size per state)

◆ naos

template<typename T>
const int LR_Util::ExcitonPlotter< T >::naos
private

number of atomic-orbital basis functions

◆ nk

template<typename T>
const int LR_Util::ExcitonPlotter< T >::nk
private

number of k-points

◆ nocc

template<typename T>
const std::vector<int>& LR_Util::ExcitonPlotter< T >::nocc
private

number of occupied bands per spin

◆ nspin_x

template<typename T>
const int LR_Util::ExcitonPlotter< T >::nspin_x = 1
private

1 for singlet/triplet, 2 for up/down (open-shell)

◆ nvirt

template<typename T>
const std::vector<int>& LR_Util::ExcitonPlotter< T >::nvirt
private

number of virtual bands per spin

◆ orb_

template<typename T>
const LCAO_Orbitals* LR_Util::ExcitonPlotter< T >::orb_ = nullptr
private

orbital data for single-point evaluation

◆ orb_cutoff_

template<typename T>
const std::vector<double>& LR_Util::ExcitonPlotter< T >::orb_cutoff_
private

orbital cutoff radii

◆ orb_eval_

template<typename T>
OrbitalEvaluator LR_Util::ExcitonPlotter< T >::orb_eval_
private

single-point NAO evaluator (initialized if orb_ != nullptr)

◆ output_dir_

template<typename T>
const std::string LR_Util::ExcitonPlotter< T >::output_dir_
private

output directory for density files

◆ pc

template<typename T>
const Parallel_Blkcyclic& LR_Util::ExcitonPlotter< T >::pc
private

KS-orbital distribution reserved for MPI plotting.

◆ Pgrid

template<typename T>
const Parallel_Grid& LR_Util::ExcitonPlotter< T >::Pgrid
private

parallel real-space grid

◆ pmat

template<typename T>
const Parallel_Orbitals& LR_Util::ExcitonPlotter< T >::pmat
private

parallel distribution for AO matrices

◆ psi_ks_vec

template<typename T>
std::vector<psi::Psi<T> > LR_Util::ExcitonPlotter< T >::psi_ks_vec
private

KS wavefunction per spin.

◆ rho_basis

template<typename T>
const ModulePW::PW_Basis& LR_Util::ExcitonPlotter< T >::rho_basis
private

plane-wave basis for density grid

◆ ucell

template<typename T>
const UnitCell& LR_Util::ExcitonPlotter< T >::ucell
private

unit cell

◆ X

template<typename T>
const T* LR_Util::ExcitonPlotter< T >::X
private

BSE eigenvector amplitudes.


The documentation for this class was generated from the following files: