Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: remove pelec frome hsolverpw solve func #4846

Merged
merged 4 commits into from
Aug 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test bug
haozhihan committed Jul 31, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit e87f405ba936a3effda7591b01f8eec8474dff81
6 changes: 3 additions & 3 deletions source/module_hsolver/hsolver_pw.cpp
Original file line number Diff line number Diff line change
@@ -293,7 +293,7 @@ void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,

// prepare for the precondition of diagonalization
std::vector<Real> precondition(psi.get_nbasis(), 0.0);
std::vector<Real> eigenvalues(psi.get_nk() * psi.get_nbands(), 0.0);
std::vector<Real> eigenvalues(pes->ekb.nr * pes->ekb.nc, 0.0);
std::vector<bool> is_occupied(psi.get_nk() * psi.get_nbands(), true);
if (this->method == "dav_subspace")
{
@@ -325,7 +325,7 @@ void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
#endif

/// solve eigenvector and eigenvalue for H(k)
this->hamiltSolvePsiK(pHamilt, psi, precondition, eigenvalues.data() + ik * psi.get_nbands());
this->hamiltSolvePsiK(pHamilt, psi, precondition, eigenvalues.data() + ik * pes->ekb.nc);

if (skip_charge)
{
@@ -346,7 +346,7 @@ void HSolverPW<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
pes->ekb.c,
// out_eigenvalues,
eigenvalues.data(),
psi.get_nk() * psi.get_nbands());
pes->ekb.nr * pes->ekb.nc);

// psi only should be initialed once for PW
if (!this->initialed_psi)