13#include <RI/global/Tensor.h>
14#include <RI/ri/Cell_Nearest.h>
27static const size_t Ndim = 3;
28using TC = std::array<Tcell, Ndim>;
29using TAC = std::pair<TA, TC>;
32template <
typename Tdata,
typename Tmatrix>
33extern std::vector<std::map<TA, std::map<TAC, RI::Tensor<Tdata>>>>
split_m2D_ktoR(
36 const std::vector<const Tmatrix*>& mks_2D,
39 const bool spgsym =
false);
41template <
typename Tdata,
typename Tmatrix>
44 const std::vector<const Tmatrix*>& mks_2D,
48template <
typename Tdata,
typename Tmatrix>
52 const std::vector<const Tmatrix*>& mks_2D,
55 const bool spgsym =
false);
58 extern std::vector<std::tuple<std::set<TA>, std::set<TA>>>
61 template<
typename Tdata,
typename TK>
67 const std::vector<std::map<
TA, std::map<
TAC, RI::Tensor<Tdata>>>>& Hs,
72 template <
typename Tdata,
typename TK>
78 const std::vector<std::map<
TA, std::map<
TAC, RI::Tensor<Tdata>>>>& Hs,
83 template<
typename Tdata,
typename TR>
85 const int current_spin,
87 const std::vector<std::map<
TA, std::map<
TAC, RI::Tensor<Tdata>>>>& Hs,
91 const RI::Cell_Nearest<int, int, 3, double, 3>*
const cell_nearest =
nullptr);
93 template<
typename Tdata>
97 const std::vector< std::map<
TA, std::map<
TAC, RI::Tensor<Tdata>>>> &Hexxs,
99 template<
typename Tdata>
102 std::deque<std::vector<std::vector<Tdata>>> &Hk_seq,
103 const std::vector<std::vector<Tdata>> &Hk_new,
104 const double mixing_beta,
105 const std::string mixing_mode);
110 extern inline int get_is_block(
const int is_k,
const int is_row_b,
const int is_col_b);
112 extern inline int get_iwt(
const UnitCell& ucell,
const int iat,
const int iw_b,
const int is_b);
114 template <
typename TA,
typename TAC,
typename T>
115 extern std::map<TA, std::map<TAC, T>>
comm_map2_first(
const MPI_Comm& mpi_comm,
116 const std::map<
TA, std::map<TAC, T>>& Ds_in,
117 const std::set<TA>& s0,
118 const std::set<TA>& s1);
119 template <
typename TA,
typename TAC,
typename T,
typename Tjudge>
120 extern std::map<TA, std::map<TAC, T>>
comm_map2(
const MPI_Comm& mpi_comm,
121 const std::map<
TA, std::map<TAC, T>>& Ds_in,
122 const Tjudge& judge);
123 template <
typename Tkey,
typename Tvalue>
124 extern void set_value_add(Tkey&& key, Tvalue&& value, std::map<Tkey, Tvalue>& data);
125 template <
typename Tkey0,
typename Tkey1,
typename Tvalue>
128 std::map<Tkey0, std::map<Tkey1, Tvalue>>& data);
129 template <
typename Tkey,
typename Tvalue>
130 extern void add_datas(std::map<Tkey, Tvalue>&& data_local, std::map<Tkey, Tvalue>& data_recv);
131 template <
typename Tkey0,
typename Tkey1,
typename Tvalue>
132 extern void add_datas(std::map<Tkey0, std::map<Tkey1, Tvalue>>&& data_local,
133 std::map<Tkey0, std::map<Tkey1, Tvalue>>& data_recv);
3 elements vector
Definition vector3.h:24
This class packs the basic information of 2D-block-cyclic parallel distribution of an arbitrary matri...
Definition parallel_2d.h:12
Definition parallel_orbitals.h:9
Definition hcontainer.h:144
Definition RI_2D_Comm.h:24
std::vector< int > get_ik_list(const K_Vectors &kv, const int is_k)
Definition RI_2D_Comm.cpp:65
std::vector< std::vector< Tdata > > pulay_mixing(const Parallel_Orbitals &pv, std::deque< std::vector< std::vector< Tdata > > > &Hk_seq, const std::vector< std::vector< Tdata > > &Hk_new, const double mixing_beta, const std::string mixing_mode)
int get_is_block(const int is_k, const int is_row_b, const int is_col_b)
Definition RI_2D_Comm.hpp:396
std::map< TA, std::map< TAC, T > > comm_map2(const MPI_Comm &mpi_comm, const std::map< TA, std::map< TAC, T > > &Ds_in, const Tjudge &judge)
Definition RI_2D_Comm.hpp:507
std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > split_m2D_ktoR_gamma(const UnitCell &ucell, const std::vector< const Tmatrix * > &mks_2D, const Parallel_2D &pv, const int nspin)
std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > split_m2D_ktoR(const UnitCell &ucell, const K_Vectors &kv, const std::vector< const Tmatrix * > &mks_2D, const Parallel_2D &pv, const int nspin, const bool spgsym=false)
int TA
Definition RI_2D_Comm.h:25
std::pair< TA, TC > TAC
Definition RI_2D_Comm.h:29
std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > split_m2D_ktoR_k(const UnitCell &ucell, const K_Vectors &kv, const std::vector< const Tmatrix * > &mks_2D, const Parallel_2D &pv, const int nspin, const bool spgsym=false)
void set_value_add(Tkey &&key, Tvalue &&value, std::map< Tkey, Tvalue > &data)
Definition RI_2D_Comm.hpp:527
void add_Hexx_td(const UnitCell &ucell, const K_Vectors &kv, const int ik, const double alpha, const std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > &Hs, const Parallel_Orbitals &pv, const ModuleBase::Vector3< double > &At, TK *hk)
Definition RI_2D_Comm.hpp:316
std::tuple< int, int > split_is_block(const int is_b)
Definition RI_2D_Comm.hpp:408
void add_HexxR(const int current_spin, const double alpha, const std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > &Hs, const Parallel_Orbitals &pv, const int npol, hamilt::HContainer< TR > &HlocR, const RI::Cell_Nearest< int, int, 3, double, 3 > *const cell_nearest=nullptr)
Definition RI_2D_Comm.hpp:445
std::tuple< int, int, int > get_iat_iw_is_block(const UnitCell &ucell, const int &iwt)
Definition RI_2D_Comm.hpp:381
std::array< Tcell, Ndim > TC
Definition RI_2D_Comm.h:28
std::map< TA, std::map< TAC, T > > comm_map2_first(const MPI_Comm &mpi_comm, const std::map< TA, std::map< TAC, T > > &Ds_in, const std::set< TA > &s0, const std::set< TA > &s1)
Definition RI_2D_Comm.hpp:495
void add_Hexx(const UnitCell &ucell, const K_Vectors &kv, const int ik, const double alpha, const std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > &Hs, const Parallel_Orbitals &pv, TK *hk)
Definition RI_2D_Comm.hpp:267
int get_iwt(const UnitCell &ucell, const int iat, const int iw_b, const int is_b)
Definition RI_2D_Comm.hpp:423
std::vector< std::tuple< std::set< TA >, std::set< TA > > > get_2D_judge(const UnitCell &ucell, const Parallel_2D &pv)
Definition RI_2D_Comm.cpp:15
void add_datas(std::map< Tkey, Tvalue > &&data_local, std::map< Tkey, Tvalue > &data_recv)
Definition RI_2D_Comm.hpp:546
std::vector< std::vector< Tdata > > Hexxs_to_Hk(const K_Vectors &kv, const Parallel_Orbitals &pv, const std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > &Hexxs, const int ik)
int Tcell
Definition RI_2D_Comm.h:26