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

Fix last bit of #2330 #2377

Merged
merged 3 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 2 additions & 3 deletions src/QMCDrivers/DMC/DMCUpdatePbyPFast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,14 @@ void DMCUpdatePbyPWithRejectionFast::advanceWalker(Walker_t& thisWalker, bool re
PosType dr;
DriftModifier->getDrift(tauovermass, grad_iat, dr);
dr += sqrttau * deltaR[iat];
bool is_valid = W.makeMoveAndCheck(iat, dr);
RealType rr = tauovermass * dot(deltaR[iat], deltaR[iat]);
rr_proposed += rr;
if (rr > m_r2max)
if (!is_valid || rr > m_r2max)
{
++nRejectTemp;
continue;
}
if (!W.makeMoveAndCheck(iat, dr))
continue;
ValueType ratio = Psi.calcRatioGrad(W, iat, grad_iat);
//node is crossed reject the move
if (branchEngine->phaseChanged(Psi.getPhaseDiff()))
Expand Down
5 changes: 2 additions & 3 deletions src/QMCDrivers/DMC/SODMCUpdatePbyPFast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,14 @@ void SODMCUpdatePbyPWithRejectionFast::advanceWalker(Walker_t& thisWalker, bool
ds = tauovermass/spinMass*std::real(spingrad_iat); //using raw spin grad, no UNR modifier
dr += sqrttau * deltaR[iat];
ds += std::sqrt(tauovermass/spinMass)*deltaS[iat];
bool is_valid = W.makeMoveAndCheckWithSpin(iat, dr, ds);
RealType rr = tauovermass * dot(deltaR[iat], deltaR[iat]);
rr_proposed += rr;
if (rr > m_r2max)
if (!is_valid || rr > m_r2max)
{
++nRejectTemp;
continue;
}
if (!W.makeMoveAndCheckWithSpin(iat, dr, ds))
continue;
ValueType ratio = Psi.calcRatioGradWithSpin(W, iat, grad_iat, spingrad_iat);
//node is crossed reject the move
if (branchEngine->phaseChanged(Psi.getPhaseDiff()))
Expand Down
11 changes: 4 additions & 7 deletions src/QMCDrivers/RMC/RMCUpdatePbyP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,14 @@ void RMCUpdatePbyPWithDrift::advanceWalkersVMC()
PosType dr;
DriftModifier->getDrift(tauovermass, grad_iat, dr);
dr += sqrttau * deltaR[iat];
bool is_valid = W.makeMoveAndCheck(iat, dr);
RealType rr = tauovermass * dot(deltaR[iat], deltaR[iat]);
rr_proposed += rr;
if (rr > m_r2max)
if (!is_valid || rr > m_r2max)
{
++nRejectTemp;
continue;
}
if (!W.makeMoveAndCheck(iat, dr))
continue;
ValueType ratio = Psi.calcRatioGrad(W, iat, grad_iat);
//node is crossed reject the move
if (branchEngine->phaseChanged(Psi.getPhaseDiff()))
Expand Down Expand Up @@ -281,16 +280,14 @@ void RMCUpdatePbyPWithDrift::advanceWalkersRMC()
PosType dr;
DriftModifier->getDrift(tauovermass, grad_iat, dr);
dr += sqrttau * deltaR[iat];
//RealType rr=dot(dr,dr);
bool is_valid = W.makeMoveAndCheck(iat, dr);
RealType rr = tauovermass * dot(deltaR[iat], deltaR[iat]);
rr_proposed += rr;
if (rr > m_r2max)
if (!is_valid || rr > m_r2max)
{
++nRejectTemp;
continue;
}
if (!W.makeMoveAndCheck(iat, dr))
continue;
ValueType ratio = Psi.calcRatioGrad(W, iat, grad_iat);
//node is crossed reject the move
if (branchEngine->phaseChanged(Psi.getPhaseDiff()))
Expand Down