![]() |
QMCPACK
|
Application-level classes to manage QMC simulations. More...
Files | |
file | qmcapp.cpp |
a main function for QMC simulation. | |
Classes | |
class | ParticleSetPool |
Manage a collection of ParticleSet objects. More... | |
class | WaveFunctionPool |
Manage a collection of TrialWaveFunction objects. More... | |
class | HamiltonianPool |
Manage a collection of QMCHamiltonian objects. More... | |
class | QMCAppBase |
Base class for QMC applications and utilities. More... | |
class | QMCMain |
Main application to perform QMC simulations. More... | |
Application-level classes to manage QMC simulations.
The classes in this group are responsble for handling of major xml elements under <simulation>.
class qmcplusplus::ParticleSetPool |
Manage a collection of ParticleSet objects.
This object handles <particleset> elements and functions as a builder class for ParticleSet objects.
Definition at line 34 of file ParticleSetPool.h.
Public Types | |
using | PoolType = std::map< std::string, const std::unique_ptr< ParticleSet > > |
![]() | |
using | mpi_comm_type = Communicate::mpi_comm_type |
Public Member Functions | |
ParticleSetPool (Communicate *c, const char *aname="particleset") | |
constructor More... | |
~ParticleSetPool () | |
ParticleSetPool (const ParticleSetPool &)=delete | |
ParticleSetPool & | operator= (const ParticleSetPool &)=delete |
ParticleSetPool (ParticleSetPool &&pset) noexcept | |
ParticleSetPool & | operator= (ParticleSetPool &&)=default |
bool | put (xmlNodePtr cur) |
process an xml element More... | |
bool | get (std::ostream &os) const |
void | reset () |
reset is used to initialize and evaluate the distance tables More... | |
void | output_particleset_info (Libxml2Document &doc, xmlNodePtr root) |
bool | readSimulationCellXML (xmlNodePtr cur) |
initialize the supercell shared by all the particle sets More... | |
bool | empty () const |
return true, if the pool is empty More... | |
void | addParticleSet (std::unique_ptr< ParticleSet > &&p) |
add a ParticleSet* to the pool with its ownership transferred ParticleSet built outside the ParticleSetPool must be constructed with the simulation cell from this->simulation_cell_. More... | |
ParticleSet * | getParticleSet (const std::string &pname) |
get a named ParticleSet More... | |
MCWalkerConfiguration * | getWalkerSet (const std::string &pname) |
get a named MCWalkerConfiguration More... | |
const PoolType & | getPool () const |
get the Pool object More... | |
const auto & | getSimulationCell () const |
get simulation cell More... | |
void | setSimulationCell (const SimulationCell &simulation_cell) |
set simulation cell More... | |
void | randomize () |
randomize a particleset particleset/='yes' && particleset exists More... | |
![]() | |
MPIObjectBase (Communicate *c) | |
constructor with communicator More... | |
int | rank () const |
return the rank of the communicator More... | |
int | getGroupID () const |
return the group id of the communicator More... | |
Communicate * | getCommunicator () const |
return myComm More... | |
Communicate & | getCommRef () const |
return a TEMPORARY reference to Communicate More... | |
mpi_comm_type | getMPI () const |
return MPI communicator if one wants to use MPI directly More... | |
bool | is_manager () const |
return true if the rank == 0 More... | |
const std::string & | getName () const |
return the name More... | |
void | setName (const std::string &aname) |
Private Attributes | |
std::unique_ptr< SimulationCell > | simulation_cell_ |
global simulation cell More... | |
PoolType | myPool |
List of ParticleSet owned. More... | |
std::vector< xmlNodePtr > | randomize_nodes |
xml node for random initialization. More... | |
Additional Inherited Members | |
![]() | |
Communicate * | myComm |
pointer to Communicate More... | |
std::string | ClassName |
class Name More... | |
std::string | myName |
name of the object More... | |
using PoolType = std::map<std::string, const std::unique_ptr<ParticleSet> > |
Definition at line 37 of file ParticleSetPool.h.
ParticleSetPool | ( | Communicate * | c, |
const char * | aname = "particleset" |
||
) |
constructor
aname | xml tag |
Definition at line 33 of file ParticleSetPool.cpp.
References MPIObjectBase::ClassName, and MPIObjectBase::myName.
|
default |
|
delete |
|
noexcept |
Definition at line 40 of file ParticleSetPool.cpp.
References MPIObjectBase::ClassName.
void addParticleSet | ( | std::unique_ptr< ParticleSet > && | p | ) |
add a ParticleSet* to the pool with its ownership transferred ParticleSet built outside the ParticleSetPool must be constructed with the simulation cell from this->simulation_cell_.
Definition at line 67 of file ParticleSetPool.cpp.
References LOGMSG, ParticleSetPool::myPool, and ParticleSetPool::simulation_cell_.
Referenced by qmcplusplus::TEST_CASE(), qmcplusplus::test_diamond_2x1x1_xml_input(), qmcplusplus::test_hcpBe_rotation(), qmcplusplus::test_He_sto3g_xml_input(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::test_LiH_msd(), qmcplusplus::test_LiH_msd_xml_input(), qmcplusplus::test_LiH_msd_xml_input_with_positron(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().
|
inline |
return true, if the pool is empty
Definition at line 66 of file ParticleSetPool.h.
References ParticleSetPool::myPool.
bool get | ( | std::ostream & | os | ) | const |
Definition at line 205 of file ParticleSetPool.cpp.
References OutputManagerClass::isDebugActive(), ParticleSetPool::myPool, outputManager, and qmcplusplus::pset.
Referenced by qmcplusplus::TEST_CASE(), and QMCFiniteSize::validateXML().
ParticleSet * getParticleSet | ( | const std::string & | pname | ) |
get a named ParticleSet
pname | name of the ParticleSet |
When the named ParticleSet is not in this object, return 0.
Definition at line 49 of file ParticleSetPool.cpp.
References ParticleSet::get(), and ParticleSetPool::myPool.
Referenced by ParticleSetPool::getWalkerSet(), QMCFiniteSize::initBreakup(), InitMolecularSystem::put(), ParticleSetPool::put(), WaveFunctionPool::put(), HamiltonianPool::put(), qmcplusplus::TEST_CASE(), and QMCFiniteSize::wfnPut().
|
inline |
get the Pool object
Definition at line 92 of file ParticleSetPool.h.
References ParticleSetPool::myPool.
Referenced by WaveFunctionTester::printEloc(), WaveFunctionPool::put(), HamiltonianPool::put(), WaveFunctionTester::runGradSourceTest(), WaveFunctionTester::runZeroVarianceTest(), qmcplusplus::TEST_CASE(), qmcplusplus::test_diamond_2x1x1_xml_input(), qmcplusplus::test_hcpBe_rotation(), qmcplusplus::test_He_sto3g_xml_input(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::test_LiH_msd(), qmcplusplus::test_LiH_msd_xml_input(), qmcplusplus::test_LiH_msd_xml_input_with_positron(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().
|
inline |
get simulation cell
Definition at line 95 of file ParticleSetPool.h.
References ParticleSetPool::simulation_cell_.
Referenced by qmcplusplus::TEST_CASE(), qmcplusplus::test_diamond_2x1x1_xml_input(), qmcplusplus::test_hcpBe_rotation(), qmcplusplus::test_He_sto3g_xml_input(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::test_LiH_msd(), qmcplusplus::test_LiH_msd_xml_input(), qmcplusplus::test_LiH_msd_xml_input_with_positron(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().
MCWalkerConfiguration * getWalkerSet | ( | const std::string & | pname | ) |
get a named MCWalkerConfiguration
pname | name of the MCWalkerConfiguration |
When the named MCWalkerConfiguration is not in this object, return 0.
Definition at line 57 of file ParticleSetPool.cpp.
References ParticleSetPool::getParticleSet().
Referenced by qmcplusplus::testing::createDriver(), and qmcplusplus::TEST_CASE().
|
delete |
|
default |
void output_particleset_info | ( | Libxml2Document & | doc, |
xmlNodePtr | root | ||
) |
Definition at line 218 of file ParticleSetPool.cpp.
References Libxml2Document::addChild(), qmcplusplus::doc, and ParticleSetPool::myPool.
bool put | ( | xmlNodePtr | cur | ) |
process an xml element
cur | current xmlNodePtr |
Creating MCWalkerConfiguration for all the ParticleSet objects.
Definition at line 117 of file ParticleSetPool.cpp.
References OhmmsAttributeSet::add(), qmcplusplus::app_summary(), qmcplusplus::app_warning(), Communicate::barrier_and_abort(), PlatformSelector< KIND >::candidate_values(), qmcplusplus::DC_POS, qmcplusplus::DC_POS_OFFLOAD, ParticleSetPool::getParticleSet(), ParticleSet::getTotalNum(), ParticleSet::groups(), MPIObjectBase::myComm, ParticleSetPool::myPool, qmcplusplus::OMPTARGET, OhmmsAttributeSet::put(), ParticleSetPool::randomize_nodes, XMLParticleParser::readXML(), PlatformSelector< KIND >::selectPlatform(), ParticleSet::setName(), ParticleSet::setSpinor(), and ParticleSetPool::simulation_cell_.
Referenced by MinimalParticlePool::make_H2(), MinimalParticlePool::parseParticleSetXML(), QMCFiniteSize::processPWH(), qmcplusplus::setupParticleSetPool(), qmcplusplus::setupParticleSetPoolBe(), qmcplusplus::TEST_CASE(), and QMCFiniteSize::validateXML().
void randomize | ( | ) |
randomize a particleset particleset/='yes' && particleset exists
Definition at line 189 of file ParticleSetPool.cpp.
References qmcplusplus::app_log(), InitMolecularSystem::put(), and ParticleSetPool::randomize_nodes.
Referenced by MinimalParticlePool::make_H2(), MinimalParticlePool::parseParticleSetXML(), and qmcplusplus::TEST_CASE().
bool readSimulationCellXML | ( | xmlNodePtr | cur | ) |
initialize the supercell shared by all the particle sets
return value is never checked anywhere side effect simulation_cell_ UPtr<ParticleLayout> is set to particle layout created on heap. This is later directly assigned to pset member variable Lattice.
Definition at line 83 of file ParticleSetPool.cpp.
References qmcplusplus::app_log(), qmcplusplus::app_summary(), Communicate::barrier_and_abort(), OutputManagerClass::isHighActive(), MPIObjectBase::myComm, outputManager, LatticeParser::put(), and ParticleSetPool::simulation_cell_.
Referenced by MinimalParticlePool::parseParticleSetXML(), QMCFiniteSize::processPWH(), and qmcplusplus::TEST_CASE().
void reset | ( | ) |
reset is used to initialize and evaluate the distance tables
Definition at line 233 of file ParticleSetPool.cpp.
References ParticleSetPool::myPool, and qmcplusplus::pset.
|
inline |
set simulation cell
Definition at line 98 of file ParticleSetPool.h.
References ParticleSetPool::simulation_cell_.
Referenced by qmcplusplus::TEST_CASE(), qmcplusplus::test_diamond_2x1x1_xml_input(), qmcplusplus::test_hcpBe_rotation(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().
|
private |
List of ParticleSet owned.
Each ParticleSet has to have a unique name which is used as a key for the map.
Definition at line 116 of file ParticleSetPool.h.
Referenced by ParticleSetPool::addParticleSet(), ParticleSetPool::empty(), ParticleSetPool::get(), ParticleSetPool::getParticleSet(), ParticleSetPool::getPool(), ParticleSetPool::output_particleset_info(), ParticleSetPool::put(), and ParticleSetPool::reset().
|
private |
xml node for random initialization.
randomize() process initializations just before starting qmc sections
Definition at line 121 of file ParticleSetPool.h.
Referenced by ParticleSetPool::put(), and ParticleSetPool::randomize().
|
private |
global simulation cell
updated by
Definition at line 111 of file ParticleSetPool.h.
Referenced by ParticleSetPool::addParticleSet(), ParticleSetPool::getSimulationCell(), ParticleSetPool::put(), ParticleSetPool::readSimulationCellXML(), and ParticleSetPool::setSimulationCell().
class qmcplusplus::WaveFunctionPool |
Manage a collection of TrialWaveFunction objects.
This object handles <wavefunction> elements and functions as a builder class for TrialWaveFunction objects.
Definition at line 38 of file WaveFunctionPool.h.
Public Types | |
using | PoolType = std::map< std::string, const std::unique_ptr< TrialWaveFunction > > |
![]() | |
using | mpi_comm_type = Communicate::mpi_comm_type |
Public Member Functions | |
WaveFunctionPool (const RuntimeOptions &runtime_options, ParticleSetPool &pset_pool, Communicate *c, const char *aname="wavefunction") | |
WaveFunctionPool (const WaveFunctionPool &)=delete | |
WaveFunctionPool & | operator= (const WaveFunctionPool &)=delete |
WaveFunctionPool (WaveFunctionPool &&)=default | |
WaveFunctionPool & | operator= (WaveFunctionPool &&)=delete |
~WaveFunctionPool () | |
bool | put (xmlNodePtr cur) |
bool | empty () const |
TrialWaveFunction * | getPrimary () |
TrialWaveFunction * | getWaveFunction (const std::string &pname) |
xmlNodePtr | getWaveFunctionNode (const std::string &id) |
return a xmlNode containing Jastrow More... | |
const PoolType & | getPool () const |
get the Pool object More... | |
void | addFactory (std::unique_ptr< TrialWaveFunction > psi, bool primary) |
add a TrialWaveFunction* to myPool More... | |
![]() | |
MPIObjectBase (Communicate *c) | |
constructor with communicator More... | |
int | rank () const |
return the rank of the communicator More... | |
int | getGroupID () const |
return the group id of the communicator More... | |
Communicate * | getCommunicator () const |
return myComm More... | |
Communicate & | getCommRef () const |
return a TEMPORARY reference to Communicate More... | |
mpi_comm_type | getMPI () const |
return MPI communicator if one wants to use MPI directly More... | |
bool | is_manager () const |
return true if the rank == 0 More... | |
const std::string & | getName () const |
return the name More... | |
void | setName (const std::string &aname) |
Private Attributes | |
const RuntimeOptions & | runtime_options_ |
top-level runtime options from project data information More... | |
TrialWaveFunction * | primary_psi_ |
pointer to the primary TrialWaveFunction More... | |
PoolType | myPool |
storage of WaveFunctionFactory More... | |
ParticleSetPool & | ptcl_pool_ |
pointer to ParticleSetPool More... | |
Additional Inherited Members | |
![]() | |
Communicate * | myComm |
pointer to Communicate More... | |
std::string | ClassName |
class Name More... | |
std::string | myName |
name of the object More... | |
using PoolType = std::map<std::string, const std::unique_ptr<TrialWaveFunction> > |
Definition at line 41 of file WaveFunctionPool.h.
WaveFunctionPool | ( | const RuntimeOptions & | runtime_options, |
ParticleSetPool & | pset_pool, | ||
Communicate * | c, | ||
const char * | aname = "wavefunction" |
||
) |
Definition at line 25 of file WaveFunctionPool.cpp.
References MPIObjectBase::ClassName, and MPIObjectBase::myName.
|
delete |
|
default |
|
default |
void addFactory | ( | std::unique_ptr< TrialWaveFunction > | psi, |
bool | primary | ||
) |
add a TrialWaveFunction* to myPool
Definition at line 57 of file WaveFunctionPool.cpp.
References qmcplusplus::app_log(), WaveFunctionPool::myPool, and WaveFunctionPool::primary_psi_.
Referenced by WaveFunctionPool::put(), and qmcplusplus::TEST_CASE().
|
inline |
Definition at line 56 of file WaveFunctionPool.h.
References WaveFunctionPool::myPool.
|
inline |
get the Pool object
Definition at line 82 of file WaveFunctionPool.h.
References WaveFunctionPool::myPool.
Referenced by HamiltonianPool::put().
|
inline |
Definition at line 58 of file WaveFunctionPool.h.
References WaveFunctionPool::primary_psi_.
|
inline |
Definition at line 60 of file WaveFunctionPool.h.
References WaveFunctionPool::myPool.
xmlNodePtr getWaveFunctionNode | ( | const std::string & | id | ) |
return a xmlNode containing Jastrow
id | name of the wave function |
If the wavefunction with id does not exist, return 0
Definition at line 69 of file WaveFunctionPool.cpp.
References WaveFunctionPool::myPool, and qmcplusplus::Units::second.
|
delete |
|
delete |
bool put | ( | xmlNodePtr | cur | ) |
Definition at line 37 of file WaveFunctionPool.cpp.
References OhmmsAttributeSet::add(), WaveFunctionPool::addFactory(), Communicate::barrier_and_abort(), WaveFunctionFactory::buildTWF(), ParticleSetPool::getParticleSet(), ParticleSetPool::getPool(), MPIObjectBase::myComm, WaveFunctionPool::myPool, WaveFunctionPool::ptcl_pool_, OhmmsAttributeSet::put(), and WaveFunctionPool::runtime_options_.
Referenced by MinimalWaveFunctionPool::make_diamondC_1x1x1(), MinimalWaveFunctionPool::make_O2_spinor(), and MinimalWaveFunctionPool::make_O2_spinor_J12().
|
private |
storage of WaveFunctionFactory
Definition at line 96 of file WaveFunctionPool.h.
Referenced by WaveFunctionPool::addFactory(), WaveFunctionPool::empty(), WaveFunctionPool::getPool(), WaveFunctionPool::getWaveFunction(), WaveFunctionPool::getWaveFunctionNode(), and WaveFunctionPool::put().
|
private |
pointer to the primary TrialWaveFunction
Definition at line 93 of file WaveFunctionPool.h.
Referenced by WaveFunctionPool::addFactory(), and WaveFunctionPool::getPrimary().
|
private |
pointer to ParticleSetPool
TrialWaveFunction needs to know which ParticleSet object is used as an input object for the evaluations.
Definition at line 103 of file WaveFunctionPool.h.
Referenced by WaveFunctionPool::put().
|
private |
top-level runtime options from project data information
Definition at line 90 of file WaveFunctionPool.h.
Referenced by WaveFunctionPool::put().
class qmcplusplus::HamiltonianPool |
Manage a collection of QMCHamiltonian objects.
This object handles <hamiltonian> elements and functions as a builder class for QMCHamiltonian objects.
Definition at line 40 of file HamiltonianPool.h.
Public Types | |
using | PoolType = std::map< std::string, HamiltonianFactory * > |
![]() | |
using | mpi_comm_type = Communicate::mpi_comm_type |
Public Member Functions | |
HamiltonianPool (ParticleSetPool &pset_pool, WaveFunctionPool &psi_pool, Communicate *c, const char *aname="hamiltonian") | |
HamiltonianPool (const HamiltonianPool &)=delete | |
HamiltonianPool & | operator= (const HamiltonianPool &)=delete |
HamiltonianPool (HamiltonianPool &&)=default | |
HamiltonianPool & | operator= (HamiltonianPool &&)=delete |
~HamiltonianPool () | |
bool | put (xmlNodePtr cur) |
bool | get (std::ostream &os) const |
void | reset () |
bool | empty () const |
QMCHamiltonian * | getPrimary () |
return the pointer to the primary QMCHamiltonian More... | |
QMCHamiltonian * | getHamiltonian (const std::string &pname) |
return the pointer to a QMCHamiltonian with the name More... | |
void | setDocument (Libxml2Document *doc) |
![]() | |
MPIObjectBase (Communicate *c) | |
constructor with communicator More... | |
int | rank () const |
return the rank of the communicator More... | |
int | getGroupID () const |
return the group id of the communicator More... | |
Communicate * | getCommunicator () const |
return myComm More... | |
Communicate & | getCommRef () const |
return a TEMPORARY reference to Communicate More... | |
mpi_comm_type | getMPI () const |
return MPI communicator if one wants to use MPI directly More... | |
bool | is_manager () const |
return true if the rank == 0 More... | |
const std::string & | getName () const |
return the name More... | |
void | setName (const std::string &aname) |
Private Attributes | |
QMCHamiltonian * | primaryH |
pointer to the primary QMCHamiltonian More... | |
QMCHamiltonian * | curH |
pointer to a current QMCHamiltonian to be built. More... | |
ParticleSetPool & | ptcl_pool_ |
pointer to ParticleSetPool More... | |
WaveFunctionPool & | psi_pool_ |
pointer to WaveFunctionPool More... | |
Libxml2Document * | curDoc |
point to the working document More... | |
PoolType | myPool |
storage for HamiltonianFactory More... | |
Additional Inherited Members | |
![]() | |
Communicate * | myComm |
pointer to Communicate More... | |
std::string | ClassName |
class Name More... | |
std::string | myName |
name of the object More... | |
using PoolType = std::map<std::string, HamiltonianFactory*> |
Definition at line 43 of file HamiltonianPool.h.
HamiltonianPool | ( | ParticleSetPool & | pset_pool, |
WaveFunctionPool & | psi_pool, | ||
Communicate * | c, | ||
const char * | aname = "hamiltonian" |
||
) |
Definition at line 29 of file HamiltonianPool.cpp.
References MPIObjectBase::ClassName, and MPIObjectBase::myName.
|
delete |
|
default |
~HamiltonianPool | ( | ) |
Definition at line 39 of file HamiltonianPool.cpp.
References HamiltonianPool::myPool.
|
inline |
Definition at line 59 of file HamiltonianPool.h.
References HamiltonianPool::myPool.
Referenced by qmcplusplus::TEST_CASE().
bool get | ( | std::ostream & | os | ) | const |
Definition at line 86 of file HamiltonianPool.cpp.
References HamiltonianPool::myPool.
|
inline |
return the pointer to a QMCHamiltonian with the name
pname | name of the QMCHamiltonian |
Definition at line 71 of file HamiltonianPool.h.
References HamiltonianPool::myPool.
Referenced by qmcplusplus::TEST_CASE().
|
inline |
return the pointer to the primary QMCHamiltonian
The first QMCHamiltonian is assigned to the primaryH. The last QMCHamiltonian with role="primary" will be the primaryH.
Definition at line 66 of file HamiltonianPool.h.
References HamiltonianPool::primaryH.
|
delete |
|
delete |
bool put | ( | xmlNodePtr | cur | ) |
Definition at line 49 of file HamiltonianPool.cpp.
References OhmmsAttributeSet::add(), HamiltonianPool::curH, ReportEngine::error(), ParticleSetPool::getParticleSet(), WaveFunctionPool::getPool(), ParticleSetPool::getPool(), MPIObjectBase::myComm, HamiltonianPool::myPool, HamiltonianPool::primaryH, HamiltonianPool::psi_pool_, HamiltonianPool::ptcl_pool_, and OhmmsAttributeSet::put().
Referenced by MinimalHamiltonianPool::make_hamWithEE(), MinimalHamiltonianPool::makeHamWithEEEI(), and qmcplusplus::TEST_CASE().
void reset | ( | ) |
Definition at line 97 of file HamiltonianPool.cpp.
|
inline |
Definition at line 85 of file HamiltonianPool.h.
References HamiltonianPool::curDoc, and qmcplusplus::doc.
|
private |
point to the working document
Definition at line 114 of file HamiltonianPool.h.
Referenced by HamiltonianPool::setDocument().
|
private |
pointer to a current QMCHamiltonian to be built.
Definition at line 94 of file HamiltonianPool.h.
Referenced by HamiltonianPool::put().
|
private |
storage for HamiltonianFactory
Definition at line 117 of file HamiltonianPool.h.
Referenced by HamiltonianPool::empty(), HamiltonianPool::get(), HamiltonianPool::getHamiltonian(), HamiltonianPool::put(), and HamiltonianPool::~HamiltonianPool().
|
private |
pointer to the primary QMCHamiltonian
Definition at line 90 of file HamiltonianPool.h.
Referenced by HamiltonianPool::getPrimary(), and HamiltonianPool::put().
|
private |
pointer to WaveFunctionPool
For those OperatorBase that depends on TrialWaveFunction, e.g., NonLocalPPotential.
Definition at line 110 of file HamiltonianPool.h.
Referenced by HamiltonianPool::put().
|
private |
pointer to ParticleSetPool
QMCHamiltonian needs to know which ParticleSet object is used as an input object for the evaluations. Any number of ParticleSet can be used to describe a QMCHamiltonian.
Definition at line 103 of file HamiltonianPool.h.
Referenced by HamiltonianPool::put().
class qmcplusplus::QMCAppBase |
Base class for QMC applications and utilities.
Definition at line 34 of file QMCAppBase.h.
Public Member Functions | |
QMCAppBase () | |
constructor More... | |
virtual | ~QMCAppBase () |
destructor More... | |
bool | parse (const std::string &infile) |
parse an input file More... | |
void | saveXml () |
save the xml document More... | |
virtual bool | validateXML ()=0 |
validate the input file More... | |
virtual bool | execute ()=0 |
execute the main function More... | |
const std::string & | getTitle () const |
Protected Member Functions | |
bool | pushDocument (const std::string &infile) |
open a new document More... | |
void | popDocument () |
close the current document More... | |
Protected Attributes | |
std::stack< Libxml2Document * > | xml_doc_stack_ |
stack of xml document More... | |
ProjectData | my_project_ |
project description More... | |
RandomNumberControl | my_random_control_ |
random number controller More... | |
|
default |
constructor
|
virtual |
destructor
Definition at line 22 of file QMCAppBase.cpp.
References QMCAppBase::popDocument(), and QMCAppBase::xml_doc_stack_.
|
pure virtual |
execute the main function
Implemented in QMCMain, and QMCFiniteSize.
const std::string & getTitle | ( | ) | const |
Definition at line 82 of file QMCAppBase.cpp.
References ProjectData::getTitle(), and QMCAppBase::my_project_.
bool parse | ( | const std::string & | infile | ) |
parse an input file
infile | file to be parsed. |
infile | name of an input file |
The data members m_doc and m_root point to the "current" document and root element.
Definition at line 64 of file QMCAppBase.cpp.
References qmcplusplus::app_summary(), and QMCAppBase::pushDocument().
Referenced by main(), and qmcplusplus::TEST_CASE().
|
protected |
close the current document
Definition at line 46 of file QMCAppBase.cpp.
References QMCAppBase::xml_doc_stack_.
Referenced by QMCFiniteSize::validateXML(), QMCMain::validateXML(), and QMCAppBase::~QMCAppBase().
|
protected |
open a new document
Definition at line 30 of file QMCAppBase.cpp.
References qmcplusplus::app_error(), Libxml2Document::parse(), and QMCAppBase::xml_doc_stack_.
Referenced by QMCAppBase::parse(), QMCFiniteSize::validateXML(), and QMCMain::validateXML().
void saveXml | ( | ) |
save the xml document
Definition at line 70 of file QMCAppBase.cpp.
References qmcplusplus::app_log(), ProjectData::currentMainRoot(), QMCAppBase::my_project_, and QMCAppBase::xml_doc_stack_.
Referenced by QMCMain::execute().
|
pure virtual |
validate the input file
Implemented in QMCMain, and QMCFiniteSize.
|
protected |
project description
Definition at line 67 of file QMCAppBase.h.
Referenced by QMCMain::execute(), QMCAppBase::getTitle(), QMCMain::QMCMain(), QMCMain::runQMC(), QMCAppBase::saveXml(), and QMCMain::validateXML().
|
protected |
random number controller
Definition at line 70 of file QMCAppBase.h.
Referenced by QMCMain::execute(), and QMCMain::validateXML().
|
protected |
stack of xml document
Definition at line 64 of file QMCAppBase.h.
Referenced by QMCMain::execute(), QMCAppBase::popDocument(), QMCAppBase::pushDocument(), QMCAppBase::saveXml(), QMCFiniteSize::validateXML(), QMCMain::validateXML(), and QMCAppBase::~QMCAppBase().
class qmcplusplus::QMCMain |
Main application to perform QMC simulations.
This is a generalized QMC application which can handle multiple ParticleSet, TrialWaveFunction and QMCHamiltonian objects.
Public Member Functions | |
QMCMain (Communicate *c) | |
~QMCMain () override | |
bool | validateXML () override |
validate the main document and (read the walker sets !) More... | |
bool | execute () override |
execute the main function More... | |
ParticleSetPool & | getParticlePool () |
![]() | |
MPIObjectBase (Communicate *c) | |
constructor with communicator More... | |
int | rank () const |
return the rank of the communicator More... | |
int | getGroupID () const |
return the group id of the communicator More... | |
Communicate * | getCommunicator () const |
return myComm More... | |
Communicate & | getCommRef () const |
return a TEMPORARY reference to Communicate More... | |
mpi_comm_type | getMPI () const |
return MPI communicator if one wants to use MPI directly More... | |
bool | is_manager () const |
return true if the rank == 0 More... | |
const std::string & | getName () const |
return the name More... | |
void | setName (const std::string &aname) |
![]() | |
QMCAppBase () | |
constructor More... | |
virtual | ~QMCAppBase () |
destructor More... | |
bool | parse (const std::string &infile) |
parse an input file More... | |
void | saveXml () |
save the xml document More... | |
const std::string & | getTitle () const |
Private Member Functions | |
bool | runQMC (xmlNodePtr cur, bool reuse) |
execute <qmc> element More... | |
bool | setMCWalkers (xmlXPathContextPtr cur) |
add <mcwalkerset> elements to continue a run More... | |
bool | processPWH (xmlNodePtr cur) |
add unique ParticleSet, TrialWaveFunction and QMCHamiltonian elements to Pool objects More... | |
void | executeLoop (xmlNodePtr cur) |
execute loop More... | |
bool | executeDebugSection (xmlNodePtr cur) |
execute <debug> element More... | |
bool | executeQMCSection (xmlNodePtr cur, bool reuse=false) |
execute qmc More... | |
bool | executeCMCSection (xmlNodePtr cur) |
execute <cmc> element More... | |
Private Attributes | |
std::unique_ptr< ParticleSetPool > | particle_set_pool_ |
ParticleSet Pool. More... | |
std::unique_ptr< WaveFunctionPool > | psi_pool_ |
TrialWaveFunction Pool. More... | |
std::unique_ptr< HamiltonianPool > | ham_pool_ |
QMCHamiltonian Pool. More... | |
MCWalkerConfiguration * | qmc_system_ |
current MCWalkerConfiguration More... | |
std::optional< EstimatorManagerInput > | estimator_manager_input_ |
Global estimators defined outside of <qmc> nodes. More... | |
bool | first_qmc_ |
flag to indicate that a qmc is the first QMC More... | |
std::unique_ptr< QMCDriverInterface > | last_driver_ |
the last driver object. Should be in a loop only. More... | |
std::unique_ptr< SimpleFixedNodeBranch > | last_branch_engine_legacy_driver_ |
last branch engine used by legacy drivers More... | |
std::vector< xmlNodePtr > | walker_set_ |
xml mcwalkerset elements for output More... | |
std::vector< xmlNodePtr > | walker_set_in_ |
xml mcwalkerset read-in elements More... | |
xmlNodePtr | walker_logs_xml_ |
walkerlogs xml More... | |
xmlNodePtr | traces_xml_ |
traces xml More... | |
std::vector< std::pair< xmlNodePtr, bool > > | qmc_action_ |
qmc sections More... | |
xmlNodePtr | last_input_node_ |
pointer to the last node of the main inputfile More... | |
Additional Inherited Members | |
![]() | |
using | mpi_comm_type = Communicate::mpi_comm_type |
![]() | |
bool | pushDocument (const std::string &infile) |
open a new document More... | |
void | popDocument () |
close the current document More... | |
![]() | |
Communicate * | myComm |
pointer to Communicate More... | |
std::string | ClassName |
class Name More... | |
std::string | myName |
name of the object More... | |
![]() | |
std::stack< Libxml2Document * > | xml_doc_stack_ |
stack of xml document More... | |
ProjectData | my_project_ |
project description More... | |
RandomNumberControl | my_random_control_ |
random number controller More... | |
QMCMain | ( | Communicate * | c | ) |
Definition at line 58 of file QMCMain.cpp.
References qmcplusplus::app_log(), qmcplusplus::app_summary(), OHMMS::Controller, GET_MACRO_VAL, DeviceManager::getGlobal(), qmcplusplus::getGlobalTimerManager(), Communicate::getGroupID(), DeviceManager::getNumDevices(), Communicate::getNumGroups(), DeviceManager::initializeGlobalDeviceManager(), ProjectData::isComplex(), QMCAppBase::my_project_, MPIObjectBase::myComm, Communicate::NodeComm(), OHMMS_PRECISION, omp_get_num_threads(), omp_get_thread_num(), QMCState::print_git_info_if_present(), qmcplusplus::print_mem(), QMCState::print_options(), qmcplusplus::qmc_common, and Communicate::size().
|
override |
Definition at line 165 of file QMCMain.cpp.
References CloneManager::clearClones(), and QMCMain::last_driver_.
|
overridevirtual |
execute the main function
Implements QMCAppBase.
Definition at line 172 of file QMCMain.cpp.
References OhmmsAttributeSet::add(), qmcplusplus::app_error(), qmcplusplus::app_log(), Communicate::barrier(), Communicate::barrier_and_abort(), OHMMS::Controller, qmcplusplus::createGlobalTimer(), ProjectData::currentMainRoot(), QMCState::dryrun, Timer::elapsed(), ERRORMSG, QMCMain::executeCMCSection(), QMCMain::executeDebugSection(), QMCMain::executeLoop(), QMCMain::executeQMCSection(), InfoStream::flush(), QMCMain::ham_pool_, infoLog, infoSummary, RandomNumberControl::initialize(), MPIObjectBase::is_manager(), QMCMain::last_input_node_, QMCAppBase::my_project_, QMCAppBase::my_random_control_, MPIObjectBase::myComm, QMCMain::particle_set_pool_, OhmmsAttributeSet::put(), QMCMain::qmc_action_, qmcplusplus::qmc_common, QMCState::qmc_counter, qmcplusplus::run_time_manager, QMCAppBase::saveXml(), Communicate::size(), TimerType< CLOCK >::start(), TimerType< CLOCK >::stop(), qmcplusplus::timer_level_coarse, QMCMain::validateXML(), QMCMain::walker_set_, and QMCAppBase::xml_doc_stack_.
|
private |
execute <cmc> element
Definition at line 712 of file QMCMain.cpp.
References qmcplusplus::abs(), OhmmsAttributeSet::add(), qmcplusplus::app_log(), qmcplusplus::Units::charge::e, QMCHamiltonian::evaluate(), TrialWaveFunction::evaluateLog(), QMCHamiltonian::getObservable(), QMCHamiltonian::getObservableName(), ParticleSet::getTotalNum(), QMCMain::ham_pool_, qmcplusplus::makeGaussRandomWithEngine(), QMCMain::particle_set_pool_, QMCMain::psi_pool_, OhmmsAttributeSet::put(), QMCMain::qmc_system_, ParticleSet::R, Random, QMCHamiltonian::sizeOfObservables(), ParticleSet::update(), and QMCHamiltonian::updateSource().
Referenced by QMCMain::execute().
|
private |
execute <debug> element
Definition at line 687 of file QMCMain.cpp.
References qmcplusplus::app_log().
Referenced by QMCMain::execute().
|
private |
execute loop
Definition at line 327 of file QMCMain.cpp.
References OhmmsAttributeSet::add(), qmcplusplus::app_log(), qmcplusplus::app_warning(), QMCMain::executeQMCSection(), QMCMain::last_driver_, OhmmsAttributeSet::put(), qmcplusplus::qmc_common, QMCState::qmc_counter, and qmcplusplus::run_time_manager.
Referenced by QMCMain::execute().
|
private |
execute qmc
cur | qmc xml node |
reuse | if true, reuse the driver built from the last QMC section. This should be used by loop only. |
Definition at line 695 of file QMCMain.cpp.
References OhmmsAttributeSet::add(), QMCMain::first_qmc_, QMCMain::particle_set_pool_, OhmmsAttributeSet::put(), QMCMain::qmc_system_, QMCMain::runQMC(), and RandomNumberControl::test().
Referenced by QMCMain::execute(), and QMCMain::executeLoop().
|
inline |
Definition at line 45 of file QMCMain.h.
References QMCMain::particle_set_pool_.
|
private |
add unique ParticleSet, TrialWaveFunction and QMCHamiltonian elements to Pool objects
grep basic objects and add to Pools
cur | xml node |
cur | current node |
Recursive search all the xml elements with particleset, wavefunction and hamiltonian tags
Definition at line 522 of file QMCMain.cpp.
References qmcplusplus::app_log(), Communicate::barrier_and_abort(), QMCMain::estimator_manager_input_, QMCMain::ham_pool_, MPIObjectBase::myComm, QMCMain::particle_set_pool_, QMCMain::psi_pool_, and QMCMain::qmc_action_.
Referenced by QMCMain::validateXML().
|
private |
execute <qmc> element
prepare for a QMC run
cur | qmc xml node |
reuse | if true, reuse the driver built from the last QMC section. This should be used by loop only. |
Ye: I think this can be merged with executeQMCSection
cur | qmc element |
reuse | if true, the current call is from a loop |
Definition at line 586 of file QMCMain.cpp.
References ProjectData::advance(), qmcplusplus::app_log(), QMCDriverFactory::DriverAssemblyState::append_run, Communicate::barrier_and_abort(), qmcplusplus::createGlobalTimer(), QMCDriverFactory::createQMCDriver(), ProjectData::currentMainRoot(), Timer::elapsed(), QMCMain::estimator_manager_input_, QMCMain::first_qmc_, InfoStream::flush(), QMCMain::ham_pool_, infoLog, infoSummary, QMCMain::last_branch_engine_legacy_driver_, QMCMain::last_driver_, QMCAppBase::my_project_, MPIObjectBase::myComm, QMCMain::particle_set_pool_, QMCMain::psi_pool_, QMCMain::qmc_system_, QMCDriverFactory::readSection(), qmcplusplus::timer_level_coarse, QMCMain::traces_xml_, QMCMain::walker_logs_xml_, and QMCMain::walker_set_in_.
Referenced by QMCMain::executeQMCSection().
|
private |
add <mcwalkerset> elements to continue a run
Reads walkers sets from the restart file during XML validation.
TODO: Move this, it is not a concern of QMCMain
Definition at line 663 of file QMCMain.cpp.
References OhmmsAttributeSet::add(), MPIObjectBase::myComm, OhmmsAttributeSet::put(), RandomNumberControl::read(), OhmmsXPathObject::size(), QMCMain::walker_set_, and QMCMain::walker_set_in_.
Referenced by QMCMain::validateXML().
|
overridevirtual |
validate the main document and (read the walker sets !)
Current xml schema is changing. Instead validating the input file, we use xpath to create necessary objects. The order follows
Implements QMCAppBase.
Definition at line 376 of file QMCMain.cpp.
References OhmmsAttributeSet::add(), qmcplusplus::app_log(), qmcplusplus::app_summary(), qmcplusplus::app_warning(), Communicate::barrier_and_abort(), OhmmsXPathObject::empty(), ProjectData::get(), getXMLAttributeValue(), qmcplusplus::ham, QMCMain::ham_pool_, RandomNumberControl::initialize(), QMCMain::last_input_node_, QMCAppBase::my_project_, QMCAppBase::my_random_control_, MPIObjectBase::myComm, QMCMain::particle_set_pool_, QMCAppBase::popDocument(), QMCMain::processPWH(), QMCMain::psi_pool_, QMCAppBase::pushDocument(), InitMolecularSystem::put(), OhmmsAttributeSet::put(), ProjectData::put(), QMCMain::qmc_action_, qmcplusplus::qmc_common, ProjectData::reset(), ProjectData::setCommunicator(), QMCMain::setMCWalkers(), QMCHamiltonian::size(), QMCMain::traces_xml_, QMCState::use_density, QMCMain::walker_logs_xml_, and QMCAppBase::xml_doc_stack_.
Referenced by QMCMain::execute().
|
private |
Global estimators defined outside of <qmc> nodes.
Definition at line 61 of file QMCMain.h.
Referenced by QMCMain::processPWH(), and QMCMain::runQMC().
|
private |
flag to indicate that a qmc is the first QMC
Definition at line 64 of file QMCMain.h.
Referenced by QMCMain::executeQMCSection(), and QMCMain::runQMC().
|
private |
QMCHamiltonian Pool.
Definition at line 55 of file QMCMain.h.
Referenced by QMCMain::execute(), QMCMain::executeCMCSection(), QMCMain::processPWH(), QMCMain::runQMC(), and QMCMain::validateXML().
|
private |
last branch engine used by legacy drivers
Definition at line 70 of file QMCMain.h.
Referenced by QMCMain::runQMC().
|
private |
the last driver object. Should be in a loop only.
Definition at line 67 of file QMCMain.h.
Referenced by QMCMain::executeLoop(), QMCMain::runQMC(), and QMCMain::~QMCMain().
|
private |
pointer to the last node of the main inputfile
Definition at line 88 of file QMCMain.h.
Referenced by QMCMain::execute(), and QMCMain::validateXML().
|
private |
ParticleSet Pool.
Definition at line 49 of file QMCMain.h.
Referenced by QMCMain::execute(), QMCMain::executeCMCSection(), QMCMain::executeQMCSection(), QMCMain::getParticlePool(), QMCMain::processPWH(), QMCMain::runQMC(), and QMCMain::validateXML().
|
private |
TrialWaveFunction Pool.
Definition at line 52 of file QMCMain.h.
Referenced by QMCMain::executeCMCSection(), QMCMain::processPWH(), QMCMain::runQMC(), and QMCMain::validateXML().
|
private |
qmc sections
Definition at line 85 of file QMCMain.h.
Referenced by QMCMain::execute(), QMCMain::processPWH(), and QMCMain::validateXML().
|
private |
current MCWalkerConfiguration
Definition at line 58 of file QMCMain.h.
Referenced by QMCMain::executeCMCSection(), QMCMain::executeQMCSection(), and QMCMain::runQMC().
|
private |
traces xml
Definition at line 82 of file QMCMain.h.
Referenced by QMCMain::runQMC(), and QMCMain::validateXML().
|
private |
walkerlogs xml
Definition at line 79 of file QMCMain.h.
Referenced by QMCMain::runQMC(), and QMCMain::validateXML().
|
private |
xml mcwalkerset elements for output
Definition at line 73 of file QMCMain.h.
Referenced by QMCMain::execute(), and QMCMain::setMCWalkers().
|
private |
xml mcwalkerset read-in elements
Definition at line 76 of file QMCMain.h.
Referenced by QMCMain::runQMC(), and QMCMain::setMCWalkers().