diff --git a/src/QMCWaveFunctions/SPOSetT.cpp b/src/QMCWaveFunctions/SPOSetT.cpp index 6d488d4bea3..3f9bb30315f 100644 --- a/src/QMCWaveFunctions/SPOSetT.cpp +++ b/src/QMCWaveFunctions/SPOSetT.cpp @@ -206,6 +206,18 @@ void SPOSetT::mw_evaluate_notranspose(const RefVectorWithLeader>& spo_list[iw].evaluate_notranspose(P_list[iw], first, last, logdet_list[iw], dlogdet_list[iw], d2logdet_list[iw]); } +template +void SPOSetT::evaluate_notranspose(const ParticleSet& P, + int first, + int last, + ValueMatrix& logdet, + GradMatrix& dlogdet, + HessMatrix& grad_grad_logdet, + GGGMatrix& grad_grad_grad_logdet) +{ + throw std::runtime_error("Need specialization of SPOSet::evaluate_notranspose() for grad_grad_grad_logdet. \n"); +} + template std::unique_ptr> SPOSetT::makeClone() const { @@ -370,6 +382,22 @@ void SPOSetT::evaluateGradSource(const ParticleSet& P, "must be overloaded when the SPOSet has ion derivatives."); } +template +void SPOSetT::evaluateGradSource(const ParticleSet& P, + int first, + int last, + const ParticleSet& source, + int iat_src, + GradMatrix& grad_phi, + HessMatrix& grad_grad_phi, + GradMatrix& grad_lapl_phi) +{ + if (hasIonDerivs()) + throw std::logic_error("Bug!! " + getClassName() + + "::evaluateGradSource " + "must be overloaded when the SPOSet has ion derivatives."); +} + template void SPOSetT::evaluateGradSourceRow(const ParticleSet& P, int iel, diff --git a/src/QMCWaveFunctions/SPOSetT.h b/src/QMCWaveFunctions/SPOSetT.h index 95643fd3c54..0f370042b93 100644 --- a/src/QMCWaveFunctions/SPOSetT.h +++ b/src/QMCWaveFunctions/SPOSetT.h @@ -37,10 +37,8 @@ template class SPOSetT; namespace testing { -opt_variables_type& getMyVars(SPOSetT& spo); -opt_variables_type& getMyVars(SPOSetT& spo); -opt_variables_type& getMyVars(SPOSetT>& spo); -opt_variables_type& getMyVars(SPOSetT>& spo); +template +opt_variables_type& getMyVars(SPOSetT& spo); } // namespace testing @@ -481,7 +479,7 @@ class SPOSetT : public QMCTraits int last, const ParticleSet& source, int iat_src, - GradMatrix& gradphi); + GradMatrix& gradphi){}; /** evaluate the gradients of values, gradients, laplacians of this single-particle orbital * for [first,last) target particles with respect to the given source particle @@ -565,10 +563,8 @@ class SPOSetT : public QMCTraits /// Optimizable variables opt_variables_type myVars; - friend opt_variables_type& testing::getMyVars(SPOSetT& spo); - friend opt_variables_type& testing::getMyVars(SPOSetT& spo); - friend opt_variables_type& testing::getMyVars(SPOSetT>& spo); - friend opt_variables_type& testing::getMyVars(SPOSetT>& spo); + template + friend opt_variables_type& testing::getMyVars(SPOSetT& spo); }; template diff --git a/src/QMCWaveFunctions/tests/test_RotatedSPOs.cpp b/src/QMCWaveFunctions/tests/test_RotatedSPOs.cpp index c0bf304a158..b02115bfd69 100644 --- a/src/QMCWaveFunctions/tests/test_RotatedSPOs.cpp +++ b/src/QMCWaveFunctions/tests/test_RotatedSPOs.cpp @@ -644,11 +644,12 @@ TEST_CASE("RotatedSPOs construct delta matrix", "[wavefunction]") namespace testing { -opt_variables_type& getMyVars(SPOSet& rot) { return rot.myVars; } -opt_variables_type& getMyVars(SPOSetT& rot) { return rot.myVars; } -opt_variables_type& getMyVars(SPOSetT& rot) { return rot.myVars; } -opt_variables_type& getMyVars(SPOSetT>& rot) { return rot.myVars; } -opt_variables_type& getMyVars(SPOSetT>& rot) { return rot.myVars; } + +template +opt_variables_type& getMyVars(SPOSet& rot) +{ + return rot.myVars; +} opt_variables_type& getMyVarsFull(RotatedSPOs& rot) { return rot.myVarsFull; } std::vector>& getHistoryParams(RotatedSPOs& rot) { return rot.history_params_; } } // namespace testing