ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
OccupationMatrix Class Reference

On-site occupation matrices for DFT+U. More...

#include <occ_matrix.h>

Collaboration diagram for OccupationMatrix:

Public Member Functions

void init (const UnitCell &cell, const std::vector< int > &l_channel, int nspin, int npol)
 allocate occ/occ_save/corr_iwt according to the cell
double get (int iat, int l, int spin, int m1, int m2) const
double get_save (int iat, int l, int spin, int m1, int m2) const
void set (int iat, int l, int spin, int m1, int m2, double val)
ModuleBase::matrix & mat (int iat, int l, int spin)
 direct matrix access for kernels that operate on whole blocks
const ModuleBase::matrix & mat (int iat, int l, int spin) const
ModuleBase::matrix & mat_save (int iat, int l, int spin)
const ModuleBase::matrix & mat_save (int iat, int l, int spin) const
std::vector< std::vector< std::vector< ModuleBase::matrix > > > & data ()
const std::vector< std::vector< std::vector< ModuleBase::matrix > > > & data () const
std::vector< std::vector< std::vector< ModuleBase::matrix > > > & data_save ()
const std::vector< std::vector< std::vector< ModuleBase::matrix > > > & data_save () const
int corr_iwt (int iat, int l, int m, int ipol) const
void get_flat (int iat, int l, std::vector< double > &occ) const
void set_flat (int iat, int l, int spin, const std::vector< double > &occ)
void zero (const UnitCell &cell, const std::vector< int > &l_channel)
void copy_to_save (const UnitCell &cell, const std::vector< int > &l_channel)
void write_to_flat (const UnitCell &cell, const std::vector< int > &l_channel, const std::vector< int > &index, std::vector< double > &uom) const
 write occ into uom at offsets given by index (split spin layout)
void read_from_flat (const UnitCell &cell, const std::vector< int > &l_channel, const std::vector< int > &index, const std::vector< double > &uom)
 read occ from uom at offsets given by index (split spin layout)
void write_save_to_flat (const UnitCell &cell, const std::vector< int > &l_channel, const std::vector< int > &index, std::vector< double > &uom_save) const
 write occ_save into uom_save (skips when uom_save is empty)
int nspin () const
int npol () const

Private Member Functions

void allocate_atom_matrices (const UnitCell &cell, int iat, int it)
 allocate occ_ and occ_save_ matrices for one atom
void build_corr_iwt (const UnitCell &cell, int iat, int ia)

Private Attributes

std::vector< std::vector< std::vector< ModuleBase::matrix > > > occ_
std::vector< std::vector< std::vector< ModuleBase::matrix > > > occ_save_
std::vector< std::vector< std::vector< std::vector< int > > > > corr_iwt_
int nspin_ = 0
int npol_ = 0

Detailed Description

On-site occupation matrices for DFT+U.

Owns the nested occ[iat][l][spin] matrices together with their saved copy (used by mixing) and the corr_iwt[iat][l][m][ipol] lookup table mapping the correlated orbital (first radial channel) to its global orbital index iwt. Layout: nspin=1/2: occ[iat][l] has 2 spin channels of (2l+1)x(2l+1) nspin=4: occ[iat][l] has 1 channel of (2l+1)*npol x (2l+1)*npol (all Pauli blocks packed together)

Member Function Documentation

◆ allocate_atom_matrices()

void OccupationMatrix::allocate_atom_matrices ( const UnitCell & cell,
int iat,
int it )
private

allocate occ_ and occ_save_ matrices for one atom

Here is the caller graph for this function:

◆ build_corr_iwt()

void OccupationMatrix::build_corr_iwt ( const UnitCell & cell,
int iat,
int ia )
private

build corr_iwt_ mapping from the first radial channel to the global orbital index for one atom

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

◆ copy_to_save()

void OccupationMatrix::copy_to_save ( const UnitCell & cell,
const std::vector< int > & l_channel )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ corr_iwt()

int OccupationMatrix::corr_iwt ( int iat,
int l,
int m,
int ipol ) const
inline

global orbital index of the correlated orbital (first radial channel) of atom iat. Only the correlated channel is stored.

◆ data() [1/2]

std::vector< std::vector< std::vector< ModuleBase::matrix > > > & OccupationMatrix::data ( )
inline
Here is the caller graph for this function:

◆ data() [2/2]

const std::vector< std::vector< std::vector< ModuleBase::matrix > > > & OccupationMatrix::data ( ) const
inline

◆ data_save() [1/2]

std::vector< std::vector< std::vector< ModuleBase::matrix > > > & OccupationMatrix::data_save ( )
inline
Here is the caller graph for this function:

◆ data_save() [2/2]

const std::vector< std::vector< std::vector< ModuleBase::matrix > > > & OccupationMatrix::data_save ( ) const
inline

◆ get()

double OccupationMatrix::get ( int iat,
int l,
int spin,
int m1,
int m2 ) const
inline
Here is the caller graph for this function:

◆ get_flat()

void OccupationMatrix::get_flat ( int iat,
int l,
std::vector< double > & occ ) const

nspin=1: fills occ with occ[iat][l][0] data nspin=2: fills occ with interleaved spin-up then spin-down data nspin=4: fills occ with occ[iat][l][0] data (all Pauli blocks)

◆ get_save()

double OccupationMatrix::get_save ( int iat,
int l,
int spin,
int m1,
int m2 ) const
inline

◆ init()

void OccupationMatrix::init ( const UnitCell & cell,
const std::vector< int > & l_channel,
int nspin,
int npol )

allocate occ/occ_save/corr_iwt according to the cell

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

◆ mat() [1/2]

ModuleBase::matrix & OccupationMatrix::mat ( int iat,
int l,
int spin )
inline

direct matrix access for kernels that operate on whole blocks

Here is the caller graph for this function:

◆ mat() [2/2]

const ModuleBase::matrix & OccupationMatrix::mat ( int iat,
int l,
int spin ) const
inline

◆ mat_save() [1/2]

ModuleBase::matrix & OccupationMatrix::mat_save ( int iat,
int l,
int spin )
inline

◆ mat_save() [2/2]

const ModuleBase::matrix & OccupationMatrix::mat_save ( int iat,
int l,
int spin ) const
inline

◆ npol()

int OccupationMatrix::npol ( ) const
inline
Here is the caller graph for this function:

◆ nspin()

int OccupationMatrix::nspin ( ) const
inline
Here is the caller graph for this function:

◆ read_from_flat()

void OccupationMatrix::read_from_flat ( const UnitCell & cell,
const std::vector< int > & l_channel,
const std::vector< int > & index,
const std::vector< double > & uom )

read occ from uom at offsets given by index (split spin layout)

Here is the caller graph for this function:

◆ set()

void OccupationMatrix::set ( int iat,
int l,
int spin,
int m1,
int m2,
double val )
inline
Here is the caller graph for this function:

◆ set_flat()

void OccupationMatrix::set_flat ( int iat,
int l,
int spin,
const std::vector< double > & occ )

◆ write_save_to_flat()

void OccupationMatrix::write_save_to_flat ( const UnitCell & cell,
const std::vector< int > & l_channel,
const std::vector< int > & index,
std::vector< double > & uom_save ) const

write occ_save into uom_save (skips when uom_save is empty)

Here is the caller graph for this function:

◆ write_to_flat()

void OccupationMatrix::write_to_flat ( const UnitCell & cell,
const std::vector< int > & l_channel,
const std::vector< int > & index,
std::vector< double > & uom ) const

write occ into uom at offsets given by index (split spin layout)

Here is the caller graph for this function:

◆ zero()

void OccupationMatrix::zero ( const UnitCell & cell,
const std::vector< int > & l_channel )
Here is the caller graph for this function:

Member Data Documentation

◆ corr_iwt_

std::vector<std::vector<std::vector<std::vector<int> > > > OccupationMatrix::corr_iwt_
private

◆ npol_

int OccupationMatrix::npol_ = 0
private

◆ nspin_

int OccupationMatrix::nspin_ = 0
private

◆ occ_

std::vector<std::vector<std::vector<ModuleBase::matrix> > > OccupationMatrix::occ_
private

◆ occ_save_

std::vector<std::vector<std::vector<ModuleBase::matrix> > > OccupationMatrix::occ_save_
private

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