mirror of https://github.com/QMCPACK/qmcpack.git
Merge branch 'develop' into reduce-nlpp-options-doc
This commit is contained in:
commit
9a6b615ffb
|
@ -79,6 +79,7 @@ public:
|
|||
virtual std::string getClassName() const override { return "SplineR2R"; }
|
||||
virtual std::string getKeyword() const override { return "SplineR2R"; }
|
||||
bool isComplex() const override { return false; };
|
||||
bool isRotationSupported() const override { return true; }
|
||||
|
||||
std::unique_ptr<SPOSet> makeClone() const override { return std::make_unique<SplineR2R>(*this); }
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ public:
|
|||
|
||||
virtual std::string getClassName() const override { return "LCAOrbitalSet"; }
|
||||
|
||||
bool isRotationSupported() const override { return true; }
|
||||
|
||||
bool hasIonDerivs() const override { return true; }
|
||||
|
||||
std::unique_ptr<SPOSet> makeClone() const override;
|
||||
|
|
|
@ -232,6 +232,89 @@ void SPOSet::evaluateVGHGH(const ParticleSet& P,
|
|||
"::evaluate(P,iat,psi,dpsi,dhpsi,dghpsi) (vector quantities)\n");
|
||||
}
|
||||
|
||||
void SPOSet::applyRotation(const ValueMatrix& rot_mat, bool use_stored_copy)
|
||||
{
|
||||
if (isRotationSupported())
|
||||
throw std::logic_error("Bug!! " + getClassName() +
|
||||
"::applyRotation "
|
||||
"must be overloaded when the SPOSet supports rotation.");
|
||||
}
|
||||
|
||||
void SPOSet::evaluateDerivatives(ParticleSet& P,
|
||||
const opt_variables_type& optvars,
|
||||
Vector<ValueType>& dlogpsi,
|
||||
Vector<ValueType>& dhpsioverpsi,
|
||||
const int& FirstIndex,
|
||||
const int& LastIndex)
|
||||
{
|
||||
if (isOptimizable())
|
||||
throw std::logic_error("Bug!! " + getClassName() +
|
||||
"::evaluateDerivatives "
|
||||
"must be overloaded when the SPOSet is optimizable.");
|
||||
}
|
||||
|
||||
/** 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<ValueType>& dlogpsi,
|
||||
Vector<ValueType>& dhpsioverpsi,
|
||||
const ValueType& psiCurrent,
|
||||
const std::vector<ValueType>& Coeff,
|
||||
const std::vector<size_t>& C2node_up,
|
||||
const std::vector<size_t>& 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<int>& detData_up,
|
||||
const size_t N1,
|
||||
const size_t N2,
|
||||
const size_t NP1,
|
||||
const size_t NP2,
|
||||
const std::vector<std::vector<int>>& lookup_tbl)
|
||||
{
|
||||
if (isOptimizable())
|
||||
throw std::logic_error("Bug!! " + getClassName() +
|
||||
"::evaluateDerivatives "
|
||||
"must be overloaded when the SPOSet is optimizable.");
|
||||
}
|
||||
|
||||
/** 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<ValueType>& dlogpsi,
|
||||
const QTFull::ValueType& psiCurrent,
|
||||
const std::vector<ValueType>& Coeff,
|
||||
const std::vector<size_t>& C2node_up,
|
||||
const std::vector<size_t>& 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<int>& detData_up,
|
||||
const std::vector<std::vector<int>>& lookup_tbl)
|
||||
{
|
||||
if (isOptimizable())
|
||||
throw std::logic_error("Bug!! " + getClassName() +
|
||||
"::evaluateDerivativesWF "
|
||||
"must be overloaded when the SPOSet is optimizable.");
|
||||
}
|
||||
|
||||
|
||||
void SPOSet::evaluateGradSource(const ParticleSet& P,
|
||||
int first,
|
||||
int last,
|
||||
|
@ -239,7 +322,10 @@ void SPOSet::evaluateGradSource(const ParticleSet& P,
|
|||
int iat_src,
|
||||
GradMatrix& gradphi)
|
||||
{
|
||||
throw std::runtime_error("SPOSetBase::evalGradSource is not implemented");
|
||||
if (hasIonDerivs())
|
||||
throw std::logic_error("Bug!! " + getClassName() +
|
||||
"::evaluateGradSource "
|
||||
"must be overloaded when the SPOSet has ion derivatives.");
|
||||
}
|
||||
|
||||
void SPOSet::evaluateGradSource(const ParticleSet& P,
|
||||
|
@ -251,7 +337,10 @@ void SPOSet::evaluateGradSource(const ParticleSet& P,
|
|||
HessMatrix& grad_grad_phi,
|
||||
GradMatrix& grad_lapl_phi)
|
||||
{
|
||||
throw std::runtime_error("SPOSetBase::evalGradSource is not implemented");
|
||||
if (hasIonDerivs())
|
||||
throw std::logic_error("Bug!! " + getClassName() +
|
||||
"::evaluateGradSource "
|
||||
"must be overloaded when the SPOSet has ion derivatives.");
|
||||
}
|
||||
|
||||
void SPOSet::evaluateGradSourceRow(const ParticleSet& P,
|
||||
|
@ -260,7 +349,10 @@ void SPOSet::evaluateGradSourceRow(const ParticleSet& P,
|
|||
int iat_src,
|
||||
GradVector& gradphi)
|
||||
{
|
||||
throw std::runtime_error("SPOSetBase::evalGradSourceRow is not implemented");
|
||||
if (hasIonDerivs())
|
||||
throw std::logic_error("Bug!! " + getClassName() +
|
||||
"::evaluateGradSourceRow "
|
||||
"must be overloaded when the SPOSet has ion derivatives.");
|
||||
}
|
||||
|
||||
void SPOSet::evaluate_spin(const ParticleSet& P, int iat, ValueVector& psi, ValueVector& dpsi)
|
||||
|
|
|
@ -115,23 +115,20 @@ public:
|
|||
virtual void buildOptVariables(const size_t nel) {}
|
||||
// For the MSD case rotations must be created in MultiSlaterDetTableMethod class
|
||||
virtual void buildOptVariables(const std::vector<std::pair<int, int>>& rotations) {}
|
||||
// store parameters before getting destroyed by rotation.
|
||||
/// return true if this SPOSet can be wrappered by RotatedSPO
|
||||
virtual bool isRotationSupported() const { return false; }
|
||||
/// store parameters before getting destroyed by rotation.
|
||||
virtual void storeParamsBeforeRotation() {}
|
||||
// apply rotation to all the orbitals
|
||||
virtual void applyRotation(const ValueMatrix& rot_mat, bool use_stored_copy = false)
|
||||
{
|
||||
std::ostringstream o;
|
||||
o << "SPOSet::applyRotation is not implemented by " << getClassName() << std::endl;
|
||||
APP_ABORT(o.str());
|
||||
}
|
||||
/// apply rotation to all the orbitals
|
||||
virtual void applyRotation(const ValueMatrix& rot_mat, bool use_stored_copy = false);
|
||||
|
||||
virtual void evaluateDerivatives(ParticleSet& P,
|
||||
const opt_variables_type& optvars,
|
||||
Vector<ValueType>& dlogpsi,
|
||||
Vector<ValueType>& dhpsioverpsi,
|
||||
const int& FirstIndex,
|
||||
const int& LastIndex)
|
||||
{}
|
||||
const int& LastIndex);
|
||||
|
||||
/** 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
|
||||
*/
|
||||
|
@ -160,8 +157,7 @@ public:
|
|||
const size_t N2,
|
||||
const size_t NP1,
|
||||
const size_t NP2,
|
||||
const std::vector<std::vector<int>>& lookup_tbl)
|
||||
{}
|
||||
const std::vector<std::vector<int>>& lookup_tbl);
|
||||
|
||||
/** 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
|
||||
|
@ -180,8 +176,7 @@ public:
|
|||
const ValueMatrix& Minv_up,
|
||||
const ValueMatrix& Minv_dn,
|
||||
const std::vector<int>& detData_up,
|
||||
const std::vector<std::vector<int>>& lookup_tbl)
|
||||
{}
|
||||
const std::vector<std::vector<int>>& lookup_tbl);
|
||||
|
||||
/** set the OrbitalSetSize
|
||||
* @param norbs number of single-particle orbitals
|
||||
|
|
|
@ -98,6 +98,9 @@ std::unique_ptr<SPOSet> SPOSetBuilder::createSPOSet(xmlNodePtr cur)
|
|||
// create sposet with rotation
|
||||
auto& sposet_ref = *sposet;
|
||||
app_log() << " SPOSet " << sposet_ref.getName() << " is optimizable\n";
|
||||
if (!sposet_ref.isRotationSupported())
|
||||
myComm->barrier_and_abort("Orbital rotation not supported with '" + sposet_ref.getName() + "' of type '" +
|
||||
sposet_ref.getClassName() + "'.");
|
||||
auto rot_spo = std::make_unique<RotatedSPOs>(sposet_ref.getName(), std::move(sposet));
|
||||
xmlNodePtr tcur = cur->xmlChildrenNode;
|
||||
while (tcur != NULL)
|
||||
|
|
Loading…
Reference in New Issue