QMCPACK
test_OneBodyDensityMatrices.cpp File Reference

Tests for the OneBodyDensityMatrices. More...

+ Include dependency graph for test_OneBodyDensityMatrices.cpp:

Go to the source code of this file.

Classes

class  OneBodyDensityMatricesTests< T >
 

Namespaces

 qmcplusplus
 helper functions for EinsplineSetBuilder
 
 qmcplusplus::testing
 SpaceGrid refactored for use with batched estimator design NE should be dropped when QMCHamiltonian/SpaceGrid has been deleted.
 

Typedefs

using OBDMI = OneBodyDensityMatricesInput
 

Functions

 TEST_CASE ("OneBodyDensityMatrices::OneBodyDensityMatrices", "[estimators]")
 
 TEST_CASE ("OneBodyDensityMatrices::generateSamples", "[estimators]")
 
OneBodyDensityMatrices original (std::move(obdmi), pset_target.getLattice(), species_set, spomap, pset_target)
 
 REQUIRE (clone !=nullptr)
 
 REQUIRE (clone.get() !=&original)
 
 REQUIRE (dynamic_cast< decltype(&original)>(clone.get()) !=nullptr)
 
 TEST_CASE ("OneBodyDensityMatrices::accumulate", "[estimators]")
 
 TEST_CASE ("OneBodyDensityMatrices::evaluateMatrix", "[estimators]")
 
 TEST_CASE ("OneBodyDensityMatrices::registerAndWrite", "[estimators]")
 

Variables

constexpr bool dump_obdm = false
 
ProjectData test_project ("test", ProjectData::DriverVersion::BATCH)
 
auto & pset_target = *(particle_pool.getParticleSet("e"))
 
auto & species_set = pset_target.getSpeciesSet()
 
auto & spomap = wavefunction_pool.getWaveFunction("wavefunction")->getSPOMap()
 
Libxml2Document doc
 
bool okay = doc.parseFromString(Input::xml[Input::valid::VANILLA])
 
if(!okay) throw std xmlNodePtr node = doc.getRoot()
 
OneBodyDensityMatricesInput obdmi (node)
 
auto clone = original.spawnCrowdClone()
 

Detailed Description

Tests for the OneBodyDensityMatrices.

We can't reason about the state of the global Random in tests. A User can run only some tests, new tests will get added, other tests modified so global Random is called more times or fewer. Use of FakeRandom in unit tests in other tests of this executable can result in ambiguity about which global Random this test will have have access to as well. But several ParticleSet functions use the global Random so we have to avoid the normal sequence of particleset state transforms and set particle positions explicitly.

Definition in file test_OneBodyDensityMatrices.cpp.