Skip to content

Commit

Permalink
Changes suggested in code review
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Hahn <[email protected]>
  • Loading branch information
quantumsteve committed Aug 31, 2023
1 parent 4c27013 commit acbb689
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/QMCWaveFunctions/TrialWaveFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ class TrialWaveFunction
void evaluateRatiosAlltoOne(ParticleSet& P, std::vector<ValueType>& ratios);

void setTwist(const std::vector<RealType>& t) { myTwist = t; }
void setTwist(std::vector<RealType>&& t) { myTwist = std::move(t); }
const std::vector<RealType>& twist() const { return myTwist; }

inline void setMassTerm(ParticleSet& P)
Expand Down
10 changes: 4 additions & 6 deletions src/QMCWaveFunctions/WaveFunctionFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ std::unique_ptr<TrialWaveFunction> WaveFunctionFactory::buildTWF(xmlNodePtr cur,
SPOSetBuilderFactory sposet_builder_factory(myComm, targetPtcl, ptclPool);

std::string vp_file_to_load;
std::vector<ParticleSet::RealType> tsts(3, 0.);
cur = cur->children;
while (cur != NULL)
{
Expand All @@ -92,8 +91,9 @@ std::unique_ptr<TrialWaveFunction> WaveFunctionFactory::buildTWF(xmlNodePtr cur,
attribs.add(hdfName, "name");
if (hdfName == "twistAngle")
{
putContent(tsts, kcur);
targetPsi->setTwist(tsts);
std::vector<ParticleSet::RealType> twists(3, 0);
putContent(twists, kcur);
targetPsi->setTwist(std::move(twists));
foundtwist = true;
}
}
Expand All @@ -102,9 +102,7 @@ std::unique_ptr<TrialWaveFunction> WaveFunctionFactory::buildTWF(xmlNodePtr cur,
if (!foundtwist)
{
//default twist is [0 0 0]
tsts.resize(3);
std::fill(std::begin(tsts), std::end(tsts), 0.);
targetPsi->setTwist(tsts);
targetPsi->setTwist(std::vector<ParticleSet::RealType>(3, 0));
}
}
else if (cname == WaveFunctionComponentBuilder::jastrow_tag)
Expand Down

0 comments on commit acbb689

Please sign in to comment.