diff --git a/src/QMCWaveFunctions/SPOSet.cpp b/src/QMCWaveFunctions/SPOSet.cpp index 60d233ff8d0..63b460976a1 100644 --- a/src/QMCWaveFunctions/SPOSet.cpp +++ b/src/QMCWaveFunctions/SPOSet.cpp @@ -26,9 +26,12 @@ namespace qmcplusplus { -SPOSet::SPOSet(const std::string& my_name) : my_name_(my_name), OrbitalSetSize(0) {} +template +SPOSet::SPOSet(const std::string& my_name) : my_name_(my_name), OrbitalSetSize(0) +{} -void SPOSet::extractOptimizableObjectRefs(UniqueOptObjRefs&) +template +void SPOSet::extractOptimizableObjectRefs(UniqueOptObjRefs&) { if (isOptimizable()) throw std::logic_error("Bug!! " + getClassName() + @@ -36,7 +39,8 @@ void SPOSet::extractOptimizableObjectRefs(UniqueOptObjRefs&) "must be overloaded when the SPOSet is optimizable."); } -void SPOSet::checkOutVariables(const opt_variables_type& active) +template +void SPOSet::checkOutVariables(const opt_variables_type& active) { if (isOptimizable()) throw std::logic_error("Bug!! " + getClassName() + @@ -44,10 +48,11 @@ void SPOSet::checkOutVariables(const opt_variables_type& active) "must be overloaded when the SPOSet is optimizable."); } -void SPOSet::evaluateDetRatios(const VirtualParticleSet& VP, - ValueVector& psi, - const ValueVector& psiinv, - std::vector& ratios) +template +void SPOSet::evaluateDetRatios(const VirtualParticleSet& VP, + ValueVector& psi, + const ValueVector& psiinv, + std::vector& ratios) { assert(psi.size() == psiinv.size()); for (int iat = 0; iat < VP.getTotalNum(); ++iat) @@ -57,73 +62,79 @@ void SPOSet::evaluateDetRatios(const VirtualParticleSet& VP, } } -void SPOSet::mw_evaluateDetRatios(const RefVectorWithLeader& spo_list, - const RefVectorWithLeader& vp_list, - const RefVector& psi_list, - const std::vector& invRow_ptr_list, - std::vector>& ratios_list) const +template +void SPOSet::mw_evaluateDetRatios(const RefVectorWithLeader& spo_list, + const RefVectorWithLeader& vp_list, + const RefVector& psi_list, + const std::vector& invRow_ptr_list, + std::vector>& ratios_list) const { assert(this == &spo_list.getLeader()); for (int iw = 0; iw < spo_list.size(); iw++) { - Vector invRow(const_cast(invRow_ptr_list[iw]), psi_list[iw].get().size()); + Vector invRow(const_cast(invRow_ptr_list[iw]), psi_list[iw].get().size()); spo_list[iw].evaluateDetRatios(vp_list[iw], psi_list[iw], invRow, ratios_list[iw]); } } -void SPOSet::evaluateVGL_spin(const ParticleSet& P, - int iat, - ValueVector& psi, - GradVector& dpsi, - ValueVector& d2psi, - ValueVector& dspin) +template +void SPOSet::evaluateVGL_spin(const ParticleSet& P, + int iat, + ValueVector& psi, + GradVector& dpsi, + ValueVector& d2psi, + ValueVector& dspin) { - throw std::runtime_error("Need specialization of SPOSet::evaluateVGL_spin"); + throw std::runtime_error("Need specialization of SPOSet::evaluateVGL_spin"); } -void SPOSet::mw_evaluateVGL(const RefVectorWithLeader& spo_list, - const RefVectorWithLeader& P_list, - int iat, - const RefVector& psi_v_list, - const RefVector& dpsi_v_list, - const RefVector& d2psi_v_list) const +template +void SPOSet::mw_evaluateVGL(const RefVectorWithLeader& spo_list, + const RefVectorWithLeader& P_list, + int iat, + const RefVector& psi_v_list, + const RefVector& dpsi_v_list, + const RefVector& d2psi_v_list) const { assert(this == &spo_list.getLeader()); for (int iw = 0; iw < spo_list.size(); iw++) spo_list[iw].evaluateVGL(P_list[iw], iat, psi_v_list[iw], dpsi_v_list[iw], d2psi_v_list[iw]); } -void SPOSet::mw_evaluateValue(const RefVectorWithLeader& spo_list, - const RefVectorWithLeader& P_list, - int iat, - const RefVector& psi_v_list) const +template +void SPOSet::mw_evaluateValue(const RefVectorWithLeader& spo_list, + const RefVectorWithLeader& P_list, + int iat, + const RefVector& psi_v_list) const { assert(this == &spo_list.getLeader()); for (int iw = 0; iw < spo_list.size(); iw++) spo_list[iw].evaluateValue(P_list[iw], iat, psi_v_list[iw]); } -void SPOSet::mw_evaluateVGLWithSpin(const RefVectorWithLeader& spo_list, - const RefVectorWithLeader& P_list, - int iat, - const RefVector& psi_v_list, - const RefVector& dpsi_v_list, - const RefVector& d2psi_v_list, - OffloadMatrix& mw_dspin) const +template +void SPOSet::mw_evaluateVGLWithSpin(const RefVectorWithLeader& spo_list, + const RefVectorWithLeader& P_list, + int iat, + const RefVector& psi_v_list, + const RefVector& dpsi_v_list, + const RefVector& d2psi_v_list, + OffloadMatrix& mw_dspin) const { throw std::runtime_error(getClassName() + "::mw_evaluateVGLWithSpin() is not supported. \n"); } -void SPOSet::mw_evaluateVGLandDetRatioGrads(const RefVectorWithLeader& spo_list, - const RefVectorWithLeader& P_list, - int iat, - const std::vector& invRow_ptr_list, - OffloadMWVGLArray& phi_vgl_v, - std::vector& ratios, - std::vector& grads) const +template +void SPOSet::mw_evaluateVGLandDetRatioGrads(const RefVectorWithLeader& spo_list, + const RefVectorWithLeader& P_list, + int iat, + const std::vector& invRow_ptr_list, + OffloadMWVGLArray& phi_vgl_v, + std::vector& ratios, + std::vector& grads) const { assert(this == &spo_list.getLeader()); - assert(phi_vgl_v.size(0) == DIM_VGL); + assert(phi_vgl_v.size(0) == QMCTraits::DIM_VGL); assert(phi_vgl_v.size(1) == spo_list.size()); const size_t nw = spo_list.size(); const size_t norb_requested = phi_vgl_v.size(2); @@ -138,9 +149,9 @@ void SPOSet::mw_evaluateVGLandDetRatioGrads(const RefVectorWithLeader& s grads[iw] = simd::dot(invRow_ptr_list[iw], dphi_v.data(), norb_requested) / ratios[iw]; // transpose the array of gradients to SoA in phi_vgl_v - for (size_t idim = 0; idim < DIM; idim++) + for (size_t idim = 0; idim < QMCTraits::DIM; idim++) { - ValueType* phi_g = phi_vgl_v.data_at(idim + 1, iw, 0); + Value* phi_g = phi_vgl_v.data_at(idim + 1, iw, 0); for (size_t iorb = 0; iorb < norb_requested; iorb++) phi_g[iorb] = dphi_v[iorb][idim]; } @@ -148,77 +159,86 @@ void SPOSet::mw_evaluateVGLandDetRatioGrads(const RefVectorWithLeader& s phi_vgl_v.updateTo(); } -void SPOSet::mw_evaluateVGLandDetRatioGradsWithSpin(const RefVectorWithLeader& spo_list, - const RefVectorWithLeader& P_list, - int iat, - const std::vector& invRow_ptr_list, - OffloadMWVGLArray& phi_vgl_v, - std::vector& ratios, - std::vector& grads, - std::vector& spingrads) const +template +void SPOSet::mw_evaluateVGLandDetRatioGradsWithSpin(const RefVectorWithLeader& spo_list, + const RefVectorWithLeader& P_list, + int iat, + const std::vector& invRow_ptr_list, + OffloadMWVGLArray& phi_vgl_v, + std::vector& ratios, + std::vector& grads, + std::vector& spingrads) const { throw std::runtime_error("Need specialization of " + getClassName() + "::mw_evaluateVGLandDetRatioGradsWithSpin(). \n"); } -void SPOSet::evaluateThirdDeriv(const ParticleSet& P, int first, int last, GGGMatrix& grad_grad_grad_logdet) +template +void SPOSet::evaluateThirdDeriv(const ParticleSet& P, int first, int last, GGGMatrix& grad_grad_grad_logdet) { - throw std::runtime_error("Need specialization of SPOSet::evaluateThirdDeriv(). \n"); + throw std::runtime_error("Need specialization of SPOSet::evaluateThirdDeriv(). \n"); } -void SPOSet::evaluate_notranspose_spin(const ParticleSet& P, - int first, - int last, - ValueMatrix& logdet, - GradMatrix& dlogdet, - ValueMatrix& d2logdet, - ValueMatrix& dspinlogdet) +template +void SPOSet::evaluate_notranspose_spin(const ParticleSet& P, + int first, + int last, + ValueMatrix& logdet, + GradMatrix& dlogdet, + ValueMatrix& d2logdet, + ValueMatrix& dspinlogdet) { throw std::runtime_error("Need specialization of " + getClassName() + "::evaluate_notranspose_spin(P,iat,psi,dpsi,d2logdet, dspin_logdet) (vector quantities)\n"); } -void SPOSet::mw_evaluate_notranspose(const RefVectorWithLeader& spo_list, - const RefVectorWithLeader& P_list, - int first, - int last, - const RefVector& logdet_list, - const RefVector& dlogdet_list, - const RefVector& d2logdet_list) const +template +void SPOSet::mw_evaluate_notranspose(const RefVectorWithLeader& spo_list, + const RefVectorWithLeader& P_list, + int first, + int last, + const RefVector& logdet_list, + const RefVector& dlogdet_list, + const RefVector& d2logdet_list) const { assert(this == &spo_list.getLeader()); for (int iw = 0; iw < spo_list.size(); iw++) spo_list[iw].evaluate_notranspose(P_list[iw], first, last, logdet_list[iw], dlogdet_list[iw], d2logdet_list[iw]); } -void SPOSet::evaluate_notranspose(const ParticleSet& P, - int first, - int last, - ValueMatrix& logdet, - GradMatrix& dlogdet, - HessMatrix& grad_grad_logdet) +template +void SPOSet::evaluate_notranspose(const ParticleSet& P, + int first, + int last, + ValueMatrix& logdet, + GradMatrix& dlogdet, + HessMatrix& grad_grad_logdet) { - throw std::runtime_error("Need specialization of SPOSet::evaluate_notranspose() for grad_grad_logdet. \n"); + throw std::runtime_error("Need specialization of SPOSet::evaluate_notranspose() for grad_grad_logdet. \n"); } -void SPOSet::evaluate_notranspose(const ParticleSet& P, - int first, - int last, - ValueMatrix& logdet, - GradMatrix& dlogdet, - HessMatrix& grad_grad_logdet, - GGGMatrix& grad_grad_grad_logdet) +template +void SPOSet::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"); + throw std::runtime_error( + "Need specialization of SPOSet::evaluate_notranspose() for grad_grad_grad_logdet. \n"); } -std::unique_ptr SPOSet::makeClone() const +template +std::unique_ptr> SPOSet::makeClone() const { - throw std::runtime_error("Missing SPOSet::makeClone for " + getClassName()); + throw std::runtime_error("Missing SPOSet::makeClone for " + getClassName()); } -void SPOSet::basic_report(const std::string& pad) const +template +void SPOSet::basic_report(const std::string& pad) const { app_log() << pad << "size = " << size() << std::endl; app_log() << pad << "state info:" << std::endl; @@ -226,24 +246,31 @@ void SPOSet::basic_report(const std::string& pad) const app_log().flush(); } -void SPOSet::evaluateVGH(const ParticleSet& P, int iat, ValueVector& psi, GradVector& dpsi, HessVector& grad_grad_psi) +template +void SPOSet::evaluateVGH(const ParticleSet& P, + int iat, + ValueVector& psi, + GradVector& dpsi, + HessVector& grad_grad_psi) { throw std::runtime_error("Need specialization of " + getClassName() + "::evaluate(P,iat,psi,dpsi,dhpsi) (vector quantities)\n"); } -void SPOSet::evaluateVGHGH(const ParticleSet& P, - int iat, - ValueVector& psi, - GradVector& dpsi, - HessVector& grad_grad_psi, - GGGVector& grad_grad_grad_psi) +template +void SPOSet::evaluateVGHGH(const ParticleSet& P, + int iat, + ValueVector& psi, + GradVector& dpsi, + HessVector& grad_grad_psi, + GGGVector& grad_grad_grad_psi) { throw std::runtime_error("Need specialization of " + getClassName() + "::evaluate(P,iat,psi,dpsi,dhpsi,dghpsi) (vector quantities)\n"); } -void SPOSet::applyRotation(const ValueMatrix& rot_mat, bool use_stored_copy) +template +void SPOSet::applyRotation(const ValueMatrix& rot_mat, bool use_stored_copy) { if (isRotationSupported()) throw std::logic_error("Bug!! " + getClassName() + @@ -251,12 +278,13 @@ void SPOSet::applyRotation(const ValueMatrix& rot_mat, bool use_stored_copy) "must be overloaded when the SPOSet supports rotation."); } -void SPOSet::evaluateDerivatives(ParticleSet& P, - const opt_variables_type& optvars, - Vector& dlogpsi, - Vector& dhpsioverpsi, - const int& FirstIndex, - const int& LastIndex) +template +void SPOSet::evaluateDerivatives(ParticleSet& P, + const opt_variables_type& optvars, + Vector& dlogpsi, + Vector& dhpsioverpsi, + const int& FirstIndex, + const int& LastIndex) { if (isOptimizable()) throw std::logic_error("Bug!! " + getClassName() + @@ -264,11 +292,12 @@ void SPOSet::evaluateDerivatives(ParticleSet& P, "must be overloaded when the SPOSet is optimizable."); } -void SPOSet::evaluateDerivativesWF(ParticleSet& P, - const opt_variables_type& optvars, - Vector& dlogpsi, - int FirstIndex, - int LastIndex) +template +void SPOSet::evaluateDerivativesWF(ParticleSet& P, + const opt_variables_type& optvars, + Vector& dlogpsi, + int FirstIndex, + int LastIndex) { if (isOptimizable()) throw std::logic_error("Bug!! " + getClassName() + @@ -276,14 +305,15 @@ void SPOSet::evaluateDerivativesWF(ParticleSet& P, "must be overloaded when the SPOSet is optimizable."); } -void SPOSet::evaluateDerivRatios(const VirtualParticleSet& VP, - const opt_variables_type& optvars, - ValueVector& psi, - const ValueVector& psiinv, - std::vector& ratios, - Matrix& dratios, - int FirstIndex, - int LastIndex) +template +void SPOSet::evaluateDerivRatios(const VirtualParticleSet& VP, + const opt_variables_type& optvars, + ValueVector& psi, + const ValueVector& psiinv, + std::vector& ratios, + Matrix& dratios, + int FirstIndex, + int LastIndex) { // Match the fallback in WaveFunctionComponent that evaluates just the ratios evaluateDetRatios(VP, psi, psiinv, ratios); @@ -298,32 +328,33 @@ void SPOSet::evaluateDerivRatios(const VirtualParticleSet& VP, /** Evaluate the derivative of the optimized orbitals with respect to the parameters * this is used only for MSD, to be refined for better serving both single and multi SD */ -void SPOSet::evaluateDerivatives(ParticleSet& P, - const opt_variables_type& optvars, - Vector& dlogpsi, - Vector& dhpsioverpsi, - const ValueType& psiCurrent, - const std::vector& Coeff, - const std::vector& C2node_up, - const std::vector& C2node_dn, - const ValueVector& detValues_up, - const ValueVector& detValues_dn, - const GradMatrix& grads_up, - const GradMatrix& grads_dn, - const ValueMatrix& lapls_up, - const ValueMatrix& lapls_dn, - const ValueMatrix& M_up, - const ValueMatrix& M_dn, - const ValueMatrix& Minv_up, - const ValueMatrix& Minv_dn, - const GradMatrix& B_grad, - const ValueMatrix& B_lapl, - const std::vector& detData_up, - const size_t N1, - const size_t N2, - const size_t NP1, - const size_t NP2, - const std::vector>& lookup_tbl) +template +void SPOSet::evaluateDerivatives(ParticleSet& P, + const opt_variables_type& optvars, + Vector& dlogpsi, + Vector& dhpsioverpsi, + const Value& psiCurrent, + const std::vector& Coeff, + const std::vector& C2node_up, + const std::vector& C2node_dn, + const ValueVector& detValues_up, + const ValueVector& detValues_dn, + const GradMatrix& grads_up, + const GradMatrix& grads_dn, + const ValueMatrix& lapls_up, + const ValueMatrix& lapls_dn, + const ValueMatrix& M_up, + const ValueMatrix& M_dn, + const ValueMatrix& Minv_up, + const ValueMatrix& Minv_dn, + const GradMatrix& B_grad, + const ValueMatrix& B_lapl, + const std::vector& detData_up, + const size_t N1, + const size_t N2, + const size_t NP1, + const size_t NP2, + const std::vector>& lookup_tbl) { if (isOptimizable()) throw std::logic_error("Bug!! " + getClassName() + @@ -334,21 +365,22 @@ void SPOSet::evaluateDerivatives(ParticleSet& P, /** Evaluate the derivative of the optimized orbitals with respect to the parameters * this is used only for MSD, to be refined for better serving both single and multi SD */ -void SPOSet::evaluateDerivativesWF(ParticleSet& P, - const opt_variables_type& optvars, - Vector& dlogpsi, - const QTFull::ValueType& psiCurrent, - const std::vector& Coeff, - const std::vector& C2node_up, - const std::vector& C2node_dn, - const ValueVector& detValues_up, - const ValueVector& detValues_dn, - const ValueMatrix& M_up, - const ValueMatrix& M_dn, - const ValueMatrix& Minv_up, - const ValueMatrix& Minv_dn, - const std::vector& detData_up, - const std::vector>& lookup_tbl) +template +void SPOSet::evaluateDerivativesWF(ParticleSet& P, + const opt_variables_type& optvars, + Vector& dlogpsi, + const QMCTraits::QTFull::ValueType& psiCurrent, + const std::vector& Coeff, + const std::vector& C2node_up, + const std::vector& C2node_dn, + const ValueVector& detValues_up, + const ValueVector& detValues_dn, + const ValueMatrix& M_up, + const ValueMatrix& M_dn, + const ValueMatrix& Minv_up, + const ValueMatrix& Minv_dn, + const std::vector& detData_up, + const std::vector>& lookup_tbl) { if (isOptimizable()) throw std::logic_error("Bug!! " + getClassName() + @@ -357,12 +389,13 @@ void SPOSet::evaluateDerivativesWF(ParticleSet& P, } -void SPOSet::evaluateGradSource(const ParticleSet& P, - int first, - int last, - const ParticleSet& source, - int iat_src, - GradMatrix& gradphi) +template +void SPOSet::evaluateGradSource(const ParticleSet& P, + int first, + int last, + const ParticleSet& source, + int iat_src, + GradMatrix& gradphi) { if (hasIonDerivs()) throw std::logic_error("Bug!! " + getClassName() + @@ -370,14 +403,15 @@ void SPOSet::evaluateGradSource(const ParticleSet& P, "must be overloaded when the SPOSet has ion derivatives."); } -void SPOSet::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) +template +void SPOSet::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() + @@ -385,11 +419,12 @@ void SPOSet::evaluateGradSource(const ParticleSet& P, "must be overloaded when the SPOSet has ion derivatives."); } -void SPOSet::evaluateGradSourceRow(const ParticleSet& P, - int iel, - const ParticleSet& source, - int iat_src, - GradVector& gradphi) +template +void SPOSet::evaluateGradSourceRow(const ParticleSet& P, + int iel, + const ParticleSet& source, + int iat_src, + GradVector& gradphi) { if (hasIonDerivs()) throw std::logic_error("Bug!! " + getClassName() + @@ -397,10 +432,14 @@ void SPOSet::evaluateGradSourceRow(const ParticleSet& P, "must be overloaded when the SPOSet has ion derivatives."); } -void SPOSet::evaluate_spin(const ParticleSet& P, int iat, ValueVector& psi, ValueVector& dpsi) +template +void SPOSet::evaluate_spin(const ParticleSet& P, int iat, ValueVector& psi, ValueVector& dpsi) { throw std::runtime_error("Need specialization of " + getClassName() + "::evaluate_spin(P,iat,psi,dpsi) (vector quantities)\n"); } +template class SPOSet; +template class SPOSet; + } // namespace qmcplusplus diff --git a/src/QMCWaveFunctions/SPOSet.h b/src/QMCWaveFunctions/SPOSet.h index 4f7c8e81750..74581798af8 100644 --- a/src/QMCWaveFunctions/SPOSet.h +++ b/src/QMCWaveFunctions/SPOSet.h @@ -32,10 +32,12 @@ namespace qmcplusplus { class ResourceCollection; +template class SPOSet; namespace testing { -opt_variables_type& getMyVars(SPOSet& spo); +template +opt_variables_type& getMyVars(SPOSet& spo); } @@ -44,20 +46,25 @@ opt_variables_type& getMyVars(SPOSet& spo); * SPOSet stands for S(ingle)P(article)O(rbital)Set which contains * a number of single-particle orbitals with capabilities of evaluating \f$ \psi_j({\bf r}_i)\f$ */ -class SPOSet : public QMCTraits +template +class SPOSet { public: - using ValueVector = OrbitalSetTraits::ValueVector; - using ValueMatrix = OrbitalSetTraits::ValueMatrix; - using GradVector = OrbitalSetTraits::GradVector; - using GradMatrix = OrbitalSetTraits::GradMatrix; - using HessVector = OrbitalSetTraits::HessVector; - using HessMatrix = OrbitalSetTraits::HessMatrix; - using GGGVector = OrbitalSetTraits::GradHessVector; - using GGGMatrix = OrbitalSetTraits::GradHessMatrix; + using Grad = typename OrbitalSetTraits::GradType; + using Complex = std::complex::RealType>; + using PosType = QMCTraits::QTBase::PosType; + using IndexType = QMCTraits::IndexType; + using ValueVector = typename OrbitalSetTraits::ValueVector; + using ValueMatrix = typename OrbitalSetTraits::ValueMatrix; + using GradVector = typename OrbitalSetTraits::GradVector; + using GradMatrix = typename OrbitalSetTraits::GradMatrix; + using HessVector = typename OrbitalSetTraits::HessVector; + using HessMatrix = typename OrbitalSetTraits::HessMatrix; + using GGGVector = typename OrbitalSetTraits::GradHessVector; + using GGGMatrix = typename OrbitalSetTraits::GradHessMatrix; using SPOMap = std::map>; - using OffloadMWVGLArray = Array>; // [VGL, walker, Orbs] - using OffloadMWVArray = Array>; // [walker, Orbs] + using OffloadMWVGLArray = Array>; // [VGL, walker, Orbs] + using OffloadMWVArray = Array>; // [walker, Orbs] template using OffloadMatrix = Matrix>; @@ -121,15 +128,15 @@ class SPOSet : public QMCTraits /// Parameter derivatives of the wavefunction and the Laplacian of the wavefunction virtual void evaluateDerivatives(ParticleSet& P, const opt_variables_type& optvars, - Vector& dlogpsi, - Vector& dhpsioverpsi, + Vector& dlogpsi, + Vector& dhpsioverpsi, const int& FirstIndex, const int& LastIndex); /// Parameter derivatives of the wavefunction virtual void evaluateDerivativesWF(ParticleSet& P, const opt_variables_type& optvars, - Vector& dlogpsi, + Vector& dlogpsi, int FirstIndex, int LastIndex); @@ -138,10 +145,10 @@ class SPOSet : public QMCTraits */ virtual void evaluateDerivatives(ParticleSet& P, const opt_variables_type& optvars, - Vector& dlogpsi, - Vector& dhpsioverpsi, - const ValueType& psiCurrent, - const std::vector& Coeff, + Vector& dlogpsi, + Vector& dhpsioverpsi, + const Value& psiCurrent, //FIXME, why is this full precision as in evaluateDerivativesWF + const std::vector& Coeff, const std::vector& C2node_up, const std::vector& C2node_dn, const ValueVector& detValues_up, @@ -168,9 +175,9 @@ class SPOSet : public QMCTraits */ virtual void evaluateDerivativesWF(ParticleSet& P, const opt_variables_type& optvars, - Vector& dlogpsi, - const QTFull::ValueType& psiCurrent, - const std::vector& Coeff, + Vector& dlogpsi, + const QMCTraits::QTFull::ValueType& psiCurrent, //FIXME it is still a compile time type + const std::vector& Coeff, const std::vector& C2node_up, const std::vector& C2node_dn, const ValueVector& detValues_up, @@ -205,7 +212,7 @@ class SPOSet : public QMCTraits virtual void evaluateDetRatios(const VirtualParticleSet& VP, ValueVector& psi, const ValueVector& psiinv, - std::vector& ratios); + std::vector& ratios); /// Determinant ratios and parameter derivatives of the wavefunction for virtual moves @@ -213,8 +220,8 @@ class SPOSet : public QMCTraits const opt_variables_type& optvars, ValueVector& psi, const ValueVector& psiinv, - std::vector& ratios, - Matrix& dratios, + std::vector& ratios, + Matrix& dratios, int FirstIndex, int LastIndex); @@ -229,8 +236,8 @@ class SPOSet : public QMCTraits virtual void mw_evaluateDetRatios(const RefVectorWithLeader& spo_list, const RefVectorWithLeader& vp_list, const RefVector& psi_list, - const std::vector& invRow_ptr_list, - std::vector>& ratios_list) const; + const std::vector& invRow_ptr_list, + std::vector>& ratios_list) const; /** evaluate the values, gradients and laplacians of this single-particle orbital set * @param P current ParticleSet @@ -298,7 +305,7 @@ class SPOSet : public QMCTraits const RefVector& psi_v_list, const RefVector& dpsi_v_list, const RefVector& d2psi_v_list, - OffloadMatrix& mw_dspin) const; + OffloadMatrix& mw_dspin) const; /** evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ratio * and grads of multiple walkers. Device data of phi_vgl_v must be up-to-date upon return @@ -311,10 +318,10 @@ class SPOSet : public QMCTraits virtual void mw_evaluateVGLandDetRatioGrads(const RefVectorWithLeader& spo_list, const RefVectorWithLeader& P_list, int iat, - const std::vector& invRow_ptr_list, + const std::vector& invRow_ptr_list, OffloadMWVGLArray& phi_vgl_v, - std::vector& ratios, - std::vector& grads) const; + std::vector& ratios, + std::vector& grads) const; /** evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ratio * and grads of multiple walkers. Device data of phi_vgl_v must be up-to-date upon return. @@ -330,11 +337,11 @@ class SPOSet : public QMCTraits virtual void mw_evaluateVGLandDetRatioGradsWithSpin(const RefVectorWithLeader& spo_list, const RefVectorWithLeader& P_list, int iat, - const std::vector& invRow_ptr_list, + const std::vector& invRow_ptr_list, OffloadMWVGLArray& phi_vgl_v, - std::vector& ratios, - std::vector& grads, - std::vector& spingrads) const; + std::vector& ratios, + std::vector& grads, + std::vector& spingrads) const; /** evaluate the values, gradients and hessians of this single-particle orbital set * @param P current ParticleSet @@ -526,7 +533,7 @@ class SPOSet : public QMCTraits /** make a clone of itself * every derived class must implement this to have threading working correctly. */ - [[noreturn]] virtual std::unique_ptr makeClone() const; + [[noreturn]] virtual std::unique_ptr> makeClone() const; /** Used only by cusp correction in AOS LCAO. * Ye: the SoA LCAO moves all this responsibility to the builder. @@ -555,10 +562,8 @@ class SPOSet : public QMCTraits /// Optimizable variables opt_variables_type myVars; - friend opt_variables_type& testing::getMyVars(SPOSet& spo); + friend opt_variables_type& testing::getMyVars(SPOSet& spo); }; -using SPOSetPtr = SPOSet*; - } // namespace qmcplusplus #endif