QMCPACK
RPAJastrow.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) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Jordan E. Vincent, University of Illinois at Urbana-Champaign
8 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
9 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
10 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
11 //
12 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
13 //////////////////////////////////////////////////////////////////////////////////////
14 
15 
16 #ifndef QMCPLUSPLUS_RPA_JASTROW_H
17 #define QMCPLUSPLUS_RPA_JASTROW_H
18 
25 
26 namespace qmcplusplus
27 {
28 /** JastrowBuilder using RPA functor
29  * Modification of RPAJastrow
30  *
31  */
33 {
37 
38 public:
39  RPAJastrow(ParticleSet& target);
40 
41  ~RPAJastrow() override;
42 
43  std::string getClassName() const override { return "RPAJastrow"; }
44 
45  bool put(xmlNodePtr cur);
46 
47  void buildOrbital(const std::string& name,
48  const std::string& UL,
49  const std::string& US,
50  const std::string& RF,
51  RealType R,
52  RealType K);
53 
54  void makeShortRange();
55  void makeLongRange();
56 
57  void setHandler(std::unique_ptr<HandlerType> Handler) { myHandler = std::move(Handler); };
58 
59  bool isOptimizable() const override { return true; }
60  /** check out optimizable variables
61  */
62  void checkOutVariables(const opt_variables_type& o) override;
63 
64  void extractOptimizableObjectRefs(UniqueOptObjRefs& opt_obj_refs) override
65  {
66  opt_obj_refs.push_back(*LongRangeRPA);
68  }
69 
72  ParticleSet::ParticleLaplacian& L) override;
73 
74  PsiValue ratio(ParticleSet& P, int iat) override;
75  GradType evalGrad(ParticleSet& P, int iat) override;
76  PsiValue ratioGrad(ParticleSet& P, int iat, GradType& grad_iat) override;
77 
78  void acceptMove(ParticleSet& P, int iat, bool safe_to_delay = false) override;
79 
80  void restore(int iat) override;
81 
82  void registerData(ParticleSet& P, WFBufferType& buf) override;
83 
84  LogValue updateBuffer(ParticleSet& P, WFBufferType& buf, bool fromscratch = false) override;
85 
86  void copyFromBuffer(ParticleSet& P, WFBufferType& buf) override;
87 
88  std::unique_ptr<WaveFunctionComponent> makeClone(ParticleSet& tqp) const override;
89 
91  const opt_variables_type& optvars,
92  Vector<ValueType>& dlogpsi,
93  Vector<ValueType>& dhpsioverpsi) override
94  {}
95 
96 private:
97  bool IgnoreSpin;
103  std::string ID_Rs;
104  std::string rpafunc;
105  std::string MyName;
106 
107  ///@}
108  /** main handler
109  */
110  std::unique_ptr<HandlerType> myHandler;
111  ///object to handle the long-range part
113  ///@{objects to handle the short-range part
114  ///two-body Jastrow function
116  ///numerical function owned by ShortRangeRPA
120  ///A list of WaveFunctionComponent*
122 };
123 } // namespace qmcplusplus
124 #endif
PsiValue ratio(ParticleSet &P, int iat) override
evaluate the ratio of the new to old WaveFunctionComponent value
Definition: RPAJastrow.cpp:219
void evaluateDerivatives(ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi) override
Compute the derivatives of both the log of the wavefunction and kinetic energy with respect to optimi...
Definition: RPAJastrow.h:90
kSpaceJastrow * LongRangeRPA
object to handle the long-range part
Definition: RPAJastrow.h:112
std::string getClassName() const override
return class name
Definition: RPAJastrow.h:43
WaveFunctionComponent::PsiValue PsiValue
Definition: SlaterDet.cpp:25
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
BsplineFunctor class for the Jastrows REAL is the real type used by offload target, it is the correct type for the mw data pointers and is also used to coerce/implicitly convert the Real type inherited OptimizableFunctorBase into that buffer if offload is off this happens too but is just an implementation quirk.
void extractOptimizableObjectRefs(UniqueOptObjRefs &opt_obj_refs) override
extract underlying OptimizableObject references
Definition: RPAJastrow.h:64
WaveFunctionComponent * ShortRangeRPA
Definition: RPAJastrow.h:115
QTBase::RealType RealType
Definition: Configuration.h:58
RPAJastrow(ParticleSet &target)
Definition: RPAJastrow.cpp:34
std::unique_ptr< WaveFunctionComponent > makeClone(ParticleSet &tqp) const override
this is a great deal of logic for make clone I&#39;m wondering what is going on
Definition: RPAJastrow.cpp:280
LatticeGaussianProduct::GradType GradType
std::vector< std::unique_ptr< T > > UPtrVector
Attaches a unit to a Vector for IO.
PsiValue ratioGrad(ParticleSet &P, int iat, GradType &grad_iat) override
evaluate the ratio of the new to old WaveFunctionComponent value and the new gradient ...
Definition: RPAJastrow.cpp:235
bool put(xmlNodePtr cur)
Definition: RPAJastrow.cpp:38
LogValue evaluateLog(const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L) override
evaluate the value of the WaveFunctionComponent from scratch
Definition: RPAJastrow.cpp:209
An abstract class for a component of a many-body trial wave function.
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
std::unique_ptr< HandlerType > myHandler
main handler
Definition: RPAJastrow.h:110
class to handle a set of variables that can be modified during optimizations
Definition: VariableSet.h:49
void acceptMove(ParticleSet &P, int iat, bool safe_to_delay=false) override
a move for iat-th particle is accepted.
Definition: RPAJastrow.cpp:246
ParticleSet & targetPtcl
Definition: RPAJastrow.h:119
Declaration of Long-range TwoBody Jastrow.
void setHandler(std::unique_ptr< HandlerType > Handler)
Definition: RPAJastrow.h:57
virtual void extractOptimizableObjectRefs(UniqueOptObjRefs &opt_obj_refs)
extract underlying OptimizableObject references
LogValue updateBuffer(ParticleSet &P, WFBufferType &buf, bool fromscratch=false) override
For particle-by-particle move.
Definition: RPAJastrow.cpp:264
void registerData(ParticleSet &P, WFBufferType &buf) override
For particle-by-particle move.
Definition: RPAJastrow.cpp:258
UPtrVector< WaveFunctionComponent > Psi
A list of WaveFunctionComponent*.
Definition: RPAJastrow.h:121
void restore(int iat) override
If a move for iat-th particle is rejected, restore to the content.
Definition: RPAJastrow.cpp:252
base class for LRHandlerTemp<FUNC,BASIS> and DummyLRHanlder<typename Func>
Definition: LRHandlerBase.h:30
Declaration of WaveFunctionComponent.
std::complex< double > LogValue
FuncType * nfunc
numerical function owned by ShortRangeRPA
Definition: RPAJastrow.h:117
void copyFromBuffer(ParticleSet &P, WFBufferType &buf) override
For particle-by-particle move.
Definition: RPAJastrow.cpp:272
GradType evalGrad(ParticleSet &P, int iat) override
return the current gradient for the iat-th particle
Definition: RPAJastrow.cpp:227
Define LRHandlerBase and DummyLRHandler<typename Func>
void buildOrbital(const std::string &name, const std::string &UL, const std::string &US, const std::string &RF, RealType R, RealType K)
Definition: RPAJastrow.cpp:67
void checkOutVariables(const opt_variables_type &o) override
check out optimizable variables
Definition: RPAJastrow.cpp:203
Define a LRHandler with two template parameters.
void push_back(OptimizableObject &obj)
JastrowBuilder using RPA functor Modification of RPAJastrow.
Definition: RPAJastrow.h:32
bool isOptimizable() const override
if true, this contains optimizable components
Definition: RPAJastrow.h:59