ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
density_matrix.h File Reference
#include <complex>
#include <map>
#include <string>
#include <vector>
#include "source_base/vector3.h"
#include "source_cell/module_neighbor/sltk_grid_driver.h"
#include "source_cell/record_adj.h"
#include "source_hamilt/module_hcontainer/hcontainer.h"
Include dependency graph for density_matrix.h:

Go to the source code of this file.

Classes

struct  module_dm::ShiftRealComplex< T >
 map a real/complex type to the opposite one ShiftRealComplex<double>::type = std::complex<double> ShiftRealComplex<std::complex<double>>::type = double More...
struct  module_dm::ShiftRealComplex< double >
struct  module_dm::ShiftRealComplex< std::complex< double > >
struct  module_dm::DmrBlock
 geometry of one atom-pair sub-block within the global DMK matrix row0/col0: global index of the block's top-left element in the 2D block-cyclic DMK nrows/ncols: orbital dimensions of the two atoms More...
class  module_dm::DensityMatrix< TK, TR >
 DensityMatrix Class <TK,TR> = <double,double> for Gamma-only calculation <TK,TR> = <std::complex<double>,double> for multi-k calculation. More...

Namespaces

namespace  module_dm

Functions

template<typename TK, typename TR_in, typename TR_out>
void module_dm::cal_dmr (const DensityMatrix< TK, TR_in > &dm, std::vector< hamilt::HContainer< TR_out > * > &dmR_out, const int ik_in)
template<typename TK, typename TR_in, typename TR_out>
void module_dm::cal_dmr_td (DensityMatrix< TK, TR_in > &dm, std::vector< hamilt::HContainer< TR_out > * > &dmR_out, const std::map< ModuleBase::Vector3< int >, std::complex< double > > &phase_hybrid, const ModuleBase::Vector3< double > At, const int ik_in)
template<typename TK, typename TR_in, typename TR_out>
void module_dm::cal_dmr_full (const DensityMatrix< TK, TR_in > &dm, hamilt::HContainer< TR_out > *dmR_out, const int ik_in)
template<typename TK, typename TR_in, typename TR_out>
void module_dm::accumulate_dmr (const DensityMatrix< TK, TR_in > &dm, std::vector< hamilt::HContainer< TR_out > * > &dmR_out, const std::map< ModuleBase::Vector3< int >, std::complex< double > > &phase_hybrid, const int ik_in, const char *func_name)
 shared inner loop of cal_dmr / cal_dmr_td: for each spin channel, zero the DMR HContainer and accumulate kphase * DMK into DMR blocks. Pass an empty phase_hybrid map for the non-TD (cal_dmr) case.
template<typename TR>
void module_dm::exp_mul_dmk (const std::complex< double > kphase, const std::vector< std::complex< double > > &dmk_row, TR *dmr_mat)
template<typename TR>
void module_dm::xyz_to_updown (const std::complex< double > spin_block[4], const int icol, const int spin_stride[4], TR *dmr_mat)
DmrBlock module_dm::get_dmr_block (const Parallel_Orbitals *pv, const int iat1, const int iat2)
 extract the block geometry for atom pair (iat1, iat2) from the parallel orbitals layout
template<typename TK, typename TR>
void module_dm::build_kphase (hamilt::AtomPair< TR > &atom_pair, const std::vector< ModuleBase::Vector3< double > > &kvec_d, const int nk, const std::map< ModuleBase::Vector3< int >, std::complex< double > > &phase_hybrid, std::vector< std::vector< TK > > &kphase_vec, std::vector< TR * > &dmr_mats)
 precompute k-phase factors e^{ikR} and collect DMR block pointers for one atom pair
template<typename TK>
void module_dm::transpose_dmk_block (const TK *dmk_col_major, const int ld_hk, const DmrBlock &block, TK *dmk_row)
 transpose a col-major DMK sub-block into row-major order
template<typename TK, typename TR>
void module_dm::add_dmr_real (const DensityMatrix< TK, TR > &dm, const DmrBlock &block, const int ik_begin, const std::vector< std::vector< TK > > &kphase_vec, const int ld_hk, const int ik_in, std::vector< TR * > &dmr_mats)
 nspin=1/2: accumulate Re(kphase * DMK) into DMR blocks
template<typename TK, typename TR>
void module_dm::add_dmr_soc (const DensityMatrix< TK, TR > &dm, const DmrBlock &block, const int ik_begin, const std::vector< std::vector< TK > > &kphase_vec, const int ld_hk, const int ik_in, const int col_stride, std::vector< TR * > &dmr_mats)
 nspin==4 (SOC): accumulate k-phase * DMK into a per-R complex buffer, then transform 2x2 spin blocks from (upup, updown, downup, downdown) to (rho_0, rho_x, rho_y, rho_z) via xyz_to_updown.