-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'QMCPACK:develop' into develop
- Loading branch information
Showing
23 changed files
with
392 additions
and
51 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,13 @@ | |
// This file is distributed under the University of Illinois/NCSA Open Source License. | ||
// See LICENSE file in top directory for details. | ||
// | ||
// Copyright (c) 2016 Jeongnim Kim and QMCPACK developers. | ||
// Copyright (c) 2022 QMCPACK developers. | ||
// | ||
// File developed by: Ken Esler, [email protected], University of Illinois at Urbana-Champaign | ||
// Jeongnim Kim, [email protected], University of Illinois at Urbana-Champaign | ||
// Jeremy McMinnis, [email protected], University of Illinois at Urbana-Champaign | ||
// Mark A. Berrill, [email protected], Oak Ridge National Laboratory | ||
// Peter Doak, [email protected], Oak Ridge National Laboratory | ||
// | ||
// File created by: Jeongnim Kim, [email protected], University of Illinois at Urbana-Champaign | ||
////////////////////////////////////////////////////////////////////////////////////// | ||
|
@@ -17,6 +18,7 @@ | |
#define QMCPLUSPLUS_CORRELATEDLOCALENERGYESTIMATOR_H | ||
|
||
#include "Estimators/ScalarEstimatorBase.h" | ||
#include "ScalarEstimatorInputs.h" | ||
|
||
namespace qmcplusplus | ||
{ | ||
|
@@ -46,11 +48,14 @@ struct CSEnergyEstimator : public ScalarEstimatorBase | |
Matrix<RealType> tmp_data; | ||
///name of hamiltonian components | ||
std::vector<std::string> h_components; | ||
const CSLocalEnergyInput input_; | ||
/** constructor | ||
* @param h QMCHamiltonian to define the components | ||
* @param hcopy number of copies of QMCHamiltonians | ||
*/ | ||
CSEnergyEstimator(QMCHamiltonian& h, int hcopy = 1); | ||
CSEnergyEstimator(const QMCHamiltonian& h, int hcopy = 1); | ||
|
||
CSEnergyEstimator(CSLocalEnergyInput&& input, const QMCHamiltonian& h); | ||
|
||
inline RealType getUmbrellaWeight(int ipsi) | ||
{ | ||
|
@@ -83,8 +88,10 @@ struct CSEnergyEstimator : public ScalarEstimatorBase | |
void add2Record(RecordNamedProperty<RealType>& record) override; | ||
void registerObservables(std::vector<ObservableHelper>& h5dec, hid_t gid) override; | ||
CSEnergyEstimator* clone() override; | ||
|
||
const std::string& getSubTypeStr() const override { return input_.get_type(); } | ||
void evaluateDiff(); | ||
// CSEnergyEstimator is the main estimator for | ||
bool isMainEstimator() const override { return true; } | ||
}; | ||
|
||
} // namespace qmcplusplus | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,12 @@ | |
// This file is distributed under the University of Illinois/NCSA Open Source License. | ||
// See LICENSE file in top directory for details. | ||
// | ||
// Copyright (c) 2016 Jeongnim Kim and QMCPACK developers. | ||
// Copyright (c) 2022 QMCPACK developers. | ||
// | ||
// File developed by: Jeongnim Kim, [email protected], University of Illinois at Urbana-Champaign | ||
// Jeremy McMinnis, [email protected], University of Illinois at Urbana-Champaign | ||
// Mark A. Berrill, [email protected], Oak Ridge National Laboratory | ||
// Peter Doak, [email protected], Oak Ridge National Laboratory | ||
// | ||
// File created by: Jeongnim Kim, [email protected], University of Illinois at Urbana-Champaign | ||
////////////////////////////////////////////////////////////////////////////////////// | ||
|
@@ -18,6 +19,7 @@ | |
#include "QMCHamiltonians/QMCHamiltonian.h" | ||
#include "QMCDrivers/WalkerProperties.h" | ||
#include "QMCHamiltonians/ObservableHelper.h" | ||
#include "ScalarEstimatorInputs.h" | ||
|
||
namespace qmcplusplus | ||
{ | ||
|
@@ -40,13 +42,18 @@ class LocalEnergyEstimator : public ScalarEstimatorBase | |
int SizeOfHamiltonians; | ||
bool UseHDF5; | ||
const QMCHamiltonian& refH; | ||
const LocalEnergyInput input_; | ||
|
||
public: | ||
/** constructor | ||
* @param h QMCHamiltonian to define the components | ||
*/ | ||
LocalEnergyEstimator(QMCHamiltonian& h, bool use_hdf5); | ||
|
||
LocalEnergyEstimator(const QMCHamiltonian& h, bool use_hdf5); | ||
/** Construct from LocalEnergyInput and const reference to hamiltonian. | ||
* \param[in] LocalEnergyInput contains input parameters for LocalEnergyEstimator | ||
* \param[in] is taken as a local reference and used to size scalars data | ||
*/ | ||
LocalEnergyEstimator(LocalEnergyInput&& input, const QMCHamiltonian& ham); | ||
/** accumulation per walker | ||
* @param awalker current walker | ||
* @param wgt weight | ||
|
@@ -83,6 +90,10 @@ class LocalEnergyEstimator : public ScalarEstimatorBase | |
for (MCPWalker& walker : walkers) | ||
accumulate(walker, 1.0); | ||
} | ||
|
||
/// LocalEnergyEstimator is the main estimator for VMC and DMC | ||
bool isMainEstimator() const override { return true; } | ||
const std::string& getSubTypeStr() const override { return input_.get_type(); } | ||
}; | ||
} // namespace qmcplusplus | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// This file is distributed under the University of Illinois/NCSA Open Source License. | ||
// See LICENSE file in top directory for details. | ||
// | ||
// Copyright (c) 2016 Jeongnim Kim and QMCPACK developers. | ||
// Copyright (c) 2022 QMCPACK developers. | ||
// | ||
// File developed by: Jeremy McMinnis, [email protected], University of Illinois at Urbana-Champaign | ||
// Raymond Clay III, [email protected], Lawrence Livermore National Laboratory | ||
|
@@ -18,7 +18,7 @@ | |
#include "QMCHamiltonians/QMCHamiltonian.h" | ||
#include "Particle/Reptile.h" | ||
#include "QMCDrivers/WalkerProperties.h" | ||
|
||
#include "ScalarEstimatorInputs.h" | ||
namespace qmcplusplus | ||
{ | ||
/** Class to accumulate the local energy and components | ||
|
@@ -32,14 +32,21 @@ class RMCLocalEnergyEstimator : public ScalarEstimatorBase | |
int SizeOfHamiltonians; | ||
const QMCHamiltonian& refH; | ||
int NObs; | ||
int RMCSpecificTerms; | ||
int RMCSpecificTerms = 8; | ||
|
||
// This is just to allow compilation batched version does not support RMC at this time. | ||
const RMCLocalEnergyInput input_; | ||
public: | ||
/** constructor | ||
* @param h QMCHamiltonian to define the components | ||
*/ | ||
RMCLocalEnergyEstimator(QMCHamiltonian& h, int nobs = 2); | ||
|
||
RMCLocalEnergyEstimator(QMCHamiltonian& ham, int nobs = 2); | ||
/** Construct from LocalEnergyInput and const reference to hamiltonian. | ||
* \param[in] RMCLocalEnergyEstimatorInput contains input parameters for RMCLocalEnergyEstimator | ||
* \param[in] is taken as a local reference and used to size scalars data and to get obs output names | ||
*/ | ||
RMCLocalEnergyEstimator(RMCLocalEnergyInput&& input, const QMCHamiltonian& ham); | ||
|
||
/** accumulation per walker | ||
* @param awalker current walker | ||
* @param wgt weight | ||
|
@@ -52,7 +59,6 @@ class RMCLocalEnergyEstimator : public ScalarEstimatorBase | |
{ | ||
throw std::runtime_error("RMC not supported by Unified Driver interfaces"); | ||
} | ||
/*@{*/ | ||
inline void accumulate(const MCWalkerConfiguration& W, | ||
WalkerIterator first, | ||
WalkerIterator last, | ||
|
@@ -144,7 +150,12 @@ class RMCLocalEnergyEstimator : public ScalarEstimatorBase | |
void add2Record(RecordListType& record) override; | ||
void registerObservables(std::vector<ObservableHelper>& h5dec, hid_t gid) override {} | ||
RMCLocalEnergyEstimator* clone() override; | ||
/*@}*/ | ||
const std::string& getSubTypeStr() const override { return input_.get_type(); } | ||
/// RMCLocalEnergyEstimator is the main estimator type for RMC driver | ||
bool isMainEstimator() const override { return true; } | ||
|
||
private: | ||
void resizeBasedOnHamiltonian(const QMCHamiltonian& ham); | ||
}; | ||
} // namespace qmcplusplus | ||
#endif |
Oops, something went wrong.