Skip to content

Commit bfdfc92

Browse files
committed
fix ri test bug
1 parent 8935299 commit bfdfc92

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

source/module_lr/ri_benchmark/test/ri_benchmark_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ UnitCell::~UnitCell() {
2323
TEST(RI_Benchmark, SlicePsi)
2424
{
2525
const int nk = 1, nbands = 2, nbasis = 3;
26-
psi::Psi<double> psi(nk, nbands, nbasis);
26+
psi::Psi<double> psi(nk, nbands, nbasis, nbasis, true);
2727
for (int i = 0; i < nk * nbands * nbasis; i++) {
2828
psi.get_pointer()[i] = i;
2929
}
@@ -50,7 +50,7 @@ TEST(RI_Benchmark, CalCsMO)
5050
for (int i = 0;i < nabf * nao * nao;++i) { Cs_ao[0][{0, { 0, 0, 0 }}].ptr()[i] = static_cast<double>(i); }
5151

5252
const UnitCell ucell;
53-
psi::Psi<double> psi_ks(1, 2, 2);
53+
psi::Psi<double> psi_ks(1, 2, 2, 2, true);
5454
for (int i = 0;i < 4;++i) { psi_ks.get_pointer()[i] = static_cast<double>(i); }
5555
RI_Benchmark::TLRI<double> Cs_a_mo = RI_Benchmark::cal_Cs_mo(ucell, Cs_ao, psi_ks, nocc, nvirt, false);
5656
std::vector<double> Cs_a_mo_ref = { 11,31 };

source/module_ri/exx_lip.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Exx_Lip<T, Device>::Exx_Lip(const Exx_Info::Exx_Info_Lip& info_in,
114114
#endif
115115
this->k_pack->wf_wg.create(this->k_pack->kv_ptr->get_nks(),PARAM.inp.nbands);
116116

117-
this->k_pack->hvec_array = new psi::Psi<T, Device>(this->k_pack->kv_ptr->get_nks(), PARAM.inp.nbands, PARAM.globalv.nlocal);
117+
this->k_pack->hvec_array = new psi::Psi<T, Device>(this->k_pack->kv_ptr->get_nks(), PARAM.inp.nbands, PARAM.globalv.nlocal, kv_ptr_in->ngk.data(), true);
118118
// this->k_pack->hvec_array = new ModuleBase::ComplexMatrix[this->k_pack->kv_ptr->get_nks()];
119119
// for( int ik=0; ik<this->k_pack->kv_ptr->get_nks(); ++ik)
120120
// {

0 commit comments

Comments
 (0)