QMCPACK
DriftModifierBase.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2020 QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef QMCPLUSPLUS_DRIFTMODIFIER_BASE_H
14 #define QMCPLUSPLUS_DRIFTMODIFIER_BASE_H
15 
16 #include "Configuration.h"
17 #include "Particle/ParticleSet.h"
21 #include "TauParams.hpp"
22 
23 namespace qmcplusplus
24 {
25 /// this class implements drift modification
27 {
28 public:
33 
34  /** evaluate a drift with a real force
35  * @param tau timestep
36  * @param qf quantum force
37  * @param drift output
38  */
39  virtual void getDrift(RealType tau, const GradType& qf, PosType& drift) const = 0;
40 
41  virtual void getDrift(RealType tau, const ComplexType& qf, ParticleSet::Scalar_t& drift) const = 0;
42 
43  virtual void getDrifts(RealType tau, const std::vector<GradType>& qf, std::vector<PosType>&) const = 0;
44 
45  virtual void getDrifts(RealType tau,
46  const std::vector<ComplexType>& qf,
47  std::vector<ParticleSet::Scalar_t>&) const = 0;
48 
49  template<CoordsType CT>
50  void getDrifts(const TauParams<RealType, CT>& taus, const TWFGrads<CT>& qf, MCCoords<CT>& drifts) const;
51 
52  virtual bool parseXML(xmlNodePtr cur) { return true; }
53 
54  virtual ~DriftModifierBase() {}
55 
56 protected:
57  // modifer name
58  std::string ClassName;
59 };
60 
61 template<CoordsType CT>
63 {
64  getDrifts(taus.tauovermass, qf.grads_positions, drifts.positions);
65  if constexpr (CT == CoordsType::POS_SPIN)
66  getDrifts(taus.spin_tauovermass, qf.grads_spins, drifts.spins);
67 }
68 
69 } // namespace qmcplusplus
70 
71 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QTBase::GradType GradType
Definition: Configuration.h:62
QTBase::RealType RealType
Definition: Configuration.h:58
virtual void getDrifts(RealType tau, const std::vector< GradType > &qf, std::vector< PosType > &) const =0
this class implements drift modification
Object to encapsulate appropriate tau derived parameters for a particular CoordsType specialization...
Definition: TauParams.hpp:25
QTBase::ComplexType ComplexType
Definition: Configuration.h:59
virtual bool parseXML(xmlNodePtr cur)
QTBase::PosType PosType
Definition: Configuration.h:61
Declaration of a TrialWaveFunction.
QMCTraits::ComplexType ComplexType
virtual void getDrift(RealType tau, const GradType &qf, PosType &drift) const =0
evaluate a drift with a real force
Declaration of QMCHamiltonian.