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

#include <to_qo.h>

Collaboration diagram for toQO:

Public Member Functions

 toQO (const std::string &qo_basis, const std::vector< std::string > &strategies, const double &qo_thr, const std::vector< double > &screening_coeffs)
 ~toQO ()
void initialize (const std::string &out_dir, const std::string &pseudo_dir, const std::string &orbital_dir, const UnitCell *p_ucell, const std::vector< ModuleBase::Vector3< double > > &kvecs_d, std::ofstream &ofs_running, const int &rank, const int &nranks)
void read_structures (const UnitCell *p_ucell, const std::vector< ModuleBase::Vector3< double > > &kvecs_d, const int &iproc, const int &nprocs)
void build_nao (const int ntype, const std::string orbital_dir, const std::string *const orbital_fn, const int rank)
void build_ao (const int ntype, const std::string pseudo_dir, const std::string *const pspot_fn=nullptr, const std::vector< double > screening_coeffs=std::vector< double >(), const double qo_thr=1e-10, const std::ofstream &ofs=std::ofstream(), const int rank=0)
void build_hydrogen (const int ntype, const double *const charges, const bool slater_screening, const int *const nmax, const double qo_thr, const int rank)
void build_pswfc (const int ntype, const std::string pseudo_dir, const std::string *const pspot_fn, const double *const screening_coeffs, const double qo_thr, const int rank)
void build_szv ()
void calculate ()
void calculate_ovlpR (const int iR)
void calculate_ovlpk (int ik)
template<typename T>
void write_ovlp (const std::string &dir, const std::vector< T > &matrix, const int &nrows, const int &ncols, const bool &is_R=false, const int &imat=0)
void read_ovlp (const std::string &dir, const int &nrows, const int &ncols, const bool &is_R=false, const int &imat=0)
void radialcollection_indexing (const RadialCollection &, const std::vector< int > &, const bool &, std::map< std::tuple< int, int, int, int, int >, int > &, std::map< int, std::tuple< int, int, int, int, int > > &)
 build bidirectional map indexing for one single RadialCollection object, which is an axis of two-center-integral table.
ModuleBase::Vector3< double > cal_two_center_vector (ModuleBase::Vector3< double > rij, ModuleBase::Vector3< int > R)
 calculate vectors connecting all atom pairs that needed to calculate their overlap
bool orbital_filter_out (const int &itype, const int &l, const int &izeta)
 when indexing, select where one orbital is really included in the two-center integral
void deallocate_ovlp (const bool &is_R=false)
void allocate_ovlp (const bool &is_R=false)
void zero_out_ovlps (const bool &is_R)
void append_ovlpR_eiRk (int ik, int iR)
void scan_supercell (const int &iproc, const int &nprocs)
 get all possible (n1n2n3) defining supercell and scatter if MPI enabled
std::vector< ModuleBase::Vector3< int > > scan_supercell_for_atom (int it, int ia, int start_it=0, int start_ia=0)
 this is a basic functional for scanning (ijR) pair for one certain i, return Rs
std::vector< int > rcut_to_supercell_index (double rcut, ModuleBase::Vector3< double > a, ModuleBase::Vector3< double > b, ModuleBase::Vector3< double > c)
 core algorithm to scan supercells, find the maximal supercell according to present cutoff radius
double norm2_rij_supercell (ModuleBase::Vector3< double > rij, int n1, int n2, int n3)
 get vector squared norm in supercell
template<typename T>
void eliminate_duplicate_vector3 (std::vector< ModuleBase::Vector3< T > > &vector3s)
 eliminate duplicate vectors in a vector of vector3
void write_supercells ()
 write supercells information to file
int ntype () const
int nks () const
std::string qo_basis () const
std::vector< std::string > strategies () const
std::string strategy (const int itype) const
UnitCell * p_ucell () const
RadialCollection * p_nao () const
RadialCollection * p_ao () const
int nR () const
int nchi () const
int nphi () const
std::vector< ModuleBase::Vector3< int > > supercells () const
std::vector< double > ovlpR () const
double ovlpR (const int i, const int j) const
std::vector< std::complex< double > > ovlpk () const
std::complex< double > ovlpk (const int i, const int j) const
std::vector< std::string > symbols () const
std::vector< double > charges () const
atom_in atom_database () const
std::vector< ModuleBase::Vector3< double > > kvecs_d () const

Static Public Member Functions

static void bcast_stdvector_ofvector3int (std::vector< ModuleBase::Vector3< int > > &vec, const int rank)
static void bcast_stdvector_ofvector3double (std::vector< ModuleBase::Vector3< double > > &vec, const int rank)

Private Attributes

std::string qo_basis_ = "hydrogen"
std::vector< std::string > strategies_
double qo_thr_ = 1e-10
std::vector< double > screening_coeffs_
std::string out_dir_
std::string pseudo_dir_
std::string orbital_dir_
int iproc_ = 0
int nprocs_ = 1
const UnitCell * p_ucell_ = nullptr
std::vector< int > iRs_
std::vector< ModuleBase::Vector3< int > > supercells_
std::vector< int > iks_
std::vector< ModuleBase::Vector3< double > > kvecs_d_
std::unique_ptr< RadialCollection > nao_
std::unique_ptr< RadialCollection > ao_
std::unique_ptr< TwoCenterIntegrator > overlap_calculator_
std::vector< double > ovlpR_
std::vector< std::complex< double > > ovlpk_
std::map< std::tuple< int, int, int, int, int >, int > index_ao_
std::map< int, std::tuple< int, int, int, int, int > > rindex_ao_
std::map< std::tuple< int, int, int, int, int >, int > index_nao_
std::map< int, std::tuple< int, int, int, int, int > > rindex_nao_
int nks_ = 0
int nks_tot_ = 0
int nR_ = 0
int nR_tot_ = 0
int nchi_ = 0
int nphi_ = 0
atom_in atom_database_
int ntype_ = 0
std::vector< int > na_
std::vector< std::string > symbols_
std::vector< double > charges_
std::vector< int > nmax_

Constructor & Destructor Documentation

◆ toQO()

toQO::toQO ( const std::string & qo_basis,
const std::vector< std::string > & strategies,
const double & qo_thr,
const std::vector< double > & screening_coeffs )
Here is the call graph for this function:

◆ ~toQO()

toQO::~toQO ( )

Member Function Documentation

◆ allocate_ovlp()

void toQO::allocate_ovlp ( const bool & is_R = false)
Here is the caller graph for this function:

◆ append_ovlpR_eiRk()

void toQO::append_ovlpR_eiRk ( int ik,
int iR )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atom_database()

atom_in toQO::atom_database ( ) const
inline

◆ bcast_stdvector_ofvector3double()

void toQO::bcast_stdvector_ofvector3double ( std::vector< ModuleBase::Vector3< double > > & vec,
const int rank )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bcast_stdvector_ofvector3int()

void toQO::bcast_stdvector_ofvector3int ( std::vector< ModuleBase::Vector3< int > > & vec,
const int rank )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_ao()

void toQO::build_ao ( const int ntype,
const std::string pseudo_dir,
const std::string *const pspot_fn = nullptr,
const std::vector< double > screening_coeffs = std::vector<double>(),
const double qo_thr = 1e-10,
const std::ofstream & ofs = std::ofstream(),
const int rank = 0 )

ntype

charges

slater_screening

nmax

qo_thr

rank

ntype

pseudo_dir

pspot_fn

screening_coeffs

qo_thr

rank

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

◆ build_hydrogen()

void toQO::build_hydrogen ( const int ntype,
const double *const charges,
const bool slater_screening,
const int *const nmax,
const double qo_thr,
const int rank )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_nao()

void toQO::build_nao ( const int ntype,
const std::string orbital_dir,
const std::string *const orbital_fn,
const int rank )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_pswfc()

void toQO::build_pswfc ( const int ntype,
const std::string pseudo_dir,
const std::string *const pspot_fn,
const double *const screening_coeffs,
const double qo_thr,
const int rank )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_szv()

void toQO::build_szv ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_two_center_vector()

ModuleBase::Vector3< double > toQO::cal_two_center_vector ( ModuleBase::Vector3< double > rij,
ModuleBase::Vector3< int > R )

calculate vectors connecting all atom pairs that needed to calculate their overlap

◆ calculate()

void toQO::calculate ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculate_ovlpk()

void toQO::calculate_ovlpk ( int ik)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculate_ovlpR()

void toQO::calculate_ovlpR ( const int iR)
Here is the caller graph for this function:

◆ charges()

std::vector< double > toQO::charges ( ) const
inline
Here is the caller graph for this function:

◆ deallocate_ovlp()

void toQO::deallocate_ovlp ( const bool & is_R = false)

◆ eliminate_duplicate_vector3()

template<typename T>
template void toQO::eliminate_duplicate_vector3< int > ( std::vector< ModuleBase::Vector3< T > > & vector3s)

eliminate duplicate vectors in a vector of vector3

Here is the caller graph for this function:

◆ initialize()

void toQO::initialize ( const std::string & out_dir,
const std::string & pseudo_dir,
const std::string & orbital_dir,
const UnitCell * p_ucell,
const std::vector< ModuleBase::Vector3< double > > & kvecs_d,
std::ofstream & ofs_running,
const int & rank,
const int & nranks )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kvecs_d()

std::vector< ModuleBase::Vector3< double > > toQO::kvecs_d ( ) const
inline
Here is the caller graph for this function:

◆ nchi()

int toQO::nchi ( ) const
inline

◆ nks()

int toQO::nks ( ) const
inline
Here is the caller graph for this function:

◆ norm2_rij_supercell()

double toQO::norm2_rij_supercell ( ModuleBase::Vector3< double > rij,
int n1,
int n2,
int n3 )

get vector squared norm in supercell

Returns
(rij + n1R1 + n2R2 + n3R3)^2
Here is the caller graph for this function:

◆ nphi()

int toQO::nphi ( ) const
inline

◆ nR()

int toQO::nR ( ) const
inline

◆ ntype()

int toQO::ntype ( ) const
inline
Here is the caller graph for this function:

◆ orbital_filter_out()

bool toQO::orbital_filter_out ( const int & itype,
const int & l,
const int & izeta )

when indexing, select where one orbital is really included in the two-center integral

Here is the caller graph for this function:

◆ ovlpk() [1/2]

std::vector< std::complex< double > > toQO::ovlpk ( ) const
inline

◆ ovlpk() [2/2]

std::complex< double > toQO::ovlpk ( const int i,
const int j ) const
inline

◆ ovlpR() [1/2]

std::vector< double > toQO::ovlpR ( ) const
inline

◆ ovlpR() [2/2]

double toQO::ovlpR ( const int i,
const int j ) const
inline

◆ p_ao()

RadialCollection * toQO::p_ao ( ) const
inline

◆ p_nao()

RadialCollection * toQO::p_nao ( ) const
inline

◆ p_ucell()

UnitCell * toQO::p_ucell ( ) const
inline
Here is the caller graph for this function:

◆ qo_basis()

std::string toQO::qo_basis ( ) const
inline
Here is the caller graph for this function:

◆ radialcollection_indexing()

void toQO::radialcollection_indexing ( const RadialCollection & radcol,
const std::vector< int > & natoms,
const bool & with_filter,
std::map< std::tuple< int, int, int, int, int >, int > & index_map,
std::map< int, std::tuple< int, int, int, int, int > > & index_map_reverse )

build bidirectional map indexing for one single RadialCollection object, which is an axis of two-center-integral table.

from (it,ia,l,zeta,m) to index and vice versa

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

◆ rcut_to_supercell_index()

std::vector< int > toQO::rcut_to_supercell_index ( double rcut,
ModuleBase::Vector3< double > a,
ModuleBase::Vector3< double > b,
ModuleBase::Vector3< double > c )

core algorithm to scan supercells, find the maximal supercell according to present cutoff radius

Returns
a vector of (n1n2n3) defining supercell
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_ovlp()

void toQO::read_ovlp ( const std::string & dir,
const int & nrows,
const int & ncols,
const bool & is_R = false,
const int & imat = 0 )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_structures()

void toQO::read_structures ( const UnitCell * p_ucell,
const std::vector< ModuleBase::Vector3< double > > & kvecs_d,
const int & iproc,
const int & nprocs )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ scan_supercell()

void toQO::scan_supercell ( const int & iproc,
const int & nprocs )

get all possible (n1n2n3) defining supercell and scatter if MPI enabled

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

◆ scan_supercell_for_atom()

std::vector< ModuleBase::Vector3< int > > toQO::scan_supercell_for_atom ( int it,
int ia,
int start_it = 0,
int start_ia = 0 )

this is a basic functional for scanning (ijR) pair for one certain i, return Rs

Attention
an algorithm loop over (i,)j,R, and return Rs
Returns
a vector collects (n1, n2, n3) for present atom
Here is the call graph for this function:
Here is the caller graph for this function:

◆ strategies()

std::vector< std::string > toQO::strategies ( ) const
inline
Here is the caller graph for this function:

◆ strategy()

std::string toQO::strategy ( const int itype) const
inline

◆ supercells()

std::vector< ModuleBase::Vector3< int > > toQO::supercells ( ) const
inline

◆ symbols()

std::vector< std::string > toQO::symbols ( ) const
inline

◆ write_ovlp()

template<typename T>
template void toQO::write_ovlp< double > ( const std::string & dir,
const std::vector< T > & matrix,
const int & nrows,
const int & ncols,
const bool & is_R = false,
const int & imat = 0 )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_supercells()

void toQO::write_supercells ( )

write supercells information to file

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

◆ zero_out_ovlps()

void toQO::zero_out_ovlps ( const bool & is_R)
Here is the caller graph for this function:

Member Data Documentation

◆ ao_

std::unique_ptr<RadialCollection> toQO::ao_
private

◆ atom_database_

atom_in toQO::atom_database_
private

◆ charges_

std::vector<double> toQO::charges_
private

◆ iks_

std::vector<int> toQO::iks_
private

◆ index_ao_

std::map<std::tuple<int,int,int,int,int>,int> toQO::index_ao_
private

◆ index_nao_

std::map<std::tuple<int,int,int,int,int>,int> toQO::index_nao_
private

◆ iproc_

int toQO::iproc_ = 0
private

◆ iRs_

std::vector<int> toQO::iRs_
private

◆ kvecs_d_

std::vector<ModuleBase::Vector3<double> > toQO::kvecs_d_
private

◆ na_

std::vector<int> toQO::na_
private

◆ nao_

std::unique_ptr<RadialCollection> toQO::nao_
private

◆ nchi_

int toQO::nchi_ = 0
private

◆ nks_

int toQO::nks_ = 0
private

◆ nks_tot_

int toQO::nks_tot_ = 0
private

◆ nmax_

std::vector<int> toQO::nmax_
private

◆ nphi_

int toQO::nphi_ = 0
private

◆ nprocs_

int toQO::nprocs_ = 1
private

◆ nR_

int toQO::nR_ = 0
private

◆ nR_tot_

int toQO::nR_tot_ = 0
private

◆ ntype_

int toQO::ntype_ = 0
private

◆ orbital_dir_

std::string toQO::orbital_dir_
private

◆ out_dir_

std::string toQO::out_dir_
private

◆ overlap_calculator_

std::unique_ptr<TwoCenterIntegrator> toQO::overlap_calculator_
private

◆ ovlpk_

std::vector<std::complex<double> > toQO::ovlpk_
private

◆ ovlpR_

std::vector<double> toQO::ovlpR_
private

◆ p_ucell_

const UnitCell* toQO::p_ucell_ = nullptr
private

◆ pseudo_dir_

std::string toQO::pseudo_dir_
private

◆ qo_basis_

std::string toQO::qo_basis_ = "hydrogen"
private

◆ qo_thr_

double toQO::qo_thr_ = 1e-10
private

◆ rindex_ao_

std::map<int,std::tuple<int,int,int,int,int> > toQO::rindex_ao_
private

◆ rindex_nao_

std::map<int,std::tuple<int,int,int,int,int> > toQO::rindex_nao_
private

◆ screening_coeffs_

std::vector<double> toQO::screening_coeffs_
private

◆ strategies_

std::vector<std::string> toQO::strategies_
private

◆ supercells_

std::vector<ModuleBase::Vector3<int> > toQO::supercells_
private

◆ symbols_

std::vector<std::string> toQO::symbols_
private

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