23 #ifndef QMCPLUSPLUS_HAMILTONIANBASE_H 24 #define QMCPLUSPLUS_HAMILTONIANBASE_H 32 #if !defined(REMOVE_TRACEMANAGER) 42 class MCWalkerConfiguration;
48 class TrialWaveFunction;
50 class ResourceCollection;
157 void setName(const
std::
string name) noexcept;
159 #if !defined(REMOVE_TRACEMANAGER) 183 virtual bool get(std::ostream& os)
const = 0;
389 std::vector<ValueMatrix>&
B)
406 std::vector<std::vector<ValueMatrix>>& Bforce)
460 #if !defined(REMOVE_TRACEMANAGER) 483 bool getMode(const
int i) const noexcept;
494 #if !defined(REMOVE_TRACEMANAGER) 529 #if !defined(REMOVE_TRACEMANAGER) 543 #if !defined(REMOVE_TRACEMANAGER) 554 virtual bool put(xmlNodePtr cur) = 0;
558 #if !defined(REMOVE_TRACEMANAGER) 602 #if !defined(REMOVE_TRACEMANAGER) bool hasListener() const noexcept
virtual void mw_evaluate(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list) const
Evaluate the contribution of this component of multiple walkers.
virtual std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi)=0
void twoBodyQuantumDomain(const ParticleSet &P)
set quantum domain for two-body operator
bool streaming_particles_
Walker< QMCTraits, PtclOnLatticeTraits > Walker_t
walker type
virtual void resetTargetParticleSet(ParticleSet &P)=0
Reset the data with the target ParticleSet.
virtual void contributeScalarQuantities()
virtual void releaseResource(ResourceCollection &collection, const RefVectorWithLeader< OperatorBase > &o_list) const
Return a shared resource to a collection.
virtual void registerObservables(std::vector< ObservableHelper > &h5desc, hdf_archive &file) const
add to observable descriptor for hdf5 The default implementation is to register a scalar for this->va...
helper functions for EinsplineSetBuilder
virtual void acquireResource(ResourceCollection &collection, const RefVectorWithLeader< OperatorBase > &o_list) const
Acquire a shared resource from a collection.
virtual void mw_evaluateWithParameterDerivatives(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< ParticleSet > &p_list, const opt_variables_type &optvars, const RecordArray< ValueType > &dlogpsi, RecordArray< ValueType > &dhpsioverpsi) const
TODO: add docs.
bool isQuantumClassical() const noexcept
PooledData< RealType > Buffer_t
buffer type for a serialized buffer
void collectScalarTraces()
Collect scalar trace data.
int my_index_
starting index of this object
virtual Return_t rejectedMove(ParticleSet &P)
TODO: add docs.
virtual void add2Hamiltonian(ParticleSet &qp, TrialWaveFunction &psi, QMCHamiltonian &targetH)
TODO: add docs.
Collection of Local Energy Operators.
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
An object of this type is a listener expecting a callback to the report function with a vector of val...
SPOSet::GradMatrix GradMatrix
bool energyDomainValid(EnergyDomains edomain) const noexcept
return whether the energy domain is valid
Vectorized record engine for scalar properties.
virtual bool put(xmlNodePtr cur)=0
Read the input parameter.
virtual void getRequiredTraces(TraceManager &tm)
TODO: add docs.
virtual void collectScalarQuantities()
Attaches a unit to a Vector for IO.
TWFFastDerivWrapper is a wrapper class for TrialWavefunction that provides separate and low level acc...
virtual void createResource(ResourceCollection &collection) const
Initialize a shared resource and hand it to a collection.
virtual Return_t evaluateValueAndDerivatives(ParticleSet &P, const opt_variables_type &optvars, const Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi)
Evaluate value and derivatives wrt the optimizables.
TraceRequest request_
whether traces are being collected
virtual void setRandomGenerator(RandomBase< FullPrecRealType > *rng)
Set the Random Generator object TODO: add docs.
OperatorBase()
Construct a new Operator Base object Default and unique empty constructor.
SPOSet::SPOMap SPOMap
typedef for SPOMap
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
Declaration of ObservableHelper and other helper class for observables.
virtual void deleteParticleQuantities()
std::string name_
name of this object
std::bitset< 8 > & getUpdateMode() noexcept
get update_mode_ reference
Specialized paritlce class for atomistic simulations.
TraceRequest & getRequest() noexcept
Get request_ member.
ParticleSet::Buffer_t BufferType
typedef for the serialized buffer
virtual void evaluateOneBodyOpMatrix(ParticleSet &P, const TWFFastDerivWrapper &psi, std::vector< ValueMatrix > &B)
Evaluate "B" matrix for observable.
Array< RealType, 1 > * value_sample_
array to store sample value
virtual void addObservables(PropertySetType &plist, BufferType &collectables)
named values to the property list Default implementaton uses addValue(plist_)
Return_t new_value_
a new value for a proposed move
virtual void mw_evaluatePerParticleWithToperator(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< ListenerVector< RealType >> &listeners, const std::vector< ListenerVector< RealType >> &listeners_ions) const
Evaluate the contribution of this component of multiple walkers per particle and report to registerd ...
bool isNonLocal() const noexcept
TODO: add docs.
EnergyDomains
enum to denote energy domain of operators
virtual void contributeParticleQuantities()
virtual void mw_evaluatePerParticle(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< ListenerVector< RealType >> &listeners, const std::vector< ListenerVector< RealType >> &listeners_ions) const
Evaluate the contribution of this component of multiple walkers per particle and report to registerd ...
bool has_listener_
Is there a per particle listener sadly this is necessary due to state machines.
bool quantumDomainValid(QuantumDomains qdomain) const noexcept
return whether the quantum domain is valid
void oneBodyQuantumDomain(const ParticleSet &P)
set quantum domain for one-body operator
SPOSet::ValueMatrix ValueMatrix
For fast derivative evaluation.
bool isQuantum() const noexcept
class to handle a set of variables that can be modified during optimizations
bool isClassicalClassical() const noexcept
virtual Return_t evaluateWithIonDerivsDeterministic(ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_term, ParticleSet::ParticlePos &pulay_term)
Evaluate contribution to local energy and derivatives w.r.t ionic coordinates from OperatorBase...
QTFull::RealType Scalar_t
virtual Return_t evaluateWithIonDerivs(ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_term, ParticleSet::ParticlePos &pulay_term)
Evaluate contribution to local energy and derivatives w.r.t ionic coordinates from OperatorBase...
void setEnergyDomain(EnergyDomains edomain)
Set the Energy Domain.
void setName(const std::string name) noexcept
Set my_name member, uses small string optimization (pass by value)
bool getMode(const int i) const noexcept
Return the mode i.
Walker_t * t_walker_
reference to the current walker
virtual void setHistories(Walker_t &ThisWalker)
void addValue(PropertySetType &plist)
named values to the property list
Return_t getValue() const noexcept
get a copy of value_
virtual Return_t getEnsembleAverage()
Return an average value by collective operation.
virtual void updateSource(ParticleSet &s)
Update data associated with a particleset.
bool have_required_traces_
ParticleSet::Scalar_t ParticleScalar
typedef for the ParticleScalar
An abstract class for Local Energy operators.
FullPrecRealType Return_t
type of return value of evaluate
void checkoutTraceQuantities(TraceManager &tm)
Checkout trace arrays Derived classes must guard individual checkouts using request info...
virtual void setParticlePropertyList(PropertySetType &plist, int offset)
ParticleSet::Walker_t Walker_t
typedef for the walker
Class to represent a many-body trial wave function.
bool isQuantumQuantum() const noexcept
Return_t value_
current value
std::map< std::string, const std::unique_ptr< const SPOSet > > SPOMap
virtual Return_t evaluateWithToperator(ParticleSet &P)
Evaluate the local energy contribution of this component with Toperators updated if requested...
std::string getName() const noexcept
getter a copy of my_name_, rvalue small string optimization
virtual void mw_evaluateWithToperator(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list) const
Evaluate the contribution of this component of multiple walkers.
virtual void informOfPerParticleListener()
virtual Return_t evaluate(ParticleSet &P)=0
Evaluate the local energy contribution of this component.
virtual Return_t evaluateDeterministic(ParticleSet &P)
Evaluate the local energy contribution of this component, deterministically based on current state...
bool isClassical() const noexcept
QTFull::RealType FullPrecRealType
virtual void setObservables(PropertySetType &plist)
Set the values evaluated by this object to plist Default implementation is to assign Value which is u...
void deleteTraceQuantities()
delete trace arrays
double B(double x, int k, int i, const std::vector< double > &t)
virtual ~OperatorBase()=default
virtual bool dependsOnWaveFunction() const
return true if this operator depends on a wavefunction
QuantumDomains quantum_domain_
quantum_domain_ of the (particle) operator, default = no_quantum_domain
Declare a global Random Number Generator.
virtual void setComputeForces(bool compute)
virtual void checkoutParticleQuantities(TraceManager &tm)
virtual std::string getClassName() const =0
return class name
A container class to represent a walker.
virtual void deleteScalarQuantities()
EnergyDomains energy_domain_
energy domain of the operator (kinetic/potential), default = no_energy_domain
void contributeTraceQuantities()
Make trace quantities available.
virtual void evaluateOneBodyOpMatrixForceDeriv(ParticleSet &P, ParticleSet &source, const TWFFastDerivWrapper &psi, const int iat, std::vector< std::vector< ValueMatrix >> &Bforce)
Evaluate "dB/dR" matrices for observable.
Listener types that allow Estimators to register with QMCHamiltonian to have "trace" values from oper...
void setQuantumDomain(QuantumDomains qdomain)
set quantum domain
std::bitset< 8 > update_mode_
set the current update mode
BareKineticEnergy::Return_t Return_t
virtual void checkoutScalarQuantities(TraceManager &tm)
virtual void registerCollectables(std::vector< ObservableHelper > &h5desc, hdf_archive &file) const
RecordNamedProperty< FullPrecRealType > PropertySetType
define PropertyList_t