Skip to content

Commit 6208db9

Browse files
committed
1. remove LRI::cal_loop4()
1 parent 5877a58 commit 6208db9

28 files changed

+791
-221
lines changed

include/RI/physics/Exx.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ class Exx
6666
const std::array<std::array<std::map<TA, std::map<TAC, Tensor<Tdata>>>,Npos>,Npos> &dVRs,
6767
const Tdata_real &threshold_dVR,
6868
const std::string &save_name_suffix="");
69-
void set_csm_threshold(
70-
const Tdata_real &threshold) { this->lri.csm.set_threshold(threshold); }
7169

7270
void cal_Hs(
7371
const std::array<std::string,3> &save_names_suffix={"","",""}); // "Cs","Vs","Ds"

include/RI/physics/Exx.hpp

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ void Exx<TA,Tcell,Ndim,Tdata>::cal_Hs(
202202
}
203203

204204
std::vector<std::map<TA, std::map<TAC, Tensor<Tdata>>>> Hs_vec(1);
205-
this->lri.coefficients = {nullptr};
206205
this->lri.cal_loop3(
207206
{Label::ab_ab::a0b0_a1b1,
208207
Label::ab_ab::a0b0_a1b2,
@@ -317,92 +316,6 @@ void Exx<TA,Tcell,Ndim,Tdata>::cal_force(
317316
}
318317

319318

320-
/*
321-
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
322-
void Exx<TA,Tcell,Ndim,Tdata>::cal_stress(
323-
const std::array<std::string,5> &save_names_suffix) // "Cs","Vs","Ds","dCs","dVs"
324-
{
325-
assert(this->flag_finish.stru);
326-
assert(this->flag_finish.C);
327-
assert(this->flag_finish.V);
328-
assert(this->flag_finish.D);
329-
assert(this->flag_finish.dC);
330-
assert(this->flag_finish.dV);
331-
332-
Cell_Nearest<TA,Tcell,Ndim,Tpos,Npos> cell_nearest;
333-
cell_nearest.init(this->atoms_pos, this->latvec, this->period);
334-
335-
using namespace Array_Operator;
336-
auto get_delta_pos = [this, &cell_nearest](
337-
const TA &Ax, const TA &Ay, const std::array<Tcell,Ndim> &celly, const std::size_t &ipos1)
338-
-> Tpos
339-
{
340-
Tpos delta_pos = this->atoms_pos[Ay][ipos1] - this->atoms_pos[Ax][ipos1];
341-
const std::array<Tcell,Ndim> celly_nearest = cell_nearest.get_cell_nearest_discrete(Ax, Ay, celly);
342-
for(std::size_t idim=0; idim<Ndim; ++idim)
343-
delta_pos += celly_nearest[idim] * this->latvec[idim][ipos1];
344-
return delta_pos;
345-
};
346-
347-
this->stress = Tensor<Tdata>({Npos, Npos});
348-
349-
this->lri.data_ab_name[Label::ab::a1b1] = this->lri.data_ab_name[Label::ab::a2b1] = "Ds_"+save_names_suffix[2];
350-
for(std::size_t ipos0=0; ipos0<Npos; ++ipos0)
351-
{
352-
std::vector<std::map<TA,std::map<TAC,Tensor<Tdata>>>> dHs_vec(Npos);
353-
this->lri.coefficients.resize(Npos);
354-
355-
this->lri.data_ab_name[Label::ab::a ] = "dCs_"+std::to_string(ipos0)+"_"+save_names_suffix[3];
356-
this->lri.data_ab_name[Label::ab::a0b0] = "Vs_"+save_names_suffix[1];
357-
this->lri.data_ab_name[Label::ab::b ] = "Cs_"+save_names_suffix[0];
358-
359-
for(std::size_t ipos1=0; ipos1<Npos; ++ipos1)
360-
this->lri.coefficients[ipos1] =
361-
[this,ipos1,&get_delta_pos](
362-
const Label::ab_ab &label, const TA &Aa01, const TAC &Aa2, const TAC &Ab01, const TAC &Ab2) -> Tdata
363-
{ return get_delta_pos(Aa01, Aa2.first, Aa2.second, ipos1); };
364-
365-
this->lri.cal(
366-
{Label::ab_ab::a0b0_a1b1,
367-
Label::ab_ab::a0b0_a2b1},
368-
dHs_vec);
369-
370-
this->lri.data_ab_name[Label::ab::a ] = "Cs_"+save_names_suffix[0];
371-
this->lri.data_ab_name[Label::ab::a0b0] = "dVs_"+std::to_string(ipos0)+"_"+save_names_suffix[4];
372-
373-
for(std::size_t ipos1=0; ipos1<Npos; ++ipos1)
374-
this->lri.coefficients[ipos1] =
375-
[this,ipos1,&get_delta_pos](
376-
const Label::ab_ab &label, const TA &Aa01, const TAC &Aa2, const TAC &Ab01, const TAC &Ab2) -> Tdata
377-
{ return get_delta_pos(Aa01, Ab01.first, Ab01.second, ipos1); };
378-
379-
this->lri.cal(
380-
{Label::ab_ab::a0b0_a1b1,
381-
Label::ab_ab::a0b0_a2b1},
382-
dHs_vec);
383-
384-
this->lri.data_ab_name[Label::ab::a0b0] = "Vs_"+save_names_suffix[1];
385-
this->lri.data_ab_name[Label::ab::b ] = "dCs_"+std::to_string(ipos0)+"_"+save_names_suffix[3];
386-
387-
for(std::size_t ipos1=0; ipos1<Npos; ++ipos1)
388-
this->lri.coefficients[ipos1] =
389-
[this,ipos1,&get_delta_pos](
390-
const Label::ab_ab &label, const TA &Aa01, const TAC &Aa2, const TAC &Ab01, const TAC &Ab2) -> Tdata
391-
{ return get_delta_pos(Ab01.first, Ab2.first, (Ab2.second-Ab01.second)%this->period, ipos1); };
392-
393-
this->lri.cal(
394-
{Label::ab_ab::a0b0_a1b1,
395-
Label::ab_ab::a0b0_a2b1},
396-
dHs_vec);
397-
398-
for(std::size_t ipos1=0; ipos1<Npos; ++ipos1)
399-
this->stress(ipos0,ipos1) = post_2D.cal_energy(
400-
this->post_2D.saves["Ds_"+save_names_suffix[2]],
401-
this->post_2D.set_tensors_map2(dHs_vec[ipos1]));
402-
}
403-
}
404-
*/
405-
406319

407320
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
408321
void Exx<TA,Tcell,Ndim,Tdata>::cal_stress(

include/RI/physics/GW.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ class G0W0
3737
void set_Cs(
3838
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Cs,
3939
const Tdata_real &threshold_C);
40-
void set_csm_threshold(
41-
const Tdata_real &threshold) { this->lri.csm.set_threshold(threshold); }
4240

4341
void cal_Sigc(
4442
const std::map<TA, std::map<TAC, Tensor<Tdata>>> gf_tau,

include/RI/physics/GW.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ void G0W0<TA, Tcell, Ndim, Tdata>::cal_Sigc(
6565
{{"threshold_filter", threshold_W}} );
6666

6767
std::vector<std::map<TA, std::map<TAC, Tensor<Tdata>>>> Sigc_vec(1);
68-
this->lri.coefficients = {nullptr};
6968
this->lri.cal_loop3(
7069
{Label::ab_ab::a0b0_a1b1,
7170
Label::ab_ab::a0b0_a1b2,

include/RI/physics/RPA.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class RPA
3333
void set_Cs(
3434
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Cs,
3535
const Tdata_real &threshold_C);
36-
void set_csm_threshold(const Tdata_real &threshold){ this->lri.csm.set_threshold(threshold); }
3736

3837
void cal_chi0s(
3938
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Gs_tau_positive,

include/RI/physics/RPA.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ void RPA<TA,Tcell,Ndim,Tdata>::cal_chi0s(
6868
};
6969

7070
std::vector<std::map<TA,std::map<TAC,Tensor<Tdata>>>> chi0s_vec(1);
71-
this->lri.coefficients = {nullptr};
7271

7372
set_Gs_a1(Gs_tau_positive);
7473
set_Gs_a2(Gs_tau_negative);

include/RI/ri/Data_Pack.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#pragma once
77

88
#include "../global/Tensor.h"
9-
#include "CS_Matrix.h"
109
#include "../global/Global_Func-1.h"
1110

1211
#include <vector>
@@ -24,7 +23,6 @@ struct Data_Pack
2423

2524
std::map<TA, std::map<TAC, Tensor<Tdata>>> Ds_ab; // Ds_ab[A0][{A1,C1}]
2625
std::vector<std::set<TA>> index_Ds_ab; // index_Ds_ab[0]=A1
27-
typename CS_Matrix<TA,TC,Tdata_real>::Uplimits csm_uplimits;
2826
};
2927

3028

include/RI/ri/LRI-set.hpp

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "LRI.h"
99
#include "RI_Tools.h"
1010
#include "Label_Tools.h"
11-
#include "CS_Matrix.h"
1211
#include "../global/Map_Operator.h"
1312
#include <algorithm>
1413

@@ -30,46 +29,6 @@ void LRI<TA,Tcell,Ndim,Tdata>::set_parallel(
3029
Label_Tools::to_Aab_Aab_set(labels_all));
3130
}
3231

33-
/*
34-
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
35-
void LRI<TA,Tcell,Ndim,Tdata>::set_tensors_map2(
36-
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Ds_local,
37-
const Label::ab &label,
38-
const std::map<std::string, double> &para_in,
39-
const std::string &save_name_in)
40-
{
41-
const std::map<std::string, double> para_default = {
42-
{"flag_period", true},
43-
{"flag_comm", true},
44-
{"flag_filter", true},
45-
{"threshold_filter", 0.0}};
46-
const std::map<std::string, double> para = Map_Operator::cover(para_default, para_in);
47-
48-
const std::string save_name =
49-
save_name_in=="default"
50-
? Label_Tools::get_name(label)
51-
: save_name_in;
52-
this->data_ab_name[label] = save_name;
53-
54-
std::map<TA, std::map<TAC, Tensor<Tdata>>> Ds_new =
55-
para.at("flag_period")
56-
? RI_Tools::cal_period(Ds_local, this->period)
57-
: Ds_local;
58-
59-
if(para.at("flag_comm"))
60-
Ds_new = this->parallel->comm_tensors_map2(label, std::move(Ds_new));
61-
62-
if(para.at("flag_filter"))
63-
Ds_new = RI_Tools::filter(std::move(Ds_new), filter_funcs[label], para.at("threshold_filter"));
64-
65-
this->data_pool[save_name].Ds_ab = std::move(Ds_new);
66-
67-
this->data_pool[save_name].index_Ds_ab = RI_Tools::get_index(this->data_pool[save_name].Ds_ab);
68-
69-
this->data_pool[save_name].csm_uplimits = this->csm.cal_uplimits(label, this->data_pool[save_name].Ds_ab);
70-
}
71-
*/
72-
7332
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
7433
void LRI<TA,Tcell,Ndim,Tdata>::set_tensors_map2(
7534
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Ds_local,
@@ -110,56 +69,6 @@ void LRI<TA,Tcell,Ndim,Tdata>::set_tensors_map2(
11069
this->data_pool[save_name].Ds_ab = std::move(Ds_new);
11170

11271
this->data_pool[save_name].index_Ds_ab = RI_Tools::get_index(this->data_pool[save_name].Ds_ab);
113-
114-
this->data_pool[save_name].csm_uplimits = this->csm.cal_uplimits(label_list, this->data_pool[save_name].Ds_ab);
115-
}
116-
117-
/*
118-
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
119-
void RI<TA,Tcell,Ndim,Tdata>::set_tensors_map3(
120-
const std::map<TA, std::map<TAC, std::map<TAC, Tensor<Tdata>>>> &Ds_local,
121-
const Label::ab &label,
122-
const Tdata_real &threshold)
123-
{
124-
if(label==Label::ab::a)
125-
{
126-
//this->Ds_ab[label] = Communicate::communicate(Ds_ab, threshold);
127-
if(threshold)
128-
this->Ds_a = LRI::filter(Ds_local, filter_func, threshold);
129-
else
130-
this->Ds_a = Ds_local;
131-
//this->cs_matrix.set_tensor2(this->Ds_ab[label], label);
132-
}
133-
else if(label==Label::ab::b)
134-
{
135-
//this->Ds_ab[label] = Communicate::communicate(Ds_ab, threshold);
136-
if(threshold)
137-
this->Ds_b = LRI::filter(Ds_local, filter_func, threshold);
138-
else
139-
this->Ds_b = Ds_local;
140-
//this->cs_matrix.set_tensor2(this->Ds_ab[label], label);
141-
}
142-
}
143-
*/
144-
145-
146-
/*
147-
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
148-
std::map<TA,std::map<TAC,std::map<TAC,Tensor<Tdata>>>>
149-
RI<TA,Tcell,Ndim,Tdata>::comm_tensors_map3(
150-
const Label::ab &label,
151-
const std::map<TA,std::map<TAC,Tensor<Tdata>>> &Ds) const
152-
{
153-
switch(label)
154-
{
155-
case Label::ab:a:
156-
return Map3(this->mpi_comm, Ds, this->list_Aa0(), this->list_Aa1(), this->list_Aa2());
157-
case Label::ab:b:
158-
return Map3_period(this->mpi_comm, Ds, this->list_Ab0(), this->list_Ab1(), this->list_Ab2());
159-
default:
160-
throw std::invalid_argument(std::string(__FILE__)+" line "+std::to_string(__LINE__));
161-
}
16272
}
163-
*/
16473

16574
}

include/RI/ri/LRI.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "Label.h"
1010
#include "../global/Tensor.h"
1111
#include "Data_Pack.h"
12-
#include "CS_Matrix.h"
1312
#include "../parallel/Parallel_LRI_Equally.h"
1413
#include "RI_Tools.h"
1514
#include "../global/Global_Func-2.h"
@@ -45,11 +44,6 @@ class LRI
4544
const std::array<Tcell,Ndim> &period_in,
4645
const std::vector<Label::ab_ab> &labels_all_in);
4746

48-
// void set_tensors_map2(
49-
// const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Ds_local,
50-
// const Label::ab &label,
51-
// const std::map<std::string, double> &para_in = {},
52-
// const std::string &save_name_in = "default");
5347
void set_tensors_map2(
5448
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Ds_local,
5549
const std::vector<Label::ab> &label_list,
@@ -61,14 +55,7 @@ class LRI
6155
// "flag_filter", true
6256
// "threshold_filter", 0.0
6357
// save_name: Label_Tools::get_name(label)
64-
//void set_tensors_map3(
65-
// const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Ds_local,
66-
// const std::string &label,
67-
// const Tdata &threshold);
6858

69-
void cal_loop4(
70-
const std::vector<Label::ab_ab> &lables,
71-
std::vector<std::map<TA, std::map<TAC, Tensor<Tdata>>>> &Ds_result);
7259
void cal_loop3(
7360
const std::vector<Label::ab_ab> &labels,
7461
std::vector<std::map<TA, std::map<TAC, Tensor<Tdata>>>> &Ds_result,
@@ -79,9 +66,6 @@ class LRI
7966
parallel = std::make_shared<Parallel_LRI_Equally<TA,Tcell,Ndim,Tdata>>();
8067
std::unordered_map< Label::ab, RI_Tools::T_filter_func<Tdata> >
8168
filter_funcs;
82-
std::vector<std::function<Tdata (const Label::ab_ab &label, const TA &Aa01, const TAC &Aa2, const TAC &Ab01, const TAC &Ab2)>>
83-
coefficients = {nullptr};
84-
CS_Matrix<TA,TC,Tdata_real> csm;
8569

8670
public: // private:
8771
TC period;
@@ -99,15 +83,10 @@ class LRI
9983
std::unordered_map<Label::ab_ab, Tdata_real> &Ds_b01_csm,
10084
LRI_Cal_Tools<TA,TC,Tdata> &tools)>;
10185
std::unordered_map<Label::ab_ab, T_cal_func> cal_funcs;
102-
void set_cal_funcs_b01();
103-
void set_cal_funcs_bx2();
10486
};
10587

10688
}
10789

10890
#include "LRI.hpp"
10991
#include "LRI-set.hpp"
110-
#include "LRI-cal-loop4.hpp"
111-
#include "LRI-cal-loop4-b01.hpp"
112-
#include "LRI-cal-loop4-bx2.hpp"
11392
#include "LRI-cal_loop3.hpp"

include/RI/ri/LRI.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ LRI<TA,Tcell,Ndim,Tdata>::LRI()
2626

2727
for(std::size_t i=0; i<Ndim; ++i)
2828
this->period[i] = std::numeric_limits<Tcell>::max()/4; // /4 for not out of range when Array_Operator::operator%
29-
30-
this->set_cal_funcs_b01();
31-
this->set_cal_funcs_bx2();
3229
}
3330

3431
}

0 commit comments

Comments
 (0)