Skip to content

Commit a02c35b

Browse files
committed
Fix: pyabacus interface
1 parent 1a3282d commit a02c35b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/pyabacus/src/hsolver/py_diago_dav_subspace.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ class PyDiagoDavSubspace
132132
std::copy(hpsi_ptr, hpsi_ptr + nvec * ld_psi, hpsi_out);
133133
};
134134

135+
auto spsi_func = [this](const std::complex<double>* psi_in,
136+
std::complex<double>* spsi_out,
137+
const int ld_psi,
138+
const int nvec) { syncmem_op()(spsi_out, psi_in, static_cast<size_t>(ld_psi * nvec)); };
139+
135140
obj = std::make_unique<hsolver::Diago_DavSubspace<std::complex<double>, base_device::DEVICE_CPU>>(
136141
precond_vec,
137142
nband,
@@ -145,7 +150,7 @@ class PyDiagoDavSubspace
145150
nb2d
146151
);
147152

148-
return obj->diag(hpsi_func, psi, nbasis, eigenvalue, diag_ethr, scf_type);
153+
return obj->diag(hpsi_func, spsi_func, psi, nbasis, eigenvalue, diag_ethr, scf_type);
149154
}
150155

151156
private:

0 commit comments

Comments
 (0)