Skip to content

Commit

Permalink
Set opt offset to be equal to first active var
Browse files Browse the repository at this point in the history
Detailed disussion on issue QMCPACK#2814
  • Loading branch information
shivupa committed Jan 1, 2021
1 parent fa12f32 commit bf93f07
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/QMCWaveFunctions/Jastrow/DiffTwoBodyJastrowOrbital.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ class DiffTwoBodyJastrowOrbital : public DiffWaveFunctionComponent
lapLogPsi[i] = new ValueVectorType(NumPtcls);
}
OffSet.resize(F.size());
int varoffset = myVars.Index[0];
int varoffset = -1;
for (int i = 0; i < myVars.size(); i++) {
varoffset = myVars.Index[i];
if (varoffset != -1) break;
}
for (int i = 0; i < F.size(); ++i)
{
if (F[i] && F[i]->myVars.Index.size())
Expand Down Expand Up @@ -172,7 +176,7 @@ class DiffTwoBodyJastrowOrbital : public DiffWaveFunctionComponent
continue;
if (active.recompute(kk))
recalculate = true;
rcsingles[k] = true;
rcsingles[kk] = true;
}
if (recalculate)
{
Expand All @@ -181,9 +185,9 @@ class DiffTwoBodyJastrowOrbital : public DiffWaveFunctionComponent
int kk = myVars.where(k);
if (kk < 0)
continue;
if (rcsingles[k])
if (rcsingles[kk])
{
dhpsioverpsi[kk] = -RealType(0.5) * ValueType(Sum(*lapLogPsi[k])) - ValueType(Dot(P.G, *gradLogPsi[k]));
dhpsioverpsi[kk] = -RealType(0.5) * ValueType(Sum(*lapLogPsi[kk])) - ValueType(Dot(P.G, *gradLogPsi[kk]));
}
}
}
Expand Down Expand Up @@ -270,9 +274,9 @@ class DiffTwoBodyJastrowOrbital : public DiffWaveFunctionComponent
int kk = myVars.where(k);
if (kk < 0)
continue;
if (rcsingles[k])
if (rcsingles[kk])
{
dlogpsi[kk] = dLogPsi[k];
dlogpsi[kk] = dLogPsi[kk];
}
//optVars.setDeriv(p,dLogPsi[ip],-0.5*Sum(*lapLogPsi[ip])-Dot(P.G,*gradLogPsi[ip]));
}
Expand Down

0 comments on commit bf93f07

Please sign in to comment.