28 first_force_index_(-1),
30 fastDerivatives_(false),
48 APP_ABORT(
"ACForce::makeClone(ParticleSet&,TrialWaveFunction&) shouldn't be called");
54 std::unique_ptr<ACForce> myclone = std::make_unique<ACForce>(
ions_, qp, psi_in, ham_in);
65 std::string ionionforce(
"yes");
69 attr.
add(swpow,
"swpow");
75 throw std::runtime_error(
"ACForce::put(): epsilon<0 not allowed.");
77 app_log() <<
"ACForce is using the fast force algorithm\n";
79 app_log() <<
"ACForce is using the default algorithm\n";
83 app_log() <<
"ACForce is using space warp with power=" << swpow << std::endl;
85 app_log() <<
"ACForce is not using space warp\n";
95 std::unique_ptr<OperatorBase> myclone =
makeClone(qp, psi, ham_in);
145 const std::string iatStr(std::to_string(iat));
149 const std::string xStr(std::to_string(x));
151 const std::string hfname(
"ACForce_hf_" + iatStr +
"_" + xStr);
152 const std::string pulayname(
"ACForce_pulay_" + iatStr +
"_" + xStr);
153 const std::string wfgradname1(
"ACForce_Ewfgrad_" + iatStr +
"_" + xStr);
154 const std::string wfgradname2(
"ACForce_wfgrad_" + iatStr +
"_" + xStr);
157 plist.
add(pulayname);
158 plist.
add(wfgradname1);
159 plist.
add(wfgradname2);
170 for (
int iondim = 0; iondim <
OHMMS_DIM; iondim++)
186 for (
int iondim = 0; iondim <
OHMMS_DIM; iondim++)
204 #if defined(QMC_COMPLEX) 217 double xovereps = 1.0 / (epsilon * gmag);
FullPrecRealType evaluateIonDerivsDeterministicFast(ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi_in, TWFFastDerivWrapper &psi_wrapper, ParticleSet::ParticlePos &dedr, ParticleSet::ParticlePos &wf_grad)
evaluate local energy and derivatives w.r.t ionic coordinates, but deterministically.
static RealType compute_regularizer_f(const ParticleGradient &G, const RealType epsilon)
Computes multiplicative regularizer f(G,epsilon) according to Pathak-Wagner arXiv:2002.01434 .
Return_t evaluate(ParticleSet &P) final
Evaluate.
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
void addOperator(std::unique_ptr< OperatorBase > &&h, const std::string &aname, bool physical=true)
add an operator
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
size_t getTotalNum() const
bool put(xmlNodePtr cur)
assign attributes to the set
RealType delta_
Finite difference timestep.
Collection of Local Energy Operators.
bool get(std::ostream &os) const final
write about the class
void setPow(RealType swpow_in)
Sets the exponent for power law space warp transformation.
Vectorized record engine for scalar properties.
void addObservables(PropertySetType &plist, BufferType &collectables) final
named values to the property list Default implementaton uses addValue(plist_)
Attaches a unit to a Vector for IO.
SpaceWarpTransformation swt_
The space warp transformation class.
ParticleSet::ParticlePos Forces
void setObservables(PropertySetType &plist) final
Set the values evaluated by this object to plist Default implementation is to assign Value which is u...
T Dot(const ParticleAttrib< TinyVector< T, D >> &pa, const ParticleAttrib< TinyVector< T, D >> &pb)
void setParticlePropertyList(PropertySetType &plist, int offset) final
ParticleSet::ParticleGradient G
differential gradients
MakeReturn< BinaryNode< FnPow, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t, typename CreateLeaf< Vector< T2, C2 > >::Leaf_t > >::Expression_t pow(const Vector< T1, C1 > &l, const Vector< T2, C2 > &r)
std::string name_
name of this object
Specialized paritlce class for atomistic simulations.
void computeSWT(ParticleSet &elec, const ParticleSet &ions, Force_t &dEl, ParticleGradient &dlogpsi, Force_t &el_contribution, Force_t &psi_contribution)
Takes in precomputed grad(E_L) and grad(logPsi) and computes the ZV and ZB space warp contributions t...
int add(const std::string &aname)
bool put(xmlNodePtr cur) final
I/O Routines.
class to handle a set of attributes of an xmlNode
ParticleGradient G
gradients of the particles
ACForce(ParticleSet &source, ParticleSet &target, TrialWaveFunction &psi, QMCHamiltonian &H)
Constructor.
FullPrecRealType evaluateIonDerivsDeterministic(ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_terms, ParticleSet::ParticlePos &pulay_terms, ParticleSet::ParticlePos &wf_grad)
evaluate local energy and derivatives w.r.t ionic coordinates, but deterministically.
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
void setName(const std::string name) noexcept
Set my_name member, uses small string optimization (pass by value)
void evaluateElecGrad(ParticleSet &P, TrialWaveFunction &psi, ParticleSet::ParticlePos &EGrad, RealType delta=1e-5)
Evaluate the electron gradient of the local energy.
FullPrecRealType Return_t
type of return value of evaluate
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
Class to represent a many-body trial wave function.
Return_t value_
current value
double Dot_CC(const ParticleAttrib< TinyVector< std::complex< double >, D >> &pa, const ParticleAttrib< TinyVector< std::complex< double >, D >> &pb)
Declaraton of ParticleAttrib<T>
void add2Hamiltonian(ParticleSet &qp, TrialWaveFunction &psi, QMCHamiltonian &targetH) final
Since we store a reference to QMCHamiltonian, the baseclass method add2Hamiltonian isn't sufficient...
void resetTargetParticleSet(ParticleSet &P) final
Initialization/assignment.
Declaration of ACForce, Assaraf-Caffarel ZVZB style force estimation.
IndexType first_force_index_
For indexing observables.
TWFFastDerivWrapper psi_wrapper_
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
bool useSpaceWarp_
Algorithm/feature switches.
Forces hf_force_
Temporary Nion x 3 dimensional arrays for force storage.
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) final
Cloning.
std::bitset< 8 > update_mode_
set the current update mode
void initializeTWFFastDerivWrapper(const ParticleSet &P, TWFFastDerivWrapper &twf) const
Initialize a TWF wrapper for fast derivative evaluation.