ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
dftu_nao_ijr.h File Reference
#include "source_base/parallel_reduce.h"
#include "source_basis/module_ao/parallel_orbitals.h"
#include "source_cell/module_neighbor/sltk_grid_driver.h"
#include "source_cell/unitcell.h"
#include "source_hamilt/module_hcontainer/hcontainer.h"
#include "source_pw/module_pwdft/dftu_base.h"
#include <cassert>
#include <cmath>
#include <complex>
#include <unordered_map>
#include <vector>
Include dependency graph for dftu_nao_ijr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  DFTU_LCAO

Typedefs

using DFTU_LCAO::NlmTot = std::vector<std::vector<std::unordered_map<int, std::vector<double>>>>

Functions

void DFTU_LCAO::load_occ_from_file (const Plus_U_Base &dftu, const int iat0, const int target_L, const int nspin, const int current_spin, std::vector< double > &occ)
 load the flattened occupation matrix of one Hubbard atom from pre-read occ_mat data.
template<typename TR>
void DFTU_LCAO::cal_hr_ijr (const int iat1, const int iat2, const int npol, const Parallel_Orbitals &pv, const std::unordered_map< int, std::vector< double > > &nlm1_all, const std::unordered_map< int, std::vector< double > > &nlm2_all, const std::vector< TR > &pot_onsite, TR *data_pointer)
 accumulate one real-space HR atom-pair block for DFT+U: HR += <psi_I|beta_m> * pot_onsite(m,m') * <beta_m'|psi_{J,R}>
void DFTU_LCAO::cal_occ_ijr (const int iat1, const int iat2, const int npol, const Parallel_Orbitals &pv, const std::unordered_map< int, std::vector< double > > &nlm1_all, const std::unordered_map< int, std::vector< double > > &nlm2_all, const double *dm_pointer, std::vector< double > &occ)
 accumulate one atom-pair contribution to the DFT+U occupation matrix: occ_mm' += sum_R DMR(I,J,R) * <phi_0|alpha^I_m> * <alpha^J_m'|phi_R>
template<typename Body>
void DFTU_LCAO::for_adj_pair (const UnitCell &ucell, const int iat0, const AdjacentAtomInfo &adjs, const NlmTot &nlm_tot, Body &&body)
 walk all (ad1, ad2) adjacent-atom pairs of one Hubbard atom iat0 and invoke body for each pair that has a matching matrix block.
template<typename TR>
void DFTU_LCAO::accumulate_hr_for_iat0 (const UnitCell &ucell, hamilt::HContainer< TR > *hR, const NlmTot &nlm_tot, const int iat0, const AdjacentAtomInfo &adjs, const Parallel_Orbitals &pv, const std::vector< TR > &pot_onsite)
 accumulate the real-space HR contributions of one Hubbard atom (iat0) from the precomputed pot_onsite: HR(I,J,R) += <phi_I|chi_m> pot_onsite(m,m') <chi_m'|phi_{J,R}>
void DFTU_LCAO::compute_occ_from_dmr (const UnitCell &ucell, Plus_U_Base &dftu, const int iat0, const int target_L, const int current_spin, const int nspin, const AdjacentAtomInfo &adjs, const Parallel_Orbitals &pv, const NlmTot &nlm_tot, const hamilt::HContainer< double > &dmR_current, std::vector< double > &occ)
 compute the occupation matrix of one Hubbard atom (iat0) from the real-space density matrix: occ(m,m') = sum_R DMR(I,J,R) * <phi_0|chi_m(I)> * <chi_m'(J)|phi_R> then MPI-Allreduce it and store it into the Plus_U occupation matrix.