Skip to content

Commit

Permalink
Merge pull request #4855 from rcclay/pbc_ion_derivs
Browse files Browse the repository at this point in the history
Backend Changes to Make PBC ACForces Correct
  • Loading branch information
ye-luo committed Dec 5, 2023
2 parents 247067f + 1287e3e commit 7dcfe2f
Show file tree
Hide file tree
Showing 7 changed files with 520 additions and 61 deletions.
4 changes: 3 additions & 1 deletion src/QMCHamiltonians/NonLocalECPComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,9 @@ void NonLocalECPComponent::evaluateOneBodyOpMatrixdRContribution(ParticleSet& W,
for (int iorb = 0; iorb < norbs; iorb++)
{
//this is for diagonal case.
udotgradpsimat[j][iorb] = dot(gradphimat[j][iorb], rrotsgrid_m[j]);
//The GradType is necessary here, since rrotsgrid_m is real. This dot() will only return the real part in this case.
//Does correct thing if both entries are complex.
udotgradpsimat[j][iorb] = dot(gradphimat[j][iorb], GradType(rrotsgrid_m[j]));
wfgradmat[j][iorb] = gradphimat[j][iorb] - dr * (udotgradpsimat[j][iorb] * rinv);
gpot[iorb] += dvdr_prefactor[j] * phimat[j][iorb];
glpoly[iorb] += dlpoly_prefactor[j] * phimat[j][iorb];
Expand Down
8 changes: 7 additions & 1 deletion src/QMCHamiltonians/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ maybe_symlink(${UTEST_HDF_INPUT} ${UTEST_DIR}/diamondC_1x1x1.pwscf.h5)
set(UTEST_HDF_INPUT2 ${qmcpack_SOURCE_DIR}/tests/solids/hcpBe_1x1x1_pp/pwscf.pwscf.h5)
maybe_symlink(${UTEST_HDF_INPUT2} ${UTEST_DIR}/hcpBe.pwscf.h5)

set(UTEST_HDF_INPUT5 ${qmcpack_SOURCE_DIR}/tests/solids/diamondC_1x1x1-Gaussian_pp_Tw_cplx/C_diamond-twist-third.h5)
maybe_symlink(${UTEST_HDF_INPUT5} ${UTEST_DIR}/C_diamond-twist-third.h5)

set(UTEST_HDF_INPUT5 ${qmcpack_SOURCE_DIR}/tests/solids/diamondC_1x1x1-Gaussian_pp_Tw_cplx/C_diamond-twist-third-cart.h5)
maybe_symlink(${UTEST_HDF_INPUT5} ${UTEST_DIR}/C_diamond-twist-third-cart.h5)

foreach(fname Na2.structure.xml simple.txt)
maybe_symlink(${CMAKE_CURRENT_SOURCE_DIR}/${fname} ${UTEST_DIR}/${fname})
endforeach()

foreach(fname cn.wfnoj.xml cn.wfj.xml cn.msd-wfnoj.xml cn.msd-wfj.xml)
foreach(fname cn.wfnoj.xml cn.wfj.xml cn.msd-wfnoj.xml cn.msd-wfj.xml C_diamond-twist-third-cart.wfj.xml)
maybe_symlink(${qmcpack_SOURCE_DIR}/src/QMCWaveFunctions/tests/${fname} ${UTEST_DIR}/${fname})
endforeach()

Expand Down

0 comments on commit 7dcfe2f

Please sign in to comment.