ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
module_dm::DensityMatrix< TK, TR > Class Template Reference

DensityMatrix Class <TK,TR> = <double,double> for Gamma-only calculation <TK,TR> = <std::complex<double>,double> for multi-k calculation. More...

#include <density_matrix.h>

Collaboration diagram for module_dm::DensityMatrix< TK, TR >:

Public Member Functions

 ~DensityMatrix ()
 Destructor of class DensityMatrix.
 DensityMatrix (const Parallel_Orbitals *pv, const int spin_mult, const std::vector< ModuleBase::Vector3< double > > &kvec_d, const int nk, const int nspin=0)
 Constructor of class DensityMatrix for multi-k calculation.
 DensityMatrix (const Parallel_Orbitals *pv, const int spin_mult, const int nspin=0)
 Constructor of class DensityMatrix for gamma-only calculation, where kvector is not required.
void init_dmr (const Grid_Driver *GridD_in, const UnitCell *ucell)
 initialize density matrix DMR from UnitCell
void init_dmr (Record_adj &ra, const UnitCell *ucell)
 initialize density matrix DMR from UnitCell and RA
void init_dmr (const hamilt::HContainer< TR > &_DMR_in)
 initialize density matrix DMR from another HContainer now only support HContainer<double>
void init_dmr (const hamilt::HContainer< TRShift > &_DMR_in)
 initialize density matrix DMR from another HContainer this is a temprory function for NSPIN=4 case since copy HContainer from another HContainer with different TR is not supported yet would be refactor in the future
void set_dmk (const int ispin, const int ik, const int i, const int j, const TK value)
 set dmk element directly
void set_dmk_zero ()
 set dmk element to zero
TK get_dmk (const int ispin, const int ik, const int i, const int j) const
 get a matrix element of density matrix dm(k)
int get_dmk_nks () const
 get total number of k-points of density matrix dm(k)
int get_dmk_size () const
int get_dmk_nrow () const
 get number of rows of density matrix dm(k)
int get_dmk_ncol () const
 get number of columns of density matrix dm(k)
hamilt::HContainer< TR > * get_dmr_ptr (const int ispin) const
 get pointer of DMR
bool is_dmr_ready () const
 check whether the stored DMR is a valid density matrix calculated from DMK init_dmr() resets the flag and cal_dmr()/cal_dmr_td() set it, so a freshly allocated, zeroed or file-read DMR is reported as not ready until the first wavefunction-derived calculation
const std::vector< hamilt::HContainer< TR > * > & get_dmr_vec () const
 get pointer vector of DMR
std::vector< hamilt::HContainer< TR > * > & get_dmr_vec ()
const std::vector< std::vector< TR > > & get_dmr_save () const
std::vector< std::vector< TR > > & get_dmr_save ()
TK * get_dmk_ptr (const int ik) const
 get pointer of DMK
const std::vector< std::vector< TK > > & get_dmk_vec () const
 get pointer vector of DMK
std::vector< std::vector< TK > > & get_dmk_vec ()
void set_dmk_ptr (const int ik, TK *DMK_in)
 set dmk using a input TK* pointer please make sure the size of TK* is correct
void set_DMK_vector (const int ik, const std::vector< TK > &v)
int get_DMK_nks () const
 number of k-slots stored in dmk (spin_mult * _nk, flattened)
void cal_dmr (const int ik_in)
 calculate density matrix DMR from dm(k) using blas::axpy
void cal_dmr_td (const std::map< ModuleBase::Vector3< int >, std::complex< double > > &phase_hybrid, const ModuleBase::Vector3< double > At, const int ik_in)
 calculate density matrix DMR with additional vector potential phase, used for hybrid gauge tddft
void cal_dmr_full (hamilt::HContainer< std::complex< double > > *dmR_out, const int ik_in) const
 calculate complex density matrix DMR with both real and imaginary part for noncollinear-spin calculation the stored dm(k) has been used to calculate the passin DMR
void switch_dmr (const int mode)
 (Only nspin=2) switch DMR to total density matrix or magnetization density matrix
void save_dmr ()
 save dmr into dmr_save
void cal_dmr_full (hamilt::HContainer< std::complex< double > > *dmR_out, const int ik_in) const
void cal_dmr_full (hamilt::HContainer< std::complex< double > > *dmR_out, const int ik_in) const
void cal_dmr (const int ik_in)
void cal_dmr (const int ik_in)
void cal_dmr (const int ik_in)
void cal_dmr_td (const std::map< ModuleBase::Vector3< int >, std::complex< double > > &phase_hybrid, const ModuleBase::Vector3< double > At, const int ik_in)
void cal_dmr_td (const std::map< ModuleBase::Vector3< int >, std::complex< double > > &phase_hybrid, const ModuleBase::Vector3< double > At, const int ik_in)
void cal_dmr_td (const std::map< ModuleBase::Vector3< int >, std::complex< double > > &phase_hybrid, const ModuleBase::Vector3< double > At, const int ik_in)

Public Attributes

std::vector< ModuleBase::ComplexMatrix > edmk

Private Types

using TRShift = typename ShiftRealComplex<TR>::type

Private Member Functions

void clear_dmr ()
 delete all HContainer objects in dmr and clear the vector

Private Attributes

std::vector< hamilt::HContainer< TR > * > dmr
 HContainer for density matrix in real space for 2D parallelization vector.size() = 1 for non-polarization and SOC vector.size() = 2 for spin-polarization.
std::vector< std::vector< TR > > dmr_save
bool _dmr_ready = false
 whether dmr holds a density matrix calculated from DMK (reset by init_dmr, set by cal_dmr)
std::vector< hamilt::HContainer< TR > * > dmr_grid
 HContainer for density matrix in real space for grid parallelization same size semantics as dmr.
std::vector< std::vector< TK > > dmk
 density matrix in k space, which is a vector[ik] DMK should be a [spin_mult][_nk][i][j] matrix, whose size is spin_mult * _nk * pv->get_nrow() * pv->get_ncol()
const std::vector< ModuleBase::Vector3< double > > _kvec_d
 K_Vectors object, which is used to get k-point information.
const Parallel_Orbitals * pv = nullptr
 Parallel_Orbitals object, which contain all information of 2D block cyclic distribution.
int spin_mult = 1
 spin multiplicity used to size the density matrix (1 - none spin and SOC ; 2 - spin polarization). This is NOT the physical nspin (1/2/4); it matches K_Vectors::spin_mult.
int nspin = 1
 the global physical nspin from INPUT (1/2/4). For SOC/noncollinear (nspin==4) the density matrix is stored with spin_mult==1 (a single 2x2 spin-block matrix), but cal_dmr/cal_dmr_td must still take the spin-resolved (Pauli) branch. spin_mult cannot distinguish this, so keep the global value here. Equals spin_mult for non-SOC cases.
int _nk = 0
 real number of k-points _nk is not equal to _kv->get_nks() when spin-polarization is considered _nk = kv->get_nks() / nspin when nspin=2
std::vector< TR > dmr_origin
 temporary pointers for switch DMR, only used with nspin=2
std::vector< TR > dmr_tmp

Friends

void module_dm::cal_dmr (const DensityMatrix< TK, TR > &dm, std::vector< hamilt::HContainer< TR > * > &dmR_out, const int ik_in)
void module_dm::cal_dmr_td (DensityMatrix< TK, TR > &dm, std::vector< hamilt::HContainer< TR > * > &dmR_out, const std::map< ModuleBase::Vector3< int >, std::complex< double > > &phase_hybrid, const ModuleBase::Vector3< double > At, const int ik_in)
void module_dm::cal_dmr_full (const DensityMatrix< TK, TR > &dm, hamilt::HContainer< std::complex< double > > *dmR_out, const int ik_in)
void module_dm::accumulate_dmr (const DensityMatrix< TK, TR > &dm, std::vector< hamilt::HContainer< TR > * > &dmR_out, const std::map< ModuleBase::Vector3< int >, std::complex< double > > &phase_hybrid, const int ik_in, const char *func_name)
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)
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)

Detailed Description

template<typename TK, typename TR>
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.

Member Typedef Documentation

◆ TRShift

template<typename TK, typename TR>
using module_dm::DensityMatrix< TK, TR >::TRShift = typename ShiftRealComplex<TR>::type
private

Constructor & Destructor Documentation

◆ ~DensityMatrix()

template<typename TK, typename TR>
module_dm::DensityMatrix< TK, TR >::~DensityMatrix ( )

Destructor of class DensityMatrix.

Here is the call graph for this function:

◆ DensityMatrix() [1/2]

template<typename TK, typename TR>
module_dm::DensityMatrix< TK, TR >::DensityMatrix ( const Parallel_Orbitals * pv,
const int spin_mult,
const std::vector< ModuleBase::Vector3< double > > & kvec_d,
const int nk,
const int nspin = 0 )

Constructor of class DensityMatrix for multi-k calculation.

Parameters
pvpointer of Parallel_Orbitals object
spin_multspin multiplicity used to size the DM: 1 for input nspin 1 or 4 (non-collinear k points are not doubled), 2 for input nspin 2 (LSDA up/down). This is NOT the physical nspin (1/2/4); it matches K_Vectors::spin_mult.
kvec_ddirect coordinates of kpoints
nknumber of k-points, not always equal to K_Vectors::get_nks()/spin_mult. it will be set to kvec_d.size() if the value is invalid
nspinthe global physical nspin from INPUT (1/2/4); defaults to spin_mult for non-SOC cases where they coincide. Pass 4 explicitly for SOC/noncollinear calculations so that cal_dmr selects the spin-resolved (Pauli) branch.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DensityMatrix() [2/2]

template<typename TK, typename TR>
module_dm::DensityMatrix< TK, TR >::DensityMatrix ( const Parallel_Orbitals * pv,
const int spin_mult,
const int nspin = 0 )

Constructor of class DensityMatrix for gamma-only calculation, where kvector is not required.

Parameters
pvpointer of Parallel_Orbitals object
spin_multspin multiplicity of the density matrix (1 or 2); NOT the physical nspin
nspinthe global physical nspin from INPUT (1/2/4); defaults to spin_mult.

Member Function Documentation

◆ cal_dmr() [1/4]

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::cal_dmr ( const int ik_in)

calculate density matrix DMR from dm(k) using blas::axpy

Parameters
ik_inif ik_in < 0, calculate all k-points if ik_in >= 0, calculate only one k-point without summing over k-points
Here is the caller graph for this function:

◆ cal_dmr() [2/4]

void module_dm::DensityMatrix< double, double >::cal_dmr ( const int ik_in)
Here is the caller graph for this function:

◆ cal_dmr() [3/4]

void module_dm::DensityMatrix< std::complex< double >, std::complex< double > >::cal_dmr ( const int ik_in)

◆ cal_dmr() [4/4]

void module_dm::DensityMatrix< std::complex< double >, double >::cal_dmr ( const int ik_in)

◆ cal_dmr_full() [1/3]

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::cal_dmr_full ( hamilt::HContainer< std::complex< double > > * dmR_out,
const int ik_in ) const

calculate complex density matrix DMR with both real and imaginary part for noncollinear-spin calculation the stored dm(k) has been used to calculate the passin DMR

Parameters
dmR_outpointer of HContainer object to store the calculated complex DMR
ik_inif ik_in < 0, calculate all k-points if ik_in >= 0, calculate only one k-point
Here is the caller graph for this function:

◆ cal_dmr_full() [2/3]

void module_dm::DensityMatrix< std::complex< double >, double >::cal_dmr_full ( hamilt::HContainer< std::complex< double > > * dmR_out,
const int ik_in ) const

◆ cal_dmr_full() [3/3]

void module_dm::DensityMatrix< double, double >::cal_dmr_full ( hamilt::HContainer< std::complex< double > > * dmR_out,
const int ik_in ) const
Here is the caller graph for this function:

◆ cal_dmr_td() [1/4]

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::cal_dmr_td ( const std::map< ModuleBase::Vector3< int >, std::complex< double > > & phase_hybrid,
const ModuleBase::Vector3< double > At,
const int ik_in )

calculate density matrix DMR with additional vector potential phase, used for hybrid gauge tddft

Parameters
ik_inif ik_in < 0, calculate all k-points if ik_in >= 0, calculate only one k-point

◆ cal_dmr_td() [2/4]

void module_dm::DensityMatrix< std::complex< double >, std::complex< double > >::cal_dmr_td ( const std::map< ModuleBase::Vector3< int >, std::complex< double > > & phase_hybrid,
const ModuleBase::Vector3< double > At,
const int ik_in )

◆ cal_dmr_td() [3/4]

void module_dm::DensityMatrix< std::complex< double >, double >::cal_dmr_td ( const std::map< ModuleBase::Vector3< int >, std::complex< double > > & phase_hybrid,
const ModuleBase::Vector3< double > At,
const int ik_in )

◆ cal_dmr_td() [4/4]

void module_dm::DensityMatrix< double, double >::cal_dmr_td ( const std::map< ModuleBase::Vector3< int >, std::complex< double > > & phase_hybrid,
const ModuleBase::Vector3< double > At,
const int ik_in )
Here is the caller graph for this function:

◆ clear_dmr()

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::clear_dmr ( )
private

delete all HContainer objects in dmr and clear the vector

Here is the caller graph for this function:

◆ get_dmk()

template<typename TK, typename TR>
TK module_dm::DensityMatrix< TK, TR >::get_dmk ( const int ispin,
const int ik,
const int i,
const int j ) const

get a matrix element of density matrix dm(k)

Parameters
ispinspin index (1 - spin up (support SOC) or 2 - spin down)
ikk-point index
irow index
jcolumn index
Returns
T a matrix element of density matrix dm(k)
Here is the caller graph for this function:

◆ get_dmk_ncol()

template<typename TK, typename TR>
int module_dm::DensityMatrix< TK, TR >::get_dmk_ncol ( ) const

get number of columns of density matrix dm(k)

Here is the caller graph for this function:

◆ get_DMK_nks()

template<typename TK, typename TR>
int module_dm::DensityMatrix< TK, TR >::get_DMK_nks ( ) const
inline

number of k-slots stored in dmk (spin_mult * _nk, flattened)

◆ get_dmk_nks()

template<typename TK, typename TR>
int module_dm::DensityMatrix< TK, TR >::get_dmk_nks ( ) const

get total number of k-points of density matrix dm(k)

Here is the caller graph for this function:

◆ get_dmk_nrow()

template<typename TK, typename TR>
int module_dm::DensityMatrix< TK, TR >::get_dmk_nrow ( ) const

get number of rows of density matrix dm(k)

Here is the caller graph for this function:

◆ get_dmk_ptr()

template<typename TK, typename TR>
TK * module_dm::DensityMatrix< TK, TR >::get_dmk_ptr ( const int ik) const

get pointer of DMK

Parameters
ikk-point index, which is the index of dmk
Returns
TK* pointer of DMK
Here is the caller graph for this function:

◆ get_dmk_size()

template<typename TK, typename TR>
int module_dm::DensityMatrix< TK, TR >::get_dmk_size ( ) const
Here is the caller graph for this function:

◆ get_dmk_vec() [1/2]

template<typename TK, typename TR>
std::vector< std::vector< TK > > & module_dm::DensityMatrix< TK, TR >::get_dmk_vec ( )
inline

◆ get_dmk_vec() [2/2]

template<typename TK, typename TR>
const std::vector< std::vector< TK > > & module_dm::DensityMatrix< TK, TR >::get_dmk_vec ( ) const
inline

get pointer vector of DMK

Here is the caller graph for this function:

◆ get_dmr_ptr()

template<typename TK, typename TR>
hamilt::HContainer< TR > * module_dm::DensityMatrix< TK, TR >::get_dmr_ptr ( const int ispin) const

get pointer of DMR

Parameters
ispinspin index (1 - spin up (support SOC) or 2 - spin down)
Returns
HContainer

* pointer of DMR

Here is the caller graph for this function:

◆ get_dmr_save() [1/2]

template<typename TK, typename TR>
std::vector< std::vector< TR > > & module_dm::DensityMatrix< TK, TR >::get_dmr_save ( )
inline

◆ get_dmr_save() [2/2]

template<typename TK, typename TR>
const std::vector< std::vector< TR > > & module_dm::DensityMatrix< TK, TR >::get_dmr_save ( ) const
inline
Here is the caller graph for this function:

◆ get_dmr_vec() [1/2]

template<typename TK, typename TR>
std::vector< hamilt::HContainer< TR > * > & module_dm::DensityMatrix< TK, TR >::get_dmr_vec ( )
inline

◆ get_dmr_vec() [2/2]

template<typename TK, typename TR>
const std::vector< hamilt::HContainer< TR > * > & module_dm::DensityMatrix< TK, TR >::get_dmr_vec ( ) const
inline

get pointer vector of DMR

Returns
HContainer

* vector of DMR

Here is the caller graph for this function:

◆ init_dmr() [1/4]

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::init_dmr ( const Grid_Driver * GridD_in,
const UnitCell * ucell )

initialize density matrix DMR from UnitCell

Parameters
GridD_inpointer of Grid_Driver object (used to find ajacent atoms)
ucellpointer of UnitCell object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_dmr() [2/4]

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::init_dmr ( const hamilt::HContainer< TR > & _DMR_in)

initialize density matrix DMR from another HContainer now only support HContainer<double>

Parameters
_DMR_inpointer of another HContainer object
Here is the call graph for this function:

◆ init_dmr() [3/4]

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::init_dmr ( const hamilt::HContainer< TRShift > & _DMR_in)

initialize density matrix DMR from another HContainer this is a temprory function for NSPIN=4 case since copy HContainer from another HContainer with different TR is not supported yet would be refactor in the future

Parameters
_DMR_in
Here is the call graph for this function:

◆ init_dmr() [4/4]

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::init_dmr ( Record_adj & ra,
const UnitCell * ucell )

initialize density matrix DMR from UnitCell and RA

initialize density matrix DMR from UnitCell and RA (mainly used in UnitTest)

Parameters
rapointer of Record_adj object (used to find ajacent atoms)
ucellpointer of UnitCell object
Here is the call graph for this function:

◆ is_dmr_ready()

template<typename TK, typename TR>
bool module_dm::DensityMatrix< TK, TR >::is_dmr_ready ( ) const
inline

check whether the stored DMR is a valid density matrix calculated from DMK init_dmr() resets the flag and cal_dmr()/cal_dmr_td() set it, so a freshly allocated, zeroed or file-read DMR is reported as not ready until the first wavefunction-derived calculation

Returns
true if DMR is ready for Hamiltonian construction
Here is the caller graph for this function:

◆ save_dmr()

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::save_dmr ( )

save dmr into dmr_save

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

◆ set_dmk()

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::set_dmk ( const int ispin,
const int ik,
const int i,
const int j,
const TK value )

set dmk element directly

Parameters
ispinspin index (1 - spin up (support SOC) or 2 - spin down)
ikk-point index
irow index
jcolumn index
valuevalue to be set
Here is the caller graph for this function:

◆ set_dmk_ptr()

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::set_dmk_ptr ( const int ik,
TK * DMK_in )

set dmk using a input TK* pointer please make sure the size of TK* is correct

Here is the caller graph for this function:

◆ set_DMK_vector()

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::set_DMK_vector ( const int ik,
const std::vector< TK > & v )
inline

◆ set_dmk_zero()

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::set_dmk_zero ( )

set dmk element to zero

◆ switch_dmr()

template<typename TK, typename TR>
void module_dm::DensityMatrix< TK, TR >::switch_dmr ( const int mode)

(Only nspin=2) switch DMR to total density matrix or magnetization density matrix

Parameters
mode0 - original density matrix; 1 - total density matrix; 2 - magnetization density matrix
Here is the call graph for this function:
Here is the caller graph for this function:

◆ module_dm::accumulate_dmr

template<typename TK, typename TR>
void module_dm::accumulate_dmr ( const DensityMatrix< TK, TR > & dm,
std::vector< hamilt::HContainer< TR > * > & dmR_out,
const std::map< ModuleBase::Vector3< int >, std::complex< double > > & phase_hybrid,
const int ik_in,
const char * func_name )
friend

◆ module_dm::add_dmr_real

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 )
friend

◆ module_dm::add_dmr_soc

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 )
friend

◆ module_dm::cal_dmr

template<typename TK, typename TR>
void module_dm::cal_dmr ( const DensityMatrix< TK, TR > & dm,
std::vector< hamilt::HContainer< TR > * > & dmR_out,
const int ik_in )
friend

◆ module_dm::cal_dmr_full

template<typename TK, typename TR>
void module_dm::cal_dmr_full ( const DensityMatrix< TK, TR > & dm,
hamilt::HContainer< std::complex< double > > * dmR_out,
const int ik_in )
friend

◆ module_dm::cal_dmr_td

template<typename TK, typename TR>
void module_dm::cal_dmr_td ( DensityMatrix< TK, TR > & dm,
std::vector< hamilt::HContainer< TR > * > & dmR_out,
const std::map< ModuleBase::Vector3< int >, std::complex< double > > & phase_hybrid,
const ModuleBase::Vector3< double > At,
const int ik_in )
friend

Member Data Documentation

◆ _dmr_ready

template<typename TK, typename TR>
bool module_dm::DensityMatrix< TK, TR >::_dmr_ready = false
private

whether dmr holds a density matrix calculated from DMK (reset by init_dmr, set by cal_dmr)

◆ _kvec_d

template<typename TK, typename TR>
const std::vector<ModuleBase::Vector3<double> > module_dm::DensityMatrix< TK, TR >::_kvec_d
private

K_Vectors object, which is used to get k-point information.

◆ _nk

template<typename TK, typename TR>
int module_dm::DensityMatrix< TK, TR >::_nk = 0
private

real number of k-points _nk is not equal to _kv->get_nks() when spin-polarization is considered _nk = kv->get_nks() / nspin when nspin=2

◆ dmk

template<typename TK, typename TR>
std::vector<std::vector<TK> > module_dm::DensityMatrix< TK, TR >::dmk
private

density matrix in k space, which is a vector[ik] DMK should be a [spin_mult][_nk][i][j] matrix, whose size is spin_mult * _nk * pv->get_nrow() * pv->get_ncol()

◆ dmr

template<typename TK, typename TR>
std::vector<hamilt::HContainer<TR>*> module_dm::DensityMatrix< TK, TR >::dmr
private

HContainer for density matrix in real space for 2D parallelization vector.size() = 1 for non-polarization and SOC vector.size() = 2 for spin-polarization.

◆ dmr_grid

template<typename TK, typename TR>
std::vector<hamilt::HContainer<TR>*> module_dm::DensityMatrix< TK, TR >::dmr_grid
private

HContainer for density matrix in real space for grid parallelization same size semantics as dmr.

◆ dmr_origin

template<typename TK, typename TR>
std::vector<TR> module_dm::DensityMatrix< TK, TR >::dmr_origin
private

temporary pointers for switch DMR, only used with nspin=2

◆ dmr_save

template<typename TK, typename TR>
std::vector<std::vector<TR> > module_dm::DensityMatrix< TK, TR >::dmr_save
private

◆ dmr_tmp

template<typename TK, typename TR>
std::vector<TR> module_dm::DensityMatrix< TK, TR >::dmr_tmp
private

◆ edmk

template<typename TK, typename TR>
std::vector<ModuleBase::ComplexMatrix> module_dm::DensityMatrix< TK, TR >::edmk

◆ nspin

template<typename TK, typename TR>
int module_dm::DensityMatrix< TK, TR >::nspin = 1
private

the global physical nspin from INPUT (1/2/4). For SOC/noncollinear (nspin==4) the density matrix is stored with spin_mult==1 (a single 2x2 spin-block matrix), but cal_dmr/cal_dmr_td must still take the spin-resolved (Pauli) branch. spin_mult cannot distinguish this, so keep the global value here. Equals spin_mult for non-SOC cases.

◆ pv

template<typename TK, typename TR>
const Parallel_Orbitals* module_dm::DensityMatrix< TK, TR >::pv = nullptr
private

Parallel_Orbitals object, which contain all information of 2D block cyclic distribution.

◆ spin_mult

template<typename TK, typename TR>
int module_dm::DensityMatrix< TK, TR >::spin_mult = 1
private

spin multiplicity used to size the density matrix (1 - none spin and SOC ; 2 - spin polarization). This is NOT the physical nspin (1/2/4); it matches K_Vectors::spin_mult.


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