QMCPACK
SetupSFNBranch Class Reference
+ Collaboration diagram for SetupSFNBranch:

Public Member Functions

 SetupSFNBranch (Communicate *comm)
 
 SetupSFNBranch ()
 
std::unique_ptr< SFNBranchoperator() (ParticleSet &pset, TrialWaveFunction &twf, QMCHamiltonian &ham)
 

Private Member Functions

void createMyNode (SFNBranch &sfnb, const char *xml)
 

Private Attributes

Communicatecomm_
 
UPtr< EstimatorManagerNewemb_
 
WalkerConfigurations walker_confs_
 
UPtr< MCPopulationpop_
 
UPtr< Libxml2Documentdoc_
 
RealType tau_ = 1.0
 
int num_global_walkers_ = 16
 

Detailed Description

Definition at line 34 of file test_SFNBranch.cpp.

Constructor & Destructor Documentation

◆ SetupSFNBranch() [1/2]

SetupSFNBranch ( Communicate comm)
inline

Definition at line 37 of file test_SFNBranch.cpp.

References qmcplusplus::comm.

◆ SetupSFNBranch() [2/2]

SetupSFNBranch ( )
inline

Definition at line 39 of file test_SFNBranch.cpp.

References OHMMS::Controller.

Communicate * Controller
Global Communicator for a process.
Definition: Communicate.cpp:35

Member Function Documentation

◆ createMyNode()

void createMyNode ( SFNBranch sfnb,
const char *  xml 
)
inlineprivate

Definition at line 62 of file test_SFNBranch.cpp.

References SetupSFNBranch::doc_, and qmcplusplus::sfnb.

Referenced by SetupSFNBranch::operator()().

63  {
64  doc_ = std::make_unique<Libxml2Document>();
65  doc_->parseFromString(xml);
66  sfnb.put(doc_->getRoot());
67  }
std::unique_ptr< SFNBranch > sfnb

◆ operator()()

std::unique_ptr<SFNBranch> operator() ( ParticleSet pset,
TrialWaveFunction twf,
QMCHamiltonian ham 
)
inline

Definition at line 41 of file test_SFNBranch.cpp.

References SetupSFNBranch::comm_, qmcplusplus::convertUPtrToRefVector(), SetupSFNBranch::createMyNode(), qmcplusplus::ham, qmcplusplus::LIMITED_HISTORY, SetupSFNBranch::pop_, qmcplusplus::pset, Communicate::rank(), qmcplusplus::sfnb, SetupSFNBranch::tau_, qmcplusplus::twf, qmcplusplus::testing::valid_dmc_input_dmc_batch_index, qmcplusplus::testing::valid_dmc_input_sections, SetupSFNBranch::walker_confs_, and qmcplusplus::hdf::walkers.

42  {
43  pop_ = std::make_unique<MCPopulation>(1, comm_->rank(), &pset, &twf, &ham);
44  // MCPopulation owns it walkers it cannot just take refs so we just create and then update its walkers.
45  pop_->createWalkers(2, walker_confs_);
46 
47  RefVector<MCPWalker> walkers = convertUPtrToRefVector(pop_->get_walkers());
48 
49  walkers[0].get().R[0] = 1.0;
50  walkers[1].get().R[0] = 0.5;
51 
52  auto sfnb = std::make_unique<SFNBranch>(tau_, 1.0, DMCRefEnergyScheme::LIMITED_HISTORY);
53 
55 
56  sfnb->initParam(*pop_, 0, 0, false, false);
57 
58  return sfnb;
59  }
int rank() const
return the rank
Definition: Communicate.h:116
const char walkers[]
Definition: HDFVersion.h:36
static RefVector< T > convertUPtrToRefVector(const UPtrVector< T > &ptr_list)
convert a vector of std::unique_ptrs<T> to a refvector<T>
std::unique_ptr< SFNBranch > sfnb
void createMyNode(SFNBranch &sfnb, const char *xml)
constexpr int valid_dmc_input_dmc_batch_index
constexpr std::array< const char *, 3 > valid_dmc_input_sections

Member Data Documentation

◆ comm_

Communicate* comm_
private

Definition at line 69 of file test_SFNBranch.cpp.

Referenced by SetupSFNBranch::operator()().

◆ doc_

UPtr<Libxml2Document> doc_
private

Definition at line 73 of file test_SFNBranch.cpp.

Referenced by SetupSFNBranch::createMyNode().

◆ emb_

UPtr<EstimatorManagerNew> emb_
private

Definition at line 70 of file test_SFNBranch.cpp.

◆ num_global_walkers_

int num_global_walkers_ = 16
private

Definition at line 76 of file test_SFNBranch.cpp.

◆ pop_

UPtr<MCPopulation> pop_
private

Definition at line 72 of file test_SFNBranch.cpp.

Referenced by SetupSFNBranch::operator()().

◆ tau_

RealType tau_ = 1.0
private

Definition at line 75 of file test_SFNBranch.cpp.

Referenced by SetupSFNBranch::operator()().

◆ walker_confs_

WalkerConfigurations walker_confs_
private

Definition at line 71 of file test_SFNBranch.cpp.

Referenced by SetupSFNBranch::operator()().


The documentation for this class was generated from the following file: