QMCPACK
CSUpdateBase.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: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Raymond Clay III, j.k.rofling@gmail.com, Lawrence Livermore National Laboratory
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 /**@file CSUpdateBase.h
17  * @brief Definition of CSVUpdateBase
18  */
19 #ifndef QMCPLUSPLUS_CORRELATEDSAMPLINGBASE_H
20 #define QMCPLUSPLUS_CORRELATEDSAMPLINGBASE_H
21 
23 
24 namespace qmcplusplus
25 {
26 struct CSEnergyEstimator;
28 {
29 public:
31  std::vector<TrialWaveFunction*>& psi,
32  std::vector<QMCHamiltonian*>& h,
34 
35  ~CSUpdateBase() override;
36 
37  int nPsi;
38  bool useDrift;
39  std::vector<RealType> logpsi;
40  std::vector<RealType> sumratio;
41  std::vector<RealType> invsumratio;
42  std::vector<RealType> avgNorm;
43  std::vector<RealType> avgWeight;
44  std::vector<RealType> logNorm;
45  std::vector<RealType> cumNorm;
46  std::vector<RealType> instRij;
47  std::vector<RealType> ratio;
49  std::string useDriftOption;
50 
52  ///multiple estimator
54  ///a list of QMCHamiltonians for multiple method
55  std::vector<QMCHamiltonian*> H1;
56  ///a list of TrialWaveFunctions for multiple method
57  std::vector<TrialWaveFunction*> Psi1;
58 
59  std::vector<ParticleSet::ParticleGradient*> G1;
60  std::vector<ParticleSet::ParticleLaplacian*> L1;
61 
62  //a list of single particle gradients for multiple wavefunctions;
63  std::vector<GradType> g1_old;
64  std::vector<GradType> g1_new;
65 
66  //The following are utility functiosn for computing sumratio
67  //when using pbyp moves.
68  //
69  //Using psi and <w> (logpsi and avgnorm), this computes
70  // \Sum_i |\frac{\Psi_i}{\Psi_j}|^2 for all j.
71  void computeSumRatio(const std::vector<RealType>& logpsi,
72  const std::vector<RealType>& avgNorm,
73  std::vector<RealType>& sumratio);
74 
75  void computeSumRatio(const Matrix<RealType>& ratioij, std::vector<RealType>& sumratio);
76 
77  void computeSumRatio(const std::vector<RealType>& logpsi,
78  const std::vector<RealType>& avgNorm,
79  Matrix<RealType>& ratioij,
80  std::vector<RealType>& sumratio);
81 
82  void updateRatioMatrix(const std::vector<RealType>& ratio_pbyp, Matrix<RealType>& ratioij);
83 
84  void resizeWorkSpace(int nw, int nptcls);
85  void updateNorms();
86  void updateAvgWeights();
87  void initCSWalkers(WalkerIter_t it, WalkerIter_t it_end, bool resetNorms);
88  void initCSWalkersForPbyP(WalkerIter_t it, WalkerIter_t it_end, bool resetNorms);
89  void updateCSWalkers(WalkerIter_t it, WalkerIter_t it_end);
90 };
91 } // namespace qmcplusplus
92 
93 #endif
std::vector< RealType > logNorm
Definition: CSUpdateBase.h:44
void initCSWalkers(WalkerIter_t it, WalkerIter_t it_end, bool resetNorms)
std::vector< RealType > sumratio
Definition: CSUpdateBase.h:40
Base class for update methods for each step.
Definition: QMCUpdateBase.h:41
std::vector< RealType > cumNorm
Definition: CSUpdateBase.h:45
A set of walkers that are to be advanced by Metropolis Monte Carlo.
MCWalkerConfiguration::iterator WalkerIter_t
Definition: QMCUpdateBase.h:45
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
void computeSumRatio(const std::vector< RealType > &logpsi, const std::vector< RealType > &avgNorm, std::vector< RealType > &sumratio)
CSUpdateBase(MCWalkerConfiguration &w, std::vector< TrialWaveFunction *> &psi, std::vector< QMCHamiltonian *> &h, RandomBase< FullPrecRealType > &rg)
void updateRatioMatrix(const std::vector< RealType > &ratio_pbyp, Matrix< RealType > &ratioij)
std::vector< RealType > avgWeight
Definition: CSUpdateBase.h:43
std::vector< TrialWaveFunction * > Psi1
a list of TrialWaveFunctions for multiple method
Definition: CSUpdateBase.h:57
void resizeWorkSpace(int nw, int nptcls)
std::vector< RealType > logpsi
Definition: CSUpdateBase.h:39
void updateCSWalkers(WalkerIter_t it, WalkerIter_t it_end)
std::vector< RealType > invsumratio
Definition: CSUpdateBase.h:41
std::vector< ParticleSet::ParticleGradient * > G1
Definition: CSUpdateBase.h:59
Matrix< RealType > RatioIJ
Definition: CSUpdateBase.h:51
std::vector< GradType > g1_old
Definition: CSUpdateBase.h:63
void initCSWalkersForPbyP(WalkerIter_t it, WalkerIter_t it_end, bool resetNorms)
std::vector< RealType > instRij
Definition: CSUpdateBase.h:46
std::vector< GradType > g1_new
Definition: CSUpdateBase.h:64
std::vector< RealType > ratio
Definition: CSUpdateBase.h:47
std::vector< RealType > avgNorm
Definition: CSUpdateBase.h:42
CSEnergyEstimator * multiEstimator
multiple estimator
Definition: CSUpdateBase.h:53
std::vector< ParticleSet::ParticleLaplacian * > L1
Definition: CSUpdateBase.h:60
Matrix< RealType > ratioIJ
Definition: CSUpdateBase.h:48
Declare QMCUpdateBase class.
std::vector< QMCHamiltonian * > H1
a list of QMCHamiltonians for multiple method
Definition: CSUpdateBase.h:55