|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
On-site occupation matrices for DFT+U. More...
#include <occ_matrix.h>
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 |
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)
|
private |
allocate occ_ and occ_save_ matrices for one atom
|
private |
build corr_iwt_ mapping from the first radial channel to the global orbital index for one atom
| void OccupationMatrix::copy_to_save | ( | const UnitCell & | cell, |
| const std::vector< int > & | l_channel ) |
|
inline |
global orbital index of the correlated orbital (first radial channel) of atom iat. Only the correlated channel is stored.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| 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)
|
inline |
| 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
|
inline |
direct matrix access for kernels that operate on whole blocks
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| 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)
|
inline |
| void OccupationMatrix::set_flat | ( | int | iat, |
| int | l, | ||
| int | spin, | ||
| const std::vector< double > & | occ ) |
| 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)
| 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)
| void OccupationMatrix::zero | ( | const UnitCell & | cell, |
| const std::vector< int > & | l_channel ) |
|
private |
|
private |
|
private |
|
private |
|
private |