18 #ifndef QMCPLUSPLUS_NONLOCAL_ECPOTENTIAL_H 19 #define QMCPLUSPLUS_NONLOCAL_ECPOTENTIAL_H 27 class NonLocalECPComponent;
33 class TestNonLocalECPotential;
50 std::string
getClassName()
const override {
return "NonLocalECPotential"; }
53 #if !defined(REMOVE_TRACEMANAGER) 101 std::vector<std::vector<ValueMatrix>>& Bforce)
override;
128 bool put(xmlNodePtr cur)
override {
return true; }
130 bool get(std::ostream& os)
const override 150 void addComponent(
int groupID, std::unique_ptr<NonLocalECPComponent>&& pp);
184 bool keepGrid =
false);
189 std::vector<NonLocalECPComponent*>
PP;
191 std::vector<std::unique_ptr<NonLocalECPComponent>>
PPset;
222 #if !defined(REMOVE_TRACEMANAGER) 245 bool keepGrid =
false);
Array< TraceReal, 1 > * Vi_sample
void resetTargetParticleSet(ParticleSet &P) override
Reset the data with the target ParticleSet.
const std::string & getName() const
return the name
Return_t evaluateWithToperator(ParticleSet &P) override
Evaluate the local energy contribution of this component with Toperators updated if requested...
helper functions for EinsplineSetBuilder
bool dependsOnWaveFunction() const override
return true if this operator depends on a wavefunction
QTBase::RealType RealType
class to violate access control because evaluation of NonLocalECPotential uses RNG which we may not b...
std::vector< NonLocalData > tmove_xy_
void setObservables(PropertySetType &plist) override
Set the values evaluated by this object to plist Default implementation is to assign Value which is u...
void acquireResource(ResourceCollection &collection, const RefVectorWithLeader< OperatorBase > &o_list) const override
acquire a shared resource from a collection
ResourceHandle manages the temporary resource referenced from a collection.
void releaseResource(ResourceCollection &collection, const RefVectorWithLeader< OperatorBase > &o_list) const override
return a shared resource to a collection
Declaration of OperatorBase.
std::string getClassName() const override
return class name
An object of this type is a listener expecting a callback to the report function with a vector of val...
int thingsThatShouldBeInMyConstructor(const std::string &non_local_move_option, const double tau, const double alpha, const double gamma)
replacement for put because wouldn't it be cool to know what the classes configuration actually is...
Declaration of NonLocalTOperator.
void evaluateOneBodyOpMatrixForceDeriv(ParticleSet &P, ParticleSet &source, const TWFFastDerivWrapper &psi, const int iat, std::vector< std::vector< ValueMatrix >> &Bforce) override
Evaluate "dB/dR" matrices for observable.
ParticleSet & IonConfig
reference to the center ion
std::vector< NonLocalECPComponent * > PP
the set of local-potentials (one for each ion)
int myTableIndex
index of distance table for the ion-el pair
~NonLocalECPotential() override
NonLocalTOperator nonLocalOps
non local operator
bool ComputeForces
true if we should compute forces
Attaches a unit to a Vector for IO.
TWFFastDerivWrapper is a wrapper class for TrialWavefunction that provides separate and low level acc...
void registerObservables(std::vector< ObservableHelper > &h5list, hdf_archive &file) const override
add to observable descriptor for hdf5 The default implementation is to register a scalar for this->va...
ResourceHandle< NonLocalECPotentialMultiWalkerResource > mw_res_handle_
mult walker shared resource
Array< TraceReal, 1 > * Ve_sample
single particle trace samples
Specialized paritlce class for atomistic simulations.
ParticleSet::Buffer_t BufferType
typedef for the serialized buffer
void evaluateOneBodyOpMatrix(ParticleSet &P, const TWFFastDerivWrapper &psi, std::vector< ValueMatrix > &B) override
Evaluate "B" matrix for observable.
int makeNonLocalMovesPbyP(ParticleSet &P)
make non local moves with particle-by-particle moves
Return_t evaluateValueAndDerivatives(ParticleSet &P, const opt_variables_type &optvars, const Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi) override
void createResource(ResourceCollection &collection) const override
initialize a shared resource and hand it to a collection
static void mw_evaluateImpl(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, bool Tmove, std::optional< ListenerOption< Real >> listeners, bool keepGrid=false)
the actual implementation for batched walkers, used by mw_evaluate, mw_evaluateWithToperator mw_evalu...
ParticleSet & Peln
reference to the electrons
void computeOneElectronTxy(ParticleSet &P, const int ref_elec)
compute the T move transition probability for a given electron member variable nonLocalOps.Txy is updated
AB type of DistanceTable containing storage.
void mw_evaluate(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list) const override
Evaluate the contribution of this component of multiple walkers.
class to handle a set of variables that can be modified during optimizations
void addComponent(int groupID, std::unique_ptr< NonLocalECPComponent > &&pp)
int put(xmlNodePtr cur)
initialize the parameters
RandomBase< FullPrecRealType > * myRNG
random number generator
void checkoutParticleQuantities(TraceManager &tm) override
void evaluateImpl(ParticleSet &P, bool Tmove, bool keepGrid=false)
the actual implementation, used by evaluate and evaluateWithToperator
NeighborLists IonNeighborElecs
neighborlist of ions
void setNonLocalMoves(xmlNodePtr cur)
set non local moves options
NonLocalECPotential(ParticleSet &ions, ParticleSet &els, TrialWaveFunction &psi, bool computeForces, bool enable_DLA)
constructor
An abstract class for Local Energy operators.
bool use_DLA
true, determinant localization approximation(DLA) is enabled
Return_t evaluateWithIonDerivs(ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_terms, ParticleSet::ParticlePos &pulay_terms) override
Evaluate contribution to local energy and derivatives w.r.t ionic coordinates from OperatorBase...
void setRandomGenerator(RandomBase< FullPrecRealType > *rng) override
set the internal RNG pointer as the given pointer
Evaluate the semi local potentials.
NeighborLists ElecNeighborIons
neighborlist of electrons
Class to represent a many-body trial wave function.
void addObservables(PropertySetType &plist, BufferType &collectables) override
named values to the property list Default implementaton uses addValue(plist_)
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
void markAffectedElecs(const DistanceTableAB &myTable, int iel)
mark all the electrons affected by Tmoves and update ElecNeighborIons and IonNeighborElecs ...
std::vector< std::vector< NLPPJob< Real > > > nlpp_jobs
NLPP job list of ion-electron pairs by spin group.
void mw_evaluateWithToperator(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list) const override
Evaluate the contribution of this component of multiple walkers.
std::vector< bool > elecTMAffected
ture if an electron is affected by other electrons moved by T-moves
int NumIons
number of ions
Return_t evaluateWithIonDerivsDeterministic(ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_terms, ParticleSet::ParticlePos &pulay_terms) override
Evaluate contribution to local energy and derivatives w.r.t ionic coordinates from OperatorBase...
Return_t evaluateDeterministic(ParticleSet &P) override
Evaluate the local energy contribution of this component, deterministically based on current state...
void setComputeForces(bool val) override
Set the flag whether to compute forces or not.
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) override
void contributeParticleQuantities() override
double B(double x, int k, int i, const std::vector< double > &t)
std::vector< std::unique_ptr< NonLocalECPComponent > > PPset
unique NonLocalECPComponent to remove
ParticleSet::ParticlePos PulayTerm
Pulay force vector.
void evalIonDerivsImpl(ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_terms, ParticleSet::ParticlePos &pulay_terms, bool keepGrid=false)
void mw_evaluatePerParticleWithToperator(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< ListenerVector< Real >> &listeners, const std::vector< ListenerVector< Real >> &listeners_ions) const override
void setParticlePropertyList(PropertySetType &plist, int offset) override
Convenience container for common optional element to mw_eval.._impl.
TrialWaveFunction & Psi
target TrialWaveFunction
void setNonLocalMoves(const std::string &non_local_move_option, const double tau, const double alpha, const double gamma)
BareKineticEnergy::Return_t Return_t
void deleteParticleQuantities() override
void mw_evaluatePerParticle(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< ListenerVector< Real >> &listeners, const std::vector< ListenerVector< Real >> &listeners_ions) const override
RecordNamedProperty< FullPrecRealType > PropertySetType
define PropertyList_t
bool put(xmlNodePtr cur) override
Do nothing.