|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <exciton_plotter.h>
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) | |
|
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).
| nspin_global | global number of spin channels |
| naos | number of atomic-orbital basis functions |
| nocc | number of occupied bands per spin |
| nvirt | number of virtual bands per spin |
| psi_ks_in | Kohn-Sham wavefunction coefficients |
| ucell_in | unit cell |
| kv_in | k-point list |
| gd_in | grid driver for neighbor-list search |
| orb_cutoff_in | orbital cutoff radii per atom type |
| Pgrid_in | parallel grid for real-space decomposition |
| rho_basis_in | plane-wave basis for the real-space grid |
| pX_in | 2D block-cyclic distribution for X matrix |
| pc_in | 2D block-cyclic distribution for KS orbitals (reserved for distributed plotting) |
| pmat_in | parallel distribution for AO matrices |
| output_dir_in | output directory for generated density files |
| two_fermi_in | whether spin channels use separate Fermi energies |
| eig | excitation energies in Ry |
| X | BSE eigenvector amplitudes (TDA) |
| openshell | true for spin-unrestricted (nspin_x=2) |
| orb | optional LCAO_Orbitals pointer (required for conditional density) |
|
private |
Build one effective AO coefficient vector per k-point for a conditional electron or hole wavefunction.
| 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'}).
| istate | BSE state index |
| 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}).
| istate | BSE state index |
| 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.
| istate | BSE state index |
| type | "hole" for average hole density, "elec" for average electron density |
| 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.
| istate | BSE state index |
| type | "hole" for average hole density, "elec" for average electron density |
| plane | cross-section plane: "ab", "bc", or "ca" |
| slice_pos | offset along the perpendicular direction (Bohr) |
| npoints | desired grid resolution |
| range | in-plane cell range {ustart, uend, vstart, vend} |
| 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.
| istate | BSE state index |
| r_fix | fixed opposite-particle position {x, y, z} in Bohr |
| plane | cross-section plane: "ab", "bc", or "ca" |
| slice_pos | offset along the perpendicular direction (Bohr) |
| npoints | desired grid resolution (pts per cell ≈ npoints / total_cells) |
| range | in-plane cell range {ustart, uend, vstart, vend} |
| type | "elec" or "hole" |
|
private |
excitation energies (Ry)
|
private |
grid driver for neighbor search
|
private |
k-point list
|
private |
local leading dimension of X (data size per state)
|
private |
number of atomic-orbital basis functions
|
private |
number of k-points
|
private |
number of occupied bands per spin
|
private |
1 for singlet/triplet, 2 for up/down (open-shell)
|
private |
number of virtual bands per spin
|
private |
orbital data for single-point evaluation
|
private |
orbital cutoff radii
|
private |
single-point NAO evaluator (initialized if orb_ != nullptr)
|
private |
output directory for density files
|
private |
KS-orbital distribution reserved for MPI plotting.
|
private |
parallel real-space grid
|
private |
parallel distribution for AO matrices
|
private |
KS wavefunction per spin.
|
private |
plane-wave basis for density grid
|
private |
unit cell
|
private |
BSE eigenvector amplitudes.