Skip to content

Commit

Permalink
Merge pull request #4627 from ye-luo/fix-orbimag
Browse files Browse the repository at this point in the history
Fix sposet_indices missing construction in OrbitalImages.
  • Loading branch information
ye-luo authored Jun 8, 2023
2 parents 0c5f85c + db60c5b commit 2db0b25
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/QMCHamiltonians/OrbitalImages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@

namespace qmcplusplus
{
OrbitalImages::OrbitalImages(ParticleSet& P,
const PSPool& PSP,
Communicate* mpicomm,
const SPOMap& spomap)
: psetpool(PSP), spomap_(spomap)
OrbitalImages::OrbitalImages(ParticleSet& P, const PSPool& PSP, Communicate* mpicomm, const SPOMap& spomap)
: psetpool(PSP), sposet_indices(std::make_shared<std::vector<std::vector<int>>>()), spomap_(spomap)
{
//keep the electron particle to get the cell later, if necessary
Peln = &P;
Expand Down Expand Up @@ -219,8 +216,8 @@ bool OrbitalImages::put(xmlNodePtr cur)
throw std::runtime_error("OrbitalImages::put sposet " + sposet_names[i] + " does not exist.");

sposets.push_back(spo_it->second->makeClone());
auto& sposet = sposets.back();
std::vector<int>& sposet_inds = (*sposet_indices)[i];
auto& sposet = sposets.back();
auto& sposet_inds = (*sposet_indices)[i];
if (sposet_inds.size() == 0)
for (int n = 0; n < sposet->size(); ++n)
sposet_inds.push_back(n);
Expand Down

0 comments on commit 2db0b25

Please sign in to comment.