Skip to content

Commit 628bdc6

Browse files
authored
Fix cal_edm_tddft (#5396)
* Add files via upload * Update cal_edm_tddft.cpp * Update result.ref * Fix wrong parameters in integrate test * Update result.ref * Update result.ref * Update result.ref * Update result.ref * Update result.ref * Update result.ref * Update result.ref * Update result.ref
1 parent 9847e76 commit 628bdc6

File tree

11 files changed

+25
-22
lines changed

11 files changed

+25
-22
lines changed

source/module_esolver/cal_edm_tddft.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ void ESolver_KS_LCAO_TDDFT::cal_edm_tddft()
4848
->get_DM()
4949
->EDMK.resize(kv.get_nks());
5050
for (int ik = 0; ik < kv.get_nks(); ++ik) {
51+
52+
p_hamilt->updateHk(ik);
53+
5154
std::complex<double>* tmp_dmk
5255
= dynamic_cast<elecstate::ElecStateLCAO<std::complex<double>>*>(this->pelec)->get_DM()->get_DMK_pointer(ik);
5356

@@ -146,11 +149,11 @@ void ESolver_KS_LCAO_TDDFT::cal_edm_tddft()
146149
&nlocal,
147150
&nlocal,
148151
&one_float,
149-
tmp_dmk,
152+
Htmp,
150153
&one_int,
151154
&one_int,
152155
this->pv.desc,
153-
Htmp,
156+
Sinv,
154157
&one_int,
155158
&one_int,
156159
this->pv.desc,
@@ -160,7 +163,7 @@ void ESolver_KS_LCAO_TDDFT::cal_edm_tddft()
160163
&one_int,
161164
this->pv.desc);
162165

163-
pzgemm_(&N_char,
166+
pzgemm_(&T_char,
164167
&N_char,
165168
&nlocal,
166169
&nlocal,
@@ -170,7 +173,7 @@ void ESolver_KS_LCAO_TDDFT::cal_edm_tddft()
170173
&one_int,
171174
&one_int,
172175
this->pv.desc,
173-
Sinv,
176+
tmp_dmk,
174177
&one_int,
175178
&one_int,
176179
this->pv.desc,
@@ -201,16 +204,16 @@ void ESolver_KS_LCAO_TDDFT::cal_edm_tddft()
201204
this->pv.desc);
202205

203206
pzgemm_(&N_char,
204-
&N_char,
207+
&T_char,
205208
&nlocal,
206209
&nlocal,
207210
&nlocal,
208211
&one_float,
209-
tmp3,
212+
tmp_dmk,
210213
&one_int,
211214
&one_int,
212215
this->pv.desc,
213-
tmp_dmk,
216+
tmp3,
214217
&one_int,
215218
&one_int,
216219
this->pv.desc,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
etotref -18.05466171990316
22
etotperatomref -9.0273308600
3-
totalforceref 44.887962
4-
totalstressref 79.547659
3+
totalforceref 44.85505600
4+
totalstressref 79.48569300
55
totaltimeref 1.51
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
etotref -30.45477750879012
22
etotperatomref -15.2273887544
3-
totalforceref 0.574814
3+
totalforceref 0.57576800
44
totalstressref 4.287440
55
totaltimeref 1.57
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
etotref -30.45466274119030
22
etotperatomref -15.2273313706
3-
totalforceref 0.573436
3+
totalforceref 0.57439400
44
totalstressref 4.285714
55
totaltimeref 1.55
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
etotref -22.97718184915547
22
etotperatomref -11.4885909246
3-
totalforceref 0.564908
3+
totalforceref 0.56587600
44
totalstressref 76.073961
55
totaltimeref 1.56
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
etotref 20.38731422853930
22
etotperatomref 10.1936571143
3-
totalforceref 0.738256
3+
totalforceref 0.73949000
44
totalstressref 489.377111
55
totaltimeref 1.56
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
etotref -30.89965242483882
22
etotperatomref -15.4498262124
3-
totalforceref 0.574662
4-
totalstressref 1.034216
3+
totalforceref 0.57561800
4+
totalstressref 1.03619000
55
totaltimeref 1.44
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
etotref -30.90912142263002
22
etotperatomref -15.4545607113
3-
totalforceref 0.574662
4-
totalstressref 1.108904
3+
totalforceref 0.57561800
4+
totalstressref 1.11089700
55
totaltimeref 1.43

tests/integrate/601_NO_TDDFT_H2_oldedm/INPUT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ md_dt 0.05
3232
init_vel 1
3333
ocp 1
3434
ocp_set 1*0.5 1*0.5 3*0 1*0.5 1*0.5 3*0
35-
td_edm 0
35+
td_edm 1
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
etotref -18.05466171990316
22
etotperatomref -9.0273308600
3-
totalforceref 44.887962
4-
totalstressref 79.547659
3+
totalforceref 43.10812600
4+
totalstressref 76.35413900
55
totaltimeref 1.53

0 commit comments

Comments
 (0)