Skip to content

Commit dd78eef

Browse files
committed
delete the test for exx in esolver_ks_lcao.cpp, after_scf(
1 parent 178f039 commit dd78eef

File tree

4 files changed

+10
-84
lines changed

4 files changed

+10
-84
lines changed

source/Makefile.Objects

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,4 +736,3 @@ OBJS_TENSOR=tensor.o\
736736

737737
OBJS_RDMFT=rdmft.o\
738738
rdmft_tools.o\
739-
rdmft_test.o\

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,73 +1248,6 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(const int istep)
12481248
// rdmft, added by jghan, 2024-10-17
12491249
if ( PARAM.inp.ab_initio_type == "rdmft" )
12501250
{
1251-
#ifdef __EXX
1252-
if( GlobalC::exx_info.info_global.cal_exx )
1253-
{
1254-
UnitCell* ucell = this->rdmft_solver.ucell;
1255-
bool exx_spacegroup_symmetry = (PARAM.inp.nspin < 4 && ModuleSymmetry::Symmetry::symm_flag == 1);
1256-
1257-
// get the current DM
1258-
elecstate::DensityMatrix<TK, double> DM_test(&this->pv, PARAM.inp.nspin, this->kv.kvec_d, this->rdmft_solver.nk_total);
1259-
elecstate::cal_dm_psi(&this->pv, this->pelec->wg, *(this->psi), DM_test);
1260-
DM_test.init_DMR(&GlobalC::GridD, &GlobalC::ucell);
1261-
DM_test.cal_DMR();
1262-
1263-
std::vector< std::vector<TK> > DM_XC_test = DM_test.get_DMK_vector();
1264-
ModuleSymmetry::Symmetry_rotation symrot_exx;
1265-
if( exx_spacegroup_symmetry )
1266-
{
1267-
const std::array<int, 3> period = RI_Util::get_Born_vonKarmen_period(this->kv);
1268-
symrot_exx.find_irreducible_sector(ucell->symm, ucell->atoms, ucell->st,
1269-
RI_Util::get_Born_von_Karmen_cells(period), period, ucell->lat);
1270-
symrot_exx.cal_Ms(this->kv, *ucell, this->pv);
1271-
1272-
// get DM_XC of all k points
1273-
DM_XC_test = symrot_exx.restore_dm(*this->rdmft_solver.kv, DM_XC_test, this->pv); // class vector could be auto resize()
1274-
}
1275-
1276-
std::vector< const std::vector<TK>* > DM_pointer(DM_XC_test.size());
1277-
for(int ik=0; ik<DM_XC_test.size(); ++ik) DM_pointer[ik] = &(DM_XC_test[ik]);
1278-
1279-
// convert format and update exx
1280-
if (GlobalC::exx_info.info_ri.real_number)
1281-
{
1282-
std::vector<std::map<int,std::map<std::pair<int,std::array<int,3>>,RI::Tensor<double>>>>
1283-
Ds_d = std::is_same<TK, double>::value //gamma_only_local
1284-
? RI_2D_Comm::split_m2D_ktoR<double>(this->kv, DM_pointer, this->pv, PARAM.inp.nspin)
1285-
: RI_2D_Comm::split_m2D_ktoR<double>(this->kv, DM_pointer, this->pv, PARAM.inp.nspin, exx_spacegroup_symmetry);
1286-
1287-
if (exx_spacegroup_symmetry && GlobalC::exx_info.info_global.exx_symmetry_realspace)
1288-
{
1289-
this->exx_lri_double->cal_exx_elec(Ds_d, this->pv, &symrot_exx);
1290-
}
1291-
else
1292-
{
1293-
this->exx_lri_double->cal_exx_elec(Ds_d, this->pv);
1294-
}
1295-
1296-
this->pelec->f_en.exx = this->exx_lri_double->Eexx;
1297-
}
1298-
else
1299-
{
1300-
std::vector<std::map<int,std::map<std::pair<int,std::array<int,3>>,RI::Tensor<std::complex<double>>>>>
1301-
Ds_c = std::is_same<TK, double>::value //gamma_only_local
1302-
? RI_2D_Comm::split_m2D_ktoR<std::complex<double>>(this->kv, DM_pointer, this->pv, PARAM.inp.nspin)
1303-
: RI_2D_Comm::split_m2D_ktoR<std::complex<double>>(this->kv, DM_pointer, this->pv, PARAM.inp.nspin, exx_spacegroup_symmetry);
1304-
1305-
if (exx_spacegroup_symmetry && GlobalC::exx_info.info_global.exx_symmetry_realspace)
1306-
{
1307-
this->exx_lri_complex->cal_exx_elec(Ds_c, this->pv, &symrot_exx);
1308-
}
1309-
else
1310-
{
1311-
this->exx_lri_complex->cal_exx_elec(Ds_c, this->pv);
1312-
}
1313-
1314-
this->pelec->f_en.exx = this->exx_lri_complex->Eexx;
1315-
}
1316-
}
1317-
#endif
13181251
ModuleBase::matrix occ_number_ks(this->pelec->wg);
13191252
for(int ik=0; ik < occ_number_ks.nr; ++ik)
13201253
{

source/module_rdmft/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if(ENABLE_LCAO)
44
OBJECT
55
rdmft.cpp
66
rdmft_tools.cpp
7-
rdmft_test.cpp
87
)
98
endif()
109

source/module_rdmft/rdmft.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,17 @@ void RDMFT<TK, TR>::init(Gint_Gamma& GG_in, Gint_k& GK_in, Parallel_Orbitals& Pa
191191
// HR_local->set_zero();
192192

193193
#ifdef __EXX
194-
exx_spacegroup_symmetry = (PARAM.inp.nspin < 4 && ModuleSymmetry::Symmetry::symm_flag == 1);
195-
if (exx_spacegroup_symmetry)
196-
{
197-
const std::array<int, 3>& period = RI_Util::get_Born_vonKarmen_period(*kv);
198-
this->symrot_exx.find_irreducible_sector(ucell->symm, ucell->atoms, ucell->st,
199-
RI_Util::get_Born_von_Karmen_cells(period), period, ucell->lat);
200-
this->symrot_exx.cal_Ms(*kv, *ucell, *ParaV);
201-
}
202-
203194
if( GlobalC::exx_info.info_global.cal_exx )
204195
{
196+
exx_spacegroup_symmetry = (PARAM.inp.nspin < 4 && ModuleSymmetry::Symmetry::symm_flag == 1);
197+
if (exx_spacegroup_symmetry)
198+
{
199+
const std::array<int, 3>& period = RI_Util::get_Born_vonKarmen_period(*kv);
200+
this->symrot_exx.find_irreducible_sector(ucell->symm, ucell->atoms, ucell->st,
201+
RI_Util::get_Born_von_Karmen_cells(period), period, ucell->lat);
202+
this->symrot_exx.cal_Ms(*kv, *ucell, *ParaV);
203+
}
204+
205205
if (GlobalC::exx_info.info_ri.real_number)
206206
{
207207
Vxc_fromRI_d = new Exx_LRI<double>(GlobalC::exx_info.info_ri);
@@ -580,11 +580,6 @@ void RDMFT<TK, TR>::cal_V_hartree()
580580
template <typename TK, typename TR>
581581
void RDMFT<TK, TR>::cal_V_XC()
582582
{
583-
584-
585-
586-
587-
588583
// // //test
589584
// DM_XC_pass = DM_XC;
590585

@@ -710,7 +705,7 @@ void RDMFT<TK, TR>::cal_V_XC()
710705
{
711706
// transfer the DM_XC to appropriate format
712707
std::vector<std::map<int,std::map<std::pair<int,std::array<int,3>>,RI::Tensor<std::complex<double>>>>>
713-
Ds_XC_c = PARAM.inp.gamma_only
708+
Ds_XC_c = std::is_same<TK, double>::value //gamma_only_local
714709
? RI_2D_Comm::split_m2D_ktoR<std::complex<double>>(*kv, DM_XC_pointer, *ParaV, nspin)
715710
: RI_2D_Comm::split_m2D_ktoR<std::complex<double>>(*kv, DM_XC_pointer, *ParaV, nspin, this->exx_spacegroup_symmetry);
716711

0 commit comments

Comments
 (0)