28 auto msd_refvec = wfn.
findMSD();
29 if (msd_refvec.size() != 1)
30 throw std::runtime_error(
31 "SelfHealingOverlap requires one and only one multi slater determinant component in the trial wavefunction.");
35 data_.resize(data_size, 0.0);
46 std::size_t data_size =
data_.size();
54 throw std::runtime_error(
"There is no memory savings implementation for SelfHealingOverlap");
57 auto spawn = std::make_unique<SelfHealingOverlap>(*
this, spawn_data_locality);
58 spawn->get_data().resize(data_size);
73 for (
int iw = 0; iw <
walkers.size(); ++iw)
82 std::vector<WaveFunctionComponent*> wcs_jastrow;
83 std::vector<WaveFunctionComponent*> wcs_fermi;
85 if (wc->isFermionic())
86 wcs_fermi.push_back(wc.get());
88 wcs_jastrow.push_back(wc.get());
91 assert(wcs_fermi.size() == 1);
94 throw std::runtime_error(
"SelfHealingOverlap estimator requires use of multideterminant wavefunction");
95 auto msd_refvec = psi.
findMSD();
103 for (
auto& wc : wcs_jastrow)
104 Jval += wc->get_log_value();
126 throw std::runtime_error(
"You cannot call collect on a SelfHealingOverlap with this DataLocality");
133 using namespace std::string_literals;
135 std::vector<int> ng(1);
136 ng[0] =
data_.size();
137 h5desc_.push_back({{
"sh_coeff"}});
139 h5o.set_dimensions(ng, 0);
const std::vector< ValueType > & getLinearExpansionCoefs() const
SelfHealingOverlapInputSection input_section_
Class that collects MSD coefficient values via the Self-Healing overlap.
helper functions for EinsplineSetBuilder
void accumulate(const RefVector< MCPWalker > &walkers, const RefVector< ParticleSet > &psets, const RefVector< TrialWaveFunction > &wfns, const RefVector< QMCHamiltonian > &hams, RandomBase< FullPrecRealType > &rng) override
accumulate 1 or more walkers of SelfHealingOverlap samples
std::vector< ObservableHelper > h5desc_
float real(const float &c)
real part of a scalar. Cannot be replaced by std::real due to AFQMC specific needs.
QMCTraits::RealType RealType
void collect(const RefVector< OperatorEstBase > &operator_estimators) override
this allows the EstimatorManagerNew to reduce without needing to know the details of SelfHealingOverl...
DataLocality data_locality_
locality for accumulation of estimator data.
std::unique_ptr< OperatorEstBase > spawnCrowdClone() const override
standard interface
SelfHealingOverlap(SelfHealingOverlapInput &&inp, const TrialWaveFunction &wfn, DataLocality dl=DataLocality::crowd)
Constructor for SelfHealingOverlapInput.
RefVector< MultiSlaterDetTableMethod > findMSD() const
find MSD WFCs if exist
std::complex< QTFull::RealType > LogValue
An abstract class for a component of a many-body trial wave function.
Specialized paritlce class for atomistic simulations.
QMCT::FullPrecRealType walkers_weight_
size_type size() const
return the current size
Vector< ValueType > det_ratios
void calcIndividualDetRatios(Vector< ValueType > &ratios)
Compute ratios of the individual Slater determinants and the total MSD value.
Native representation for Self-Healing Overlap Estimator inputs.
const SelfHealingOverlapInput input_
An abstract class for gridded estimators.
std::vector< std::unique_ptr< WaveFunctionComponent > > const & getOrbitals()
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
Declaration of a TrialWaveFunction.
std::vector< std::reference_wrapper< T > > RefVector
Class to represent a many-body trial wave function.
DataLocality
data locality with respect to walker buffer
void startBlock(int steps) override
This allows us to allocate the necessary data for the DataLocality::queue.
void registerOperatorEstimator(hdf_archive &file) override
this allows the EstimatorManagerNew to reduce without needing to know the details of SelfHealingOverl...
A container class to represent a walker.
An AntiSymmetric WaveFunctionComponent composed of a linear combination of SlaterDeterminants.
virtual void collect(const RefVector< OperatorEstBase > &oebs)
Reduce estimator result data from crowds to rank.