10#include <RI/global/Tensor.h>
11#include <RI/ri/Cell_Nearest.h>
14template <
typename T,
typename Tdata>
20#ifndef __OPEXXTEMPLATE
21#define __OPEXXTEMPLATE
24class OperatorEXX :
public T
34template <
typename TK,
typename TR>
37 using TAC = std::pair<int, std::array<int, 3>>;
42 OperatorEXX<OperatorLCAO<TK, TR>>(HS_Matrix_K<TK>* hsk_in,
43 hamilt::HContainer<TR>* hR_in,
44 const UnitCell& ucell,
45 const K_Vectors& kv_in,
46 Exx_LRI_Interface<TK, double>* exd_in,
47 Exx_LRI_Interface<TK, std::complex<double>>* exc_in,
49 Add_Hexx_Type add_hexx_type_in = Add_Hexx_Type::R,
50 const int istep_in = 0,
51 const bool restart_in =
false);
55 OperatorEXX<OperatorLCAO<TK, TR>>(
56 HS_Matrix_K<TK>* hsk_in,
57 hamilt::HContainer<TR>* hR_in,
58 const UnitCell& ucell,
59 const K_Vectors& kv_in,
60 std::vector<std::map<int, std::map<TAC, RI::Tensor<double>>>>* Hexxd_in,
61 std::vector<std::map<int, std::map<TAC, RI::Tensor<std::complex<double>>>>>* Hexxc_in,
63 Add_Hexx_Type add_hexx_type_in);
67 virtual void contributeHk(
int ik)
override;
68 virtual void contributeHR()
override;
71 Add_Hexx_Type add_hexx_type = Add_Hexx_Type::R;
73 bool HR_fixed_done =
false;
74 bool initial_gga_done =
false;
79 Exx_LRI_Interface<TK, double>* exd =
nullptr;
80 Exx_LRI_Interface<TK, std::complex<double>>* exc =
nullptr;
82 std::vector<std::map<int, std::map<TAC, RI::Tensor<double>>>>* Hexxd =
nullptr;
83 std::vector<std::map<int, std::map<TAC, RI::Tensor<std::complex<double>>>>>* Hexxc =
nullptr;
89 const Exx_Info* exx_info_ptr =
nullptr;
93 void add_loaded_Hexx(
const int ik);
95 const UnitCell& ucell;
100 RI::Cell_Nearest<int, int, 3, double, 3> cell_nearest;
101 bool use_cell_nearest =
true;
104 std::vector<std::vector<double>> Hexxd_k_load;
105 std::vector<std::vector<std::complex<double>>> Hexxc_k_load;
108using TAC = std::pair<int, std::array<int, 3>>;
110RI::Cell_Nearest<int, int, 3, double, 3> init_cell_nearest(
const UnitCell& ucell,
const std::array<int, 3>& Rs_period);
113template <
typename Tdata,
typename TR>
114void reallocate_hcontainer(
const std::vector<std::map<
int, std::map<
TAC, RI::Tensor<Tdata>>>>& Hexxs,
116 const RI::Cell_Nearest<int, int, 3, double, 3>*
const cell_nearest =
nullptr);
119template <
typename TR>
120void reallocate_hcontainer(
const int nat,
122 const std::array<int, 3>& Rs_period,
123 const RI::Cell_Nearest<int, int, 3, double, 3>*
const cell_nearest =
nullptr);
Definition exx_lri_interface.h:43
Definition hcontainer.h:147
Definition operator_lcao.h:13
#define T
Definition exp.cpp:237
Exx_Info exx_info
Definition deepks_test_prep.cpp:22
Restart restart
Definition test_chg_init.cpp:27
std::pair< int, TC > TAC
Definition test_write_ri_cv.cpp:10