QMCPACK
CostFunctionCrowdData.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: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef QMCPLUSPLUS_COSTFUNCTIONCROWDDATA_H
14 #define QMCPLUSPLUS_COSTFUNCTIONCROWDDATA_H
15 
17 #include "DriverWalkerTypes.h"
18 
19 namespace qmcplusplus
20 {
21 /** @ingroup QMCDrivers
22  * @brief Implements wave-function optimization
23  *
24  */
25 
26 
27 /// Class to hold temporary data and object copies for crowd-local evaluation
29 {
30 public:
33  /// Create the arrays of crowd_size and create object copies
34  CostFunctionCrowdData(int crowd_size,
35  ParticleSet& P,
36  TrialWaveFunction& Psi,
37  QMCHamiltonian& H,
39 
40  /// Set the log_psi_* arrays to zero
41  void zero_log_psi();
42 
47 
48  std::vector<Return_rt>& get_log_psi_fixed() { return log_psi_fixed_; }
49  std::vector<Return_rt>& get_log_psi_opt() { return log_psi_opt_; }
50 
53 
55 
56  Return_rt& get_e0() { return e0_; }
57  Return_rt& get_e2() { return e2_; }
58 
59  Return_rt& get_wgt() { return wgt_; }
60  Return_rt& get_wgt2() { return wgt2_; }
61 
64 
65 private:
66  // Temporary vectors for the call to flex_evaluateDeltaLogSetup
67  std::vector<Return_rt> log_psi_fixed_;
68  std::vector<Return_rt> log_psi_opt_;
69 
70  // List of objects for use in flex_* calls
76 
77  // proivides multi walker resource
79 
80  /// resource collection corresponding to h0
82 
83  // Saved RNG state to reset to before correlated sampling
84  std::unique_ptr<RandomBase<FullPrecRealType>> rng_save_ptr_;
85 
86  // Crowd-local accumulator variables
89 
92 };
93 
94 
95 } // namespace qmcplusplus
96 #endif
DriverWalkerResourceCollection driverwalker_resource_collection_
UPtrVector< QMCHamiltonian > h_ptr_list_
DriverWalkerResourceCollection & getSharedResource()
qmcplusplus::QMCTraits::RealType Return_rt
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QTBase::RealType RealType
Definition: Configuration.h:58
std::vector< Return_rt > & get_log_psi_fixed()
RandomBase< FullPrecRealType > & get_rng_save()
Collection of Local Energy Operators.
std::vector< std::unique_ptr< T > > UPtrVector
UPtrVector< TrialWaveFunction > wf_ptr_list_
RefVector< QMCHamiltonian > get_h_list(int len)
UPtrVector< RandomBase< FullPrecRealType > > rng_ptr_list_
UPtrVector< TrialWaveFunction > & get_wf_ptr_list()
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
ResourceCollection h0_res_
resource collection corresponding to h0
RefVector< ParticleSet > get_p_list(int len)
DriverWalker multi walker resource collections It currently supports VMC and DMC only.
QMCTraits::FullPrecRealType FullPrecRealType
CostFunctionCrowdData(int crowd_size, ParticleSet &P, TrialWaveFunction &Psi, QMCHamiltonian &H, RandomBase< FullPrecRealType > &Rng)
Create the arrays of crowd_size and create object copies.
Implements wave-function optimization.
std::vector< std::reference_wrapper< T > > RefVector
Class to represent a many-body trial wave function.
RefVector< QMCHamiltonian > get_h0_list(int len)
std::vector< Return_rt > & get_log_psi_opt()
RefVector< TrialWaveFunction > get_wf_list(int len)
Driver level walker (DriverWalker) related data structures.
UPtrVector< QMCHamiltonian > h0_ptr_list_
QTFull::RealType FullPrecRealType
Definition: Configuration.h:66
UPtrVector< RandomBase< FullPrecRealType > > & get_rng_ptr_list()
UPtrVector< ParticleSet > p_ptr_list_
std::vector< Return_rt > log_psi_fixed_
void zero_log_psi()
Set the log_psi_* arrays to zero.
std::unique_ptr< RandomBase< FullPrecRealType > > rng_save_ptr_