Skip to content

Commit

Permalink
fix a segfault in LR-TDDFT when nspin=1
Browse files Browse the repository at this point in the history
  • Loading branch information
maki49 committed Nov 29, 2024
1 parent 8b4d10f commit b791d91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/module_lr/esolver_lrtd_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ LR::ESolver_LR<T, TR>::ESolver_LR(ModuleESolver::ESolver_KS_LCAO<T, TR>&& ks_sol
{
this->psi_ks = new psi::Psi<T>(this->kv.get_nks(), this->paraC_.get_col_size(), this->paraC_.get_row_size());
this->eig_ks.create(this->kv.get_nks(), this->nbands);
const int start_band = this->nocc_max - std::max(nocc[0], nocc[1]);
const int start_band = this->nocc_max - *std::max_element(nocc.begin(), nocc.end());
for (int ik = 0;ik < this->kv.get_nks();++ik)
{
Cpxgemr2d(this->nbasis, this->nbands, &(*ks_sol.psi)(ik, 0, 0), 1, start_band + 1, ks_sol.pv.desc_wfc,
Expand Down

0 comments on commit b791d91

Please sign in to comment.