33 TEST_CASE(
"EstimatorManagerNew::EstimatorManager(comm)",
"[estimators]")
36 using namespace testing;
47 TEST_CASE(
"EstimatorManagerNew::EstimatorManagerNew(EstimatorManagerInput,...)",
"[estimators]")
52 using namespace testing;
92 TEST_CASE(
"EstimatorManagerNew::collectMainEstimators",
"[estimators]")
106 double correct_value = 5.0;
110 correct_value = 11.0;
112 correct_value = 14.0;
116 TEST_CASE(
"EstimatorManagerNew::collectScalarEstimators",
"[estimators]")
127 double correct_value = 11.0;
129 correct_value = 20.0;
131 correct_value = 29.0;
133 correct_value = 38.0;
137 TEST_CASE(
"EstimatorManagerNew adhoc addVector operator",
"[estimators]")
140 std::vector<double> vec_a{1.0, 2.0, 3.0};
141 std::vector<double> vec_b{2.0, 3.0, 4.0};
142 std::vector<std::vector<double>> est{vec_a, vec_b};
143 auto addVectors = [](
const auto& vec_a,
const auto& vec_b) {
144 std::vector<ScalarEstimatorBase::RealType> result_vector(vec_a.size(), 0.0);
145 for (
int i = 0; i < vec_a.size(); ++i)
146 result_vector[i] = vec_a[i] + vec_b[i];
147 return result_vector;
150 std::vector<double> reduced_scalars(num_scalars);
151 reduced_scalars = std::accumulate(est.begin(), est.end(), std::vector<double>(num_scalars, 0.0), addVectors);
152 std::vector<double> correct{3.0, 5.0, 7.0};
153 REQUIRE(reduced_scalars == correct);
class that handles xmlDoc
ScalarEstimatorInputs & get_scalar_estimator_inputs()
helper functions for EinsplineSetBuilder
Libxml2Document createEstimatorManagerNewInputXML()
Class to manage a set of ScalarEstimators As a manager, this class handles the aggregation of data fr...
std::size_t getNumScalarEstimators()
static ParticleSetPool make_diamondC_1x1x1(Communicate *c)
const ScalarEstimatorBase & getMainEstimator()
bool testReplaceMainEstimator()
test replacing the main estimator
EstimatorManagerNew emn2(comm, std::move(emi2), ham, pset, twf)
TEST_CASE("complex_helper", "[type_traits]")
static WaveFunctionPool make_diamondC_1x1x1(const RuntimeOptions &runtime_options, Communicate *comm, ParticleSetPool &particle_pool)
Libxml2Document createEstimatorManagerNewVMCInputXML()
virtual std::string getName() const =0
Collection of Local Energy Operators.
void collectMainEstimators()
call private EMB method and collect EMBTs estimators_ as main_estimators
ProjectData test_project("test", ProjectData::DriverVersion::BATCH)
Testing class breaking EstimatorManagerNew encapsultation.
void fakeMainScalarSamples()
Quickly add main scalar samples using FakeEstimator mock estimator.
EstimatorManagerInput emi(estimators_doc.getRoot())
Communicate * Controller
Global Communicator for a process.
const RuntimeOptions & getRuntimeOptions() const noexcept
Wrapping information on parallelism.
std::size_t getNumEstimators()
REQUIRE(std::filesystem::exists(filename))
Compilation units that construct QMCDriverInput need visibility to the actual input classes types in ...
EstimatorManagerNewTestAccess emnta(emn)
testing::EstimatorManagerNewTest embt(ham, c, 1)
Libxml2Document estimators_doc2
EstimatorManagerInput emi2(estimators_doc2.getRoot())
EstimatorInputs & get_estimator_inputs()
auto & get_AverageCache()
static HamiltonianPool make_hamWithEE(Communicate *comm, ParticleSetPool &particle_pool, WaveFunctionPool &wavefunction_pool)
Libxml2Document estimators_doc
Input type for EstimatorManagerNew Parses Estimators level of input and and delegates child estimator...
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
void fakeScalarSamplesAndCollect()
Quickly add scalar samples using FakeEstimator mock estimator.
EstimatorManagerNewTestAccess emnta2(emn2)
EstimatorManagerNew emn(comm, std::move(emi), ham, pset, twf)
Declaration of QMCHamiltonian.