![]() |
QMCPACK
|
Class that collects density per species of particle. More...
Public Types | |
using | POLT = PtclOnLatticeTraits |
using | Lattice = POLT::ParticleLayout |
using | QMCT = QMCTraits |
using | FullPrecRealType = QMCT::FullPrecRealType |
![]() | |
using | QMCT = QMCTraits |
using | FullPrecRealType = QMCT::FullPrecRealType |
using | MCPWalker = Walker< QMCTraits, PtclOnLatticeTraits > |
using | Data = std::vector< QMCT::RealType > |
Public Member Functions | |
SpinDensityNew (SpinDensityInput &&sdi, const SpeciesSet &species, DataLocality dl=DataLocality::crowd) | |
Constructor for SpinDensityNew that contains an explicitly defined cell part of legacy input handling, Deprecated. More... | |
SpinDensityNew (SpinDensityInput &&sdi, const Lattice &, const SpeciesSet &species, const DataLocality dl=DataLocality::crowd) | |
Constructor. More... | |
SpinDensityNew (const SpinDensityNew &sdn, DataLocality dl) | |
Constructor used when spawing crowd clones needs to be public so std::make_unique can call it. More... | |
void | startBlock (int steps) override |
This allows us to allocate the necessary data for the DataLocality::queue. More... | |
std::unique_ptr< OperatorEstBase > | spawnCrowdClone () const override |
standard interface More... | |
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 SpinDensity samples More... | |
void | collect (const RefVector< OperatorEstBase > &operator_estimators) override |
this allows the EstimatorManagerNew to reduce without needing to know the details of SpinDensityNew's data. More... | |
void | registerOperatorEstimator (hdf_archive &file) override |
this allows the EstimatorManagerNew to reduce without needing to know the details of SpinDensityNew's data. More... | |
![]() | |
OperatorEstBase (DataLocality dl) | |
constructor More... | |
OperatorEstBase (const OperatorEstBase &oth) | |
Shallow copy constructor! This alows us to keep the default copy constructors for derived classes which is quite useful to the spawnCrowdClone design. More... | |
virtual | ~OperatorEstBase ()=default |
virtual destructor More... | |
virtual void | normalize (QMCT::RealType invToWgt) |
std::vector< QMCT::RealType > & | get_data () |
void | write (hdf_archive &file) |
Write to previously registered observable_helper hdf5 wrapper. More... | |
void | zero () |
zero data appropriately for the DataLocality More... | |
QMCT::FullPrecRealType | get_walkers_weight () const |
Return the total walker weight for this block. More... | |
const std::string & | get_my_name () const |
virtual void | registerListeners (QMCHamiltonian &ham_leader) |
Register 0-many listeners with a leading QMCHamiltonian instance i.e. More... | |
bool | isListenerRequired () |
DataLocality | get_data_locality () const |
Private Member Functions | |
SpinDensityNew (const SpinDensityNew &sdn)=default | |
size_t | getFullDataSize () |
derived_parameters_ must be valid i.e. More... | |
void | accumulateToData (size_t point, QMCT::RealType weight) |
void | reset () |
void | report (const std::string &pad) |
Static Private Member Functions | |
static std::vector< int > | getSpeciesSize (const SpeciesSet &species) |
Private Attributes | |
const SpinDensityInput | input_ |
const SpeciesSet & | species_ |
const std::vector< int > | species_size_ |
Lattice | lattice_ |
they should be limited to values that can be changed from input or are not present explicitly in the SpinDensityInput More... | |
SpinDensityInput::DerivedParameters | derived_parameters_ |
class | testing::SpinDensityNewTests |
}@ More... | |
Additional Inherited Members | |
![]() | |
DataLocality | data_locality_ |
locality for accumulation of estimator data. More... | |
std::string | my_name_ |
name of this object – only used for debugging and h5 output More... | |
QMCT::FullPrecRealType | walkers_weight_ |
std::vector< ObservableHelper > | h5desc_ |
Data | data_ |
bool | requires_listener_ = false |
Class that collects density per species of particle.
commonly used for spin up and down electrons
Definition at line 35 of file SpinDensityNew.h.
Definition at line 41 of file SpinDensityNew.h.
using Lattice = POLT::ParticleLayout |
Definition at line 39 of file SpinDensityNew.h.
using POLT = PtclOnLatticeTraits |
Definition at line 38 of file SpinDensityNew.h.
Definition at line 40 of file SpinDensityNew.h.
SpinDensityNew | ( | SpinDensityInput && | sdi, |
const SpeciesSet & | species, | ||
DataLocality | dl = DataLocality::crowd |
||
) |
Constructor for SpinDensityNew that contains an explicitly defined cell part of legacy input handling, Deprecated.
Definition at line 23 of file SpinDensityNew.cpp.
References SpinDensityInput::calculateDerivedParameters(), qmcplusplus::crowd, OperatorEstBase::data_, OperatorEstBase::data_locality_, SpinDensityNew::derived_parameters_, CrystalLattice< T, D >::explicitly_defined, SpinDensityInput::get_cell(), SpinDensityInput::get_save_memory(), SpinDensityInput::get_write_report(), SpinDensityNew::getFullDataSize(), SpinDensityNew::input_, SpinDensityNew::lattice_, OperatorEstBase::my_name_, qmcplusplus::rank, and SpinDensityNew::report().
SpinDensityNew | ( | SpinDensityInput && | sdi, |
const Lattice & | lattice, | ||
const SpeciesSet & | species, | ||
const DataLocality | dl = DataLocality::crowd |
||
) |
Constructor.
If the sdi contains a cell definition the Lattice passed will be ignored.
Other wise the crystal lattice should come from the same particle set as the species set. in case you are tempted to just pass the ParticleSet don't. It clouds the data dependence of constructing the estimator and creates a strong coupling between the classes.
Ideally when validating input is built up enough there would be only one constructor with signature
SpinDensityNew(SpinDensityInput&& sdi, SpinDensityInput::DerivedParameters&& dev_par, SpeciesSet species, DataLocality dl);
Definition at line 46 of file SpinDensityNew.cpp.
References SpinDensityInput::calculateDerivedParameters(), OperatorEstBase::data_, OperatorEstBase::data_locality_, SpinDensityNew::derived_parameters_, CrystalLattice< T, D >::explicitly_defined, SpinDensityInput::get_cell(), SpinDensityInput::get_write_report(), SpinDensityNew::getFullDataSize(), SpinDensityNew::input_, SpinDensityNew::lattice_, OperatorEstBase::my_name_, and SpinDensityNew::report().
SpinDensityNew | ( | const SpinDensityNew & | sdn, |
DataLocality | dl | ||
) |
Constructor used when spawing crowd clones needs to be public so std::make_unique can call it.
Do not use directly unless you've really thought it through.
Definition at line 66 of file SpinDensityNew.cpp.
References OperatorEstBase::data_locality_.
|
privatedefault |
|
overridevirtual |
accumulate 1 or more walkers of SpinDensity samples
Gets called every step and writes to thread local data.
I tried for readable and not doing the optimizers job. The offsets into bare data are already bad enough.
Implements OperatorEstBase.
Definition at line 117 of file SpinDensityNew.cpp.
References SpinDensityNew::accumulateToData(), SpinDensityNew::derived_parameters_, QMCTraits::DIM, qmcplusplus::floor(), SpinDensityNew::lattice_, qmcplusplus::Units::time::ps, qmcplusplus::pset, qmcplusplus::Units::time::s, SpeciesSet::size(), SpinDensityNew::species_, SpinDensityNew::species_size_, CrystalLattice< T, D >::toUnit(), qmcplusplus::walker, qmcplusplus::hdf::walkers, and OperatorEstBase::walkers_weight_.
Referenced by qmcplusplus::accumulateFromPsets(), qmcplusplus::randomUpdateAccumulate(), and qmcplusplus::TEST_CASE().
|
private |
Definition at line 146 of file SpinDensityNew.cpp.
References qmcplusplus::crowd, OperatorEstBase::data_, OperatorEstBase::data_locality_, and qmcplusplus::queue.
Referenced by SpinDensityNew::accumulate().
|
overridevirtual |
this allows the EstimatorManagerNew to reduce without needing to know the details of SpinDensityNew's data.
can use base class default until crowd level SpinDensity estimators don't have a copy of the density grid.
Reimplemented from OperatorEstBase.
Definition at line 163 of file SpinDensityNew.cpp.
References OperatorEstBase::collect(), qmcplusplus::crowd, OperatorEstBase::data_, OperatorEstBase::data_locality_, OperatorEstBase::get_data(), qmcplusplus::rank, and OperatorEstBase::walkers_weight_.
|
private |
derived_parameters_ must be valid i.e.
initialized with call to input_.calculateDerivedParameters
Definition at line 82 of file SpinDensityNew.cpp.
References SpinDensityNew::derived_parameters_, SpinDensityInput::DerivedParameters::npoints, SpeciesSet::size(), and SpinDensityNew::species_.
Referenced by SpinDensityNew::SpinDensityNew().
|
staticprivate |
Definition at line 71 of file SpinDensityNew.cpp.
References SpeciesSet::findAttribute(), qmcplusplus::Units::time::s, and SpeciesSet::size().
|
overridevirtual |
this allows the EstimatorManagerNew to reduce without needing to know the details of SpinDensityNew's data.
can use base class default until crowd level SpinDensity estimators don't have a copy of the density grid. this gets us into the hdf5 file
Just parroting for now don't fully understand. , needs to be unraveled and simplified the hdf5 output is another big state big coupling design.
Reimplemented from OperatorEstBase.
Definition at line 220 of file SpinDensityNew.cpp.
References SpinDensityNew::derived_parameters_, OperatorEstBase::h5desc_, OperatorEstBase::my_name_, SpinDensityInput::DerivedParameters::npoints, qmcplusplus::oh, qmcplusplus::Units::time::s, ObservableHelper::set_dimensions(), SpeciesSet::size(), SpinDensityNew::species_, and SpeciesSet::speciesName.
|
private |
Definition at line 199 of file SpinDensityNew.cpp.
References qmcplusplus::app_log(), CrystalLattice< T, D >::Center, SpinDensityNew::derived_parameters_, QMCTraits::DIM, SpinDensityNew::lattice_, CrystalLattice< T, D >::Rv, qmcplusplus::Units::time::s, SpeciesSet::size(), SpinDensityNew::species_, SpinDensityNew::species_size_, and SpeciesSet::speciesName.
Referenced by SpinDensityNew::SpinDensityNew().
|
private |
|
overridevirtual |
standard interface
Implements OperatorEstBase.
Definition at line 84 of file SpinDensityNew.cpp.
References OperatorEstBase::data_, OperatorEstBase::data_locality_, qmcplusplus::queue, qmcplusplus::rank, and SpinDensityNew::species_size_.
Referenced by qmcplusplus::accumulateFromPsets().
|
overridevirtual |
This allows us to allocate the necessary data for the DataLocality::queue.
Implements OperatorEstBase.
Definition at line 101 of file SpinDensityNew.cpp.
References OperatorEstBase::data_, OperatorEstBase::data_locality_, qmcplusplus::rank, and SpinDensityNew::species_size_.
|
friend |
}@
Definition at line 143 of file SpinDensityNew.h.
|
private |
Definition at line 140 of file SpinDensityNew.h.
Referenced by SpinDensityNew::accumulate(), SpinDensityNew::getFullDataSize(), SpinDensityNew::registerOperatorEstimator(), SpinDensityNew::report(), and SpinDensityNew::SpinDensityNew().
|
private |
Definition at line 126 of file SpinDensityNew.h.
Referenced by SpinDensityNew::SpinDensityNew().
|
private |
they should be limited to values that can be changed from input or are not present explicitly in the SpinDensityInput
Lattice is always local since it is either in the input or a constructor argument.
Definition at line 139 of file SpinDensityNew.h.
Referenced by SpinDensityNew::accumulate(), SpinDensityNew::report(), and SpinDensityNew::SpinDensityNew().
|
private |
Definition at line 127 of file SpinDensityNew.h.
Referenced by SpinDensityNew::accumulate(), SpinDensityNew::getFullDataSize(), SpinDensityNew::registerOperatorEstimator(), and SpinDensityNew::report().
|
private |
Definition at line 129 of file SpinDensityNew.h.
Referenced by SpinDensityNew::accumulate(), SpinDensityNew::report(), SpinDensityNew::spawnCrowdClone(), SpinDensityNew::startBlock(), and SpinDensityNewTests::testCopyConstructor().