Skip to content

Commit ebba1cf

Browse files
haozhihandyzheng
authored andcommitted
Fix: dmin is replaced by dmax (deepmodeling#5829)
* fix deepmodeling#5819
1 parent 6a824ca commit ebba1cf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

source/module_hsolver/diago_iter_assist.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ void DiagoIterAssist<T, Device>::diagH_subspace(const hamilt::Hamilt<T, Device>*
118118
// after generation of H and S matrix, diag them
119119
DiagoIterAssist::diagH_LAPACK(nstart, n_band, hcc, scc, nstart, en, vcc);
120120

121+
122+
const int ld_temp = in_place ? dmax : dmin;
123+
121124
{ // code block to calculate evc
122125
gemm_op<T, Device>()(ctx,
123126
'N',
@@ -132,12 +135,12 @@ void DiagoIterAssist<T, Device>::diagH_subspace(const hamilt::Hamilt<T, Device>*
132135
nstart,
133136
&zero,
134137
temp,
135-
dmin);
138+
ld_temp);
136139
}
137140

138141
if (!in_place)
139142
{
140-
matrixSetToAnother<T, Device>()(ctx, n_band, temp, dmin, evc.get_pointer(), dmax);
143+
matrixSetToAnother<T, Device>()(ctx, n_band, temp, ld_temp, evc.get_pointer(), dmax);
141144
delmem_complex_op()(ctx, temp);
142145
}
143146
delmem_complex_op()(ctx, hcc);

0 commit comments

Comments
 (0)