QMCPACK
EstimatorManagerNewTest.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: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 //
9 // File created by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef QMCPLUSPLUS_ESTIMATORMANAGERNEWTEST_HPP
14 #define QMCPLUSPLUS_ESTIMATORMANAGERNEWTEST_HPP
15 
18 
19 class Communicate;
20 
21 namespace qmcplusplus
22 {
23 namespace testing
24 {
25 
26 /** Testing class breaking EstimatorManagerNew encapsultation
27  *
28  * Wraps EstimatorManagerNew
29  */
31 {
32 public:
33  using QMCT = QMCTraits;
34 
36  /** Quickly add main scalar samples using FakeEstimator mock estimator. */
37  void fakeMainScalarSamples();
38  /** Quickly add scalar samples using FakeEstimator mock estimator. */
40  /** Quickly add scalar samples using FakeOperatorEstimator mock estimator. */
41  void fakeSomeOperatorEstimatorSamples(int rank);
42  /** call private EMB method and collect EMBTs estimators_ as main_estimators*/
43  void collectMainEstimators();
44  /** call private EMB method and colelct EMBTs estimators_ */
46  /** reduce the OperatorEstimators onto the EstimatorManagerNew copy. */
48  /** for mpi test (it's trivial for 1 rank)
49  *
50  * only used by test_manager_mpi.cpp so implemented there.
51  */
52  std::vector<QMCT::RealType> generateGoodOperatorData(int num_ranks);
53  /// test replacing the main estimator
55 
56  bool testMakeBlockAverages();
58 
59  std::vector<QMCT::RealType>& get_operator_data() { return em.operator_ests_[0]->get_data(); }
60 
62 private:
64  std::vector<FakeEstimator> estimators_;
65  std::vector<RefVector<ScalarEstimatorBase>> scalar_estimators_;
66 };
67 
69 public:
72 private:
74 };
75 
76 }
77 }
78 
79 #endif /* QMCPLUSPLUS_ESTIMATORMANAGERNEWTEST_HPP */
void fakeSomeOperatorEstimatorSamples(int rank)
Quickly add scalar samples using FakeOperatorEstimator mock estimator.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
std::vector< std::unique_ptr< OperatorEstBase > > operator_ests_
OperatorEst Observables.
Class to manage a set of ScalarEstimators As a manager, this class handles the aggregation of data fr...
bool testReplaceMainEstimator()
test replacing the main estimator
EstimatorManagerNewTest(const QMCHamiltonian &ham, Communicate *comm, int ranks)
Collection of Local Energy Operators.
void collectMainEstimators()
call private EMB method and collect EMBTs estimators_ as main_estimators
Testing class breaking EstimatorManagerNew encapsultation.
void fakeMainScalarSamples()
Quickly add main scalar samples using FakeEstimator mock estimator.
Wrapping information on parallelism.
Definition: Communicate.h:68
void collectOperatorEstimators()
reduce the OperatorEstimators onto the EstimatorManagerNew copy.
std::vector< QMCT::RealType > & get_operator_data()
UPtr< ScalarEstimatorBase > main_estimator_
main estimator i.e. some version of a local energy estimator.
void collectScalarEstimators()
call private EMB method and colelct EMBTs estimators_
Abstract class for an estimator of a scalar operator.
traits for QMC variables
Definition: Configuration.h:49
void fakeScalarSamplesAndCollect()
Quickly add scalar samples using FakeEstimator mock estimator.
std::vector< RefVector< ScalarEstimatorBase > > scalar_estimators_
std::vector< QMCT::RealType > generateGoodOperatorData(int num_ranks)
for mpi test (it&#39;s trivial for 1 rank)
EstimatorManagerNew emn(comm, std::move(emi), ham, pset, twf)