![]() |
QMCPACK
|
Classes | |
struct | LMYOptions |
Public Member Functions | |
QMCFixedSampleLinearOptimizeBatched (const ProjectData &project_data, QMCDriverInput &&qmcdriver_input, const std::optional< EstimatorManagerInput > &global_emi, VMCDriverInput &&vmcdriver_input, WalkerConfigurations &wc, MCPopulation &&population, SampleStack &samples, Communicate *comm) | |
Constructor. More... | |
~QMCFixedSampleLinearOptimizeBatched () override | |
Destructor. More... | |
QMCRunType | getRunType () override |
void | setWaveFunctionNode (xmlNodePtr cur) |
bool | run () override |
Run the Optimization algorithm. More... | |
void | process (xmlNodePtr cur) override |
preprocess xml node More... | |
bool | processOptXML (xmlNodePtr cur, const std::string &vmcMove, bool reportH5, bool useGPU) |
process xml node value (parameters for both VMC and OPT) for the actual optimization More... | |
RealType | costFunc (RealType dl) |
void | start () |
common operation to start optimization More... | |
void | finish () |
common operation to finish optimization, used by the derived classes More... | |
void | generateSamples () |
![]() | |
QMCDriverNew (const ProjectData &project_data, QMCDriverInput &&input, const std::optional< EstimatorManagerInput > &global_emi, WalkerConfigurations &wc, MCPopulation &&population, const std::string timer_prefix, Communicate *comm, const std::string &QMC_driver_type) | |
Constructor. More... | |
QMCDriverNew (QMCDriverNew &&)=default | |
Move Constructor. More... | |
QMCDriverNew (const QMCDriverNew &)=delete | |
Copy Constructor (disabled). More... | |
QMCDriverNew & | operator= (const QMCDriverNew &)=delete |
Copy operator (disabled). More... | |
~QMCDriverNew () override | |
bool | putQMCInfo (xmlNodePtr cur) |
void | makeLocalWalkers (int nwalkers, RealType reserve) |
Adjust populations local walkers to this number. More... | |
DriftModifierBase & | get_drift_modifier () const |
void | recordBlock (int block) override |
record the state of the block More... | |
bool | finalize (int block, bool dumpwalkers=true) |
finalize a qmc section More... | |
IndexType | current () const |
return current step More... | |
void | setStatus (const std::string &aname, const std::string &h5name, bool append) override |
Set the status of the QMCDriver. More... | |
void | add_H_and_Psi (QMCHamiltonian *h, TrialWaveFunction *psi) override |
void | createRngsStepContexts (int num_crowds) |
Creates Random Number generators for crowds and step contexts. More... | |
void | putWalkers (std::vector< xmlNodePtr > &wset) override |
Read walker configurations from *.config.h5 files. More... | |
RefVector< RandomBase< FullPrecRealType > > | getRngRefs () const |
RandomBase< FullPrecRealType > & | getRng (int i) override |
return the i-th random generator More... | |
std::string | getEngineName () override |
intended for logging output and debugging you should base behavior on type preferably at compile time or if necessary at runtime using and protected by dynamic cast. More... | |
unsigned long | getDriverMode () override |
IndexType | get_num_living_walkers () const |
IndexType | get_num_dead_walkers () const |
const QMCDriverInput & | getQMCDriverInput () const |
bool | put (xmlNodePtr cur) override |
More... | |
void | setUpdateMode (bool pbyp) override |
should be set in input don't see a reason to set individually More... | |
void | putTraces (xmlNodePtr txml) override |
void | requestTraces (bool allow_traces) override |
void | putWalkerLogs (xmlNodePtr wlxml) override |
void | requestWalkerLogs (bool allow_walker_logs_) override |
![]() | |
virtual | ~QMCDriverInterface () |
virtual void | setBranchEngine (std::unique_ptr< BranchEngineType > &&be) |
virtual std::unique_ptr< BranchEngineType > | getBranchEngine () |
![]() | |
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 Member Functions | |
bool | ValidCostFunction (bool valid) |
bool | is_best_cost (const int ii, const std::vector< RealType > &cv, const std::vector< double > &sh, const RealType ic) const |
Returns whether the proposed new cost is the best compared to the others. More... | |
bool | adaptive_three_shift_run () |
bool | one_shift_run () |
Performs one iteration of the linear method using an adaptive scheme that tries three different shift magnitudes and picks the best one. More... | |
bool | descent_run () |
bool | previous_linear_methods_run () |
bool | test_run () |
void | solveShiftsWithoutLMYEngine (const std::vector< double > &shifts_i, const std::vector< double > &shiffts_s, std::vector< std::vector< RealType >> ¶meterDirections) |
For each set of shifts, solves the linear method eigenproblem by building and diagonalizing the matrices. More... | |
std::vector< double > | prepare_shifts (const double central_shift) const |
returns a vector of three shift values centered around the provided shift. More... | |
void | print_cost_summary_header () |
prints a header for the summary of each shift's result More... | |
void | print_cost_summary (const double si, const double ss, const RealType mc, const RealType cv, const int ind, const int bi, const bool gu) |
prints a summary of the computed cost for the given shift More... | |
![]() | |
Real | getLowestEigenvector (Matrix< Real > &A, std::vector< Real > &ev) const |
Real | getNonLinearRescale (std::vector< Real > &dP, Matrix< Real > &S, const QMCCostFunctionBase &optTarget) const |
Additional Inherited Members | |
![]() | |
enum | { QMC_UPDATE_MODE, QMC_MULTIPLE, QMC_OPTIMIZE, QMC_WARMUP } |
separate but similar to QMCModeEnum More... | |
using | RealType = QMCTraits::RealType |
using | IndexType = QMCTraits::IndexType |
using | FullPrecRealType = QMCTraits::FullPrecRealType |
using | MCPWalker = MCPopulation::MCPWalker |
using | WFBuffer = MCPopulation::WFBuffer |
using | SetNonLocalMoveHandler = std::function< void(QMCHamiltonian &)> |
![]() | |
using | BranchEngineType = SimpleFixedNodeBranch |
using | FullPrecRealType = QMCTraits::FullPrecRealType |
![]() | |
using | mpi_comm_type = Communicate::mpi_comm_type |
![]() | |
static void | initialLogEvaluation (int crowd_id, UPtrVector< Crowd > &crowds, UPtrVector< ContextForSteps > &step_context) |
template<typename RT , CoordsType CT> | |
static void | scaleBySqrtTau (const TauParams< RT, CT > &taus, MCCoords< CT > &coords) |
template<typename RT , CoordsType CT> | |
static void | computeLogGreensFunction (const MCCoords< CT > &coords, const TauParams< RT, CT > &taus, std::vector< QMCTraits::RealType > &log_gb) |
calculates Green Function from displacements stored in MCCoords [param, out] log_g More... | |
![]() | |
std::bitset< QMC_MODE_MAX > | qmc_driver_mode_ |
bits to classify QMCDriver More... | |
bool | allow_walker_logs |
whether to allow walker logs More... | |
WalkerLogInput | walker_logs_input |
walker logs input More... | |
![]() | |
void | initializeQMC (const AdjustedWalkerCounts &awc) |
Do common section starting tasks for VMC and DMC. More... | |
void | measureImbalance (const std::string &tag) const |
inject additional barrier and measure load imbalance. More... | |
void | endBlock () |
end of a block operations. Aggregates statistics across all MPI ranks and write to disk. More... | |
const std::string & | get_root_name () const override |
![]() | |
static QMCDriverNew::AdjustedWalkerCounts | adjustGlobalWalkerCount (Communicate &comm, const IndexType current_configs, const IndexType requested_total_walkers, const IndexType requested_walkers_per_rank, const RealType reserve_walkers, int num_crowds) |
}@ More... | |
static size_t | determineStepsPerBlock (IndexType global_walkers, IndexType requested_samples, IndexType requested_steps, IndexType blocks) |
pure function calculating the actual number of steps per block More... | |
static void | checkNumCrowdsLTNumThreads (const int num_crowds) |
static void | checkLogAndGL (Crowd &crowd, const std::string_view location) |
check logpsi and grad and lap against values computed from scratch More... | |
static void | setWalkerOffsets (WalkerConfigurations &, Communicate *comm) |
update the global offsets of walker configurations after active walkers being touched. More... | |
![]() | |
QMCDriverInput | qmcdriver_input_ |
RealType | max_disp_sq_ |
they should be limited to values that can be changed from input or are live state. More... | |
IndexType | target_samples_ |
the number of saved samples More... | |
IndexType | nBlocksBetweenRecompute |
the number of blocks between recomptePsi More... | |
UPtrVector< Crowd > | crowds_ |
}@ More... | |
std::string | h5_file_root_ |
std::unique_ptr< DriftModifierBase > | drift_modifier_ |
drift modifer More... | |
int | k_delay |
the number to delay updates by More... | |
int | walker_dump_period |
period of recording walker configurations More... | |
IndexType | current_step_ |
size_t | steps_per_block_ = 0 |
actual number of steps per block More... | |
IndexType | nAccept |
counter for number of moves accepted More... | |
IndexType | nReject |
counter for number of moves /rejected More... | |
RealType | m_oneover2tau |
Time-step factor ![]() | |
RealType | m_sqrttau |
Time-step factor ![]() | |
const std::string | QMCType |
type of qmc: assigned by subclasses More... | |
MCPopulation | population_ |
the entire (on node) walker population it serves VMCBatch and DMCBatch right now but will be polymorphic More... | |
struct DriverWalkerResourceCollection | golden_resource_ |
the golden multi walker shared resource serves ParticleSet TrialWaveFunction right now but actually should be based on MCPopulation. More... | |
const MultiWalkerDispatchers | dispatchers_ |
multi walker dispatchers More... | |
std::unique_ptr< EstimatorManagerNew > | estimator_manager_ |
Observables manager Has very problematic owner ship and life cycle. More... | |
std::unique_ptr< HDFWalkerOutput > | wOut |
record engine for walkers More... | |
UPtrVector< ContextForSteps > | step_contexts_ |
Per crowd move contexts, this is where the DistanceTables etc. More... | |
UPtrVector< RandomBase< FullPrecRealType > > | Rng |
Random number generators. More... | |
std::vector< xmlNodePtr > | mcwalkerNodePtr |
a list of mcwalkerset element More... | |
DriverTimers | timers_ |
period of dumping walker configurations and everything else for restart More... | |
ScopedProfiler | driver_scope_profiler_ |
profile the driver lifetime More... | |
const ProjectData & | project_data_ |
project info for accessing global fileroot and series id More... | |
WalkerConfigurations & | walker_configs_ref_ |
![]() | |
Communicate * | myComm |
pointer to Communicate More... | |
std::string | ClassName |
class Name More... | |
std::string | myName |
name of the object More... | |
![]() | |
static Real | selectEigenvalue (std::vector< Real > &eigenvals, Matrix< Real > &eigenvectors, Real zerozero, std::vector< Real > &ev) |
Select eigenvalue and return corresponding scaled eigenvector. More... | |
static Real | getLowestEigenvector_Inv (Matrix< Real > &A, Matrix< Real > &B, std::vector< Real > &ev) |
Solve the generalized eigenvalue problem and return a scaled eigenvector corresponding to the selected eigenvalue. More... | |
static Real | getLowestEigenvector_Gen (Matrix< Real > &A, Matrix< Real > &B, std::vector< Real > &ev) |
Solve the generalized eigenvalue problem and return a scaled eigenvector corresponding to the selected eigenvalue. More... | |
Definition at line 52 of file QMCFixedSampleLinearOptimizeBatched.h.
struct qmcplusplus::QMCFixedSampleLinearOptimizeBatched::LMYOptions |
Definition at line 208 of file QMCFixedSampleLinearOptimizeBatched.h.
Class Members | ||
---|---|---|
bool | block_first | whether to do the first part of block lm |
bool | block_lm | whether we are doing block algorithm |
bool | block_second | whether to do the second part of block lm |
bool | block_third | whether to do the third part of block lm |
RealType | cost_increase_tol | the tolerance to cost function increases when choosing the best shift in the adaptive shift method |
OptimizerType | current_optimizer_type | type of the current optimization method, updated by processOptXML before run |
bool | doHybrid | whether to use hybrid method |
bool | filter_info | whether to filter parameters for the lm |
bool | filter_param | whether to filter parameters for the lm |
RealType | max_param_change | max amount a parameter may change relative to current wave function weight |
RealType | max_relative_cost_change | the maximum relative change in the cost function for the adaptive three-shift scheme |
int | nblocks | number of blocks used in block algorithm |
int | nkept | number of directions kept |
int | nolds | number of old updates kept |
int | nsamp_comp | number of samples to do in correlated sampling part |
int | num_shifts | number of shifts we will try |
RealType | omega_shift | the shift to use when targeting an excited state |
OptimizerType | previous_optimizer_type | type of the previous optimization method, updated by processOptXML before run |
double | ratio_threshold | threshold for filtering parameters for the lm |
bool | store_samples | whether to store samples for the lm |
RealType | target_shift_i | the shift_i value that the adaptive shift method should aim for |
bool | targetExcited | whether we are targeting an excited state |
QMCFixedSampleLinearOptimizeBatched | ( | const ProjectData & | project_data, |
QMCDriverInput && | qmcdriver_input, | ||
const std::optional< EstimatorManagerInput > & | global_emi, | ||
VMCDriverInput && | vmcdriver_input, | ||
WalkerConfigurations & | wc, | ||
MCPopulation && | population, | ||
SampleStack & | samples, | ||
Communicate * | comm | ||
) |
Constructor.
Definition at line 49 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References ParameterSet::add(), qmcplusplus::app_log(), QMCFixedSampleLinearOptimizeBatched::bigChange, QMCFixedSampleLinearOptimizeBatched::LMYOptions::block_lm, QMCFixedSampleLinearOptimizeBatched::LMYOptions::cost_increase_tol, QMCFixedSampleLinearOptimizeBatched::exp0, QMCFixedSampleLinearOptimizeBatched::LMYOptions::filter_info, QMCFixedSampleLinearOptimizeBatched::LMYOptions::filter_param, QMCFixedSampleLinearOptimizeBatched::m_param, QMCFixedSampleLinearOptimizeBatched::Max_iterations, QMCFixedSampleLinearOptimizeBatched::LMYOptions::max_param_change, QMCFixedSampleLinearOptimizeBatched::LMYOptions::max_relative_cost_change, QMCFixedSampleLinearOptimizeBatched::MinMethod, QMCFixedSampleLinearOptimizeBatched::LMYOptions::nblocks, QMCFixedSampleLinearOptimizeBatched::LMYOptions::nkept, QMCFixedSampleLinearOptimizeBatched::LMYOptions::nolds, QMCFixedSampleLinearOptimizeBatched::LMYOptions::nsamp_comp, QMCFixedSampleLinearOptimizeBatched::nstabilizers, QMCFixedSampleLinearOptimizeBatched::LMYOptions::num_shifts, QMCFixedSampleLinearOptimizeBatched::LMYOptions::omega_shift, QMCFixedSampleLinearOptimizeBatched::options_LMY_, QMCFixedSampleLinearOptimizeBatched::param_tol, QMCDriverNew::qmc_driver_mode_, QMCDriverNew::QMC_OPTIMIZE, QMCFixedSampleLinearOptimizeBatched::LMYOptions::ratio_threshold, QMCFixedSampleLinearOptimizeBatched::shift_i_input, QMCFixedSampleLinearOptimizeBatched::shift_s_input, QMCFixedSampleLinearOptimizeBatched::stabilizerScale, QMCFixedSampleLinearOptimizeBatched::LMYOptions::store_samples, QMCFixedSampleLinearOptimizeBatched::LMYOptions::target_shift_i, and QMCFixedSampleLinearOptimizeBatched::LMYOptions::targetExcited.
|
override |
Destructor.
Clean up the vector.
Definition at line 173 of file QMCFixedSampleLinearOptimizeBatched.cpp.
|
private |
Referenced by QMCFixedSampleLinearOptimizeBatched::run().
QMCFixedSampleLinearOptimizeBatched::RealType costFunc | ( | RealType | dl | ) |
Definition at line 180 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References QMCFixedSampleLinearOptimizeBatched::objFuncWrapper_, QMCFixedSampleLinearOptimizeBatched::optdir, QMCFixedSampleLinearOptimizeBatched::optparam, and QMCFixedSampleLinearOptimizeBatched::optTarget.
|
private |
Referenced by QMCFixedSampleLinearOptimizeBatched::run().
void finish | ( | ) |
common operation to finish optimization, used by the derived classes
Definition at line 258 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References QMCFixedSampleLinearOptimizeBatched::optTarget.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::test_run().
void generateSamples | ( | ) |
Definition at line 265 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References qmcplusplus::app_log(), Timer::elapsed(), QMCFixedSampleLinearOptimizeBatched::generate_samples_timer_, QMCDriverNew::get_root_name(), QMCDriverNew::h5_file_root_, QMCFixedSampleLinearOptimizeBatched::optTarget, SampleStack::resetSampleCount(), QMCFixedSampleLinearOptimizeBatched::samples_, and QMCFixedSampleLinearOptimizeBatched::vmcEngine.
Referenced by QMCFixedSampleLinearOptimizeBatched::start().
|
inlineoverridevirtual |
Implements QMCDriverInterface.
Definition at line 68 of file QMCFixedSampleLinearOptimizeBatched.h.
References qmcplusplus::LINEAR_OPTIMIZE.
|
private |
Returns whether the proposed new cost is the best compared to the others.
[in] | ii | index of the proposed best cost |
[in] | cv | vector of new costs |
[in] | sh | vector of identity shifts (shift_i values) |
[in] | ic | the initial cost |
Definition at line 885 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References qmcplusplus::abs(), QMCFixedSampleLinearOptimizeBatched::LMYOptions::cost_increase_tol, QMCFixedSampleLinearOptimizeBatched::LMYOptions::max_relative_cost_change, QMCFixedSampleLinearOptimizeBatched::options_LMY_, and QMCFixedSampleLinearOptimizeBatched::LMYOptions::target_shift_i.
|
private |
Performs one iteration of the linear method using an adaptive scheme that tries three different shift magnitudes and picks the best one.
The scheme is adaptive in that it saves the best shift to use as a starting point in the next iteration. Note that the best shift is chosen based on a different sample than that used to construct the linear method matrices in order to avoid over-optimizing on a particular sample.
Definition at line 1569 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References qmcplusplus::abs(), QMCFixedSampleLinearOptimizeBatched::accept_history, qmcplusplus::app_log(), Communicate::bcast(), QMCFixedSampleLinearOptimizeBatched::bestShift_i, QMCFixedSampleLinearOptimizeBatched::bestShift_s, QMCFixedSampleLinearOptimizeBatched::build_olv_ham_timer_, hdf_archive::close(), Matrix< T, Alloc >::copy(), hdf_archive::create(), QMCFixedSampleLinearOptimizeBatched::do_output_matrices_csv_, QMCFixedSampleLinearOptimizeBatched::do_output_matrices_hdf_, qmcplusplus::Units::charge::e, QMCFixedSampleLinearOptimizeBatched::eigensolver_, QMCFixedSampleLinearOptimizeBatched::eigenvalue_timer_, Timer::elapsed(), QMCFixedSampleLinearOptimizeBatched::finish(), QMCFixedSampleLinearOptimizeBatched::freeze_parameters_, QMCDriverNew::get_root_name(), LinearMethod::getLowestEigenvector_Gen(), LinearMethod::getLowestEigenvector_Inv(), LinearMethod::getNonLinearRescale(), MPIObjectBase::is_manager(), qmcplusplus::isnan(), MPIObjectBase::myComm, qmcplusplus::Units::force::N, QMCFixedSampleLinearOptimizeBatched::objFuncWrapper_, QMCFixedSampleLinearOptimizeBatched::optTarget, OutputMatrix::output(), QMCFixedSampleLinearOptimizeBatched::output_hamiltonian_, QMCFixedSampleLinearOptimizeBatched::output_overlap_, QMCFixedSampleLinearOptimizeBatched::shift_s_base, qmcplusplus::sqrt(), QMCFixedSampleLinearOptimizeBatched::start(), and hdf_archive::write().
Referenced by QMCFixedSampleLinearOptimizeBatched::run().
|
private |
returns a vector of three shift values centered around the provided shift.
[in] | central_shift | the central shift |
Definition at line 779 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References QMCFixedSampleLinearOptimizeBatched::LMYOptions::num_shifts, and QMCFixedSampleLinearOptimizeBatched::options_LMY_.
|
private |
Definition at line 334 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References qmcplusplus::abs(), qmcplusplus::app_log(), QMCFixedSampleLinearOptimizeBatched::bigChange, Matrix< T, Alloc >::copy(), QMCFixedSampleLinearOptimizeBatched::cost_function_timer_, qmcplusplus::Units::charge::e, QMCFixedSampleLinearOptimizeBatched::eigenvalue_timer_, qmcplusplus::exp(), QMCFixedSampleLinearOptimizeBatched::exp0, QMCFixedSampleLinearOptimizeBatched::finish(), LinearMethod::getLowestEigenvector(), LinearMethod::getNonLinearRescale(), qmcplusplus::invert_matrix(), QMCFixedSampleLinearOptimizeBatched::line_min_timer_, QMCFixedSampleLinearOptimizeBatched::Max_iterations, QMCFixedSampleLinearOptimizeBatched::MinMethod, qmcplusplus::Units::force::N, QMCFixedSampleLinearOptimizeBatched::nstabilizers, QMCFixedSampleLinearOptimizeBatched::objFuncWrapper_, QMCFixedSampleLinearOptimizeBatched::optdir, QMCFixedSampleLinearOptimizeBatched::optparam, QMCFixedSampleLinearOptimizeBatched::optTarget, QMCFixedSampleLinearOptimizeBatched::param_tol, qmcplusplus::MatrixOperators::product(), QMCFixedSampleLinearOptimizeBatched::stabilizerScale, QMCFixedSampleLinearOptimizeBatched::start(), TimerType< CLOCK >::start(), TimerType< CLOCK >::stop(), and QMCFixedSampleLinearOptimizeBatched::ValidCostFunction().
Referenced by QMCFixedSampleLinearOptimizeBatched::run().
|
private |
prints a summary of the computed cost for the given shift
[in] | si | the identity shift |
[in] | ss | the overlap shift |
[in] | mc | the maximum parameter change |
[in] | cv | the cost function value |
[in] | ind | the shift index: -1 (for initial state), 0, 1, or 2 |
[in] | bi | index of the best shift |
[in] | gu | flag telling whether it was a good update |
Definition at line 836 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References qmcplusplus::app_log().
|
private |
prints a header for the summary of each shift's result
Definition at line 810 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References qmcplusplus::app_log().
|
overridevirtual |
preprocess xml node
Parses the xml input file for parameter definitions for the wavefunction optimization.
q | current xmlNode |
Implements QMCDriverNew.
Definition at line 562 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References OhmmsAttributeSet::add(), ParameterSet::add(), qmcplusplus::app_log(), qmcplusplus::app_warning(), QMCFixedSampleLinearOptimizeBatched::do_output_matrices_csv_, QMCFixedSampleLinearOptimizeBatched::do_output_matrices_hdf_, QMCFixedSampleLinearOptimizeBatched::doGradientTest, QMCFixedSampleLinearOptimizeBatched::LMYOptions::doHybrid, QMCFixedSampleLinearOptimizeBatched::eigensolver_, QMCFixedSampleLinearOptimizeBatched::freeze_parameters_, getXMLAttributeValue(), QMCFixedSampleLinearOptimizeBatched::hybridEngineObj, QMCFixedSampleLinearOptimizeBatched::m_param, QMCFixedSampleLinearOptimizeBatched::MinMethod, MPIObjectBase::myComm, QMCFixedSampleLinearOptimizeBatched::options_LMY_, processChildren(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), ParameterSet::put(), OhmmsAttributeSet::put(), GradientTestInput::readXML(), and QMCFixedSampleLinearOptimizeBatched::testEngineObj.
bool processOptXML | ( | xmlNodePtr | cur, |
const std::string & | vmcMove, | ||
bool | reportH5, | ||
bool | useGPU | ||
) |
process xml node value (parameters for both VMC and OPT) for the actual optimization
Definition at line 646 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References qmcplusplus::ADAPTIVE, QMCDriverNew::adjustGlobalWalkerCount(), APP_ABORT, qmcplusplus::app_log(), QMCFixedSampleLinearOptimizeBatched::bestShift_i, QMCFixedSampleLinearOptimizeBatched::bestShift_s, OHMMS::Controller, QMCFixedSampleLinearOptimizeBatched::LMYOptions::cost_increase_tol, QMCFixedSampleLinearOptimizeBatched::LMYOptions::current_optimizer_type, qmcplusplus::DESCENT, QMCFixedSampleLinearOptimizeBatched::descentEngineObj, QMCFixedSampleLinearOptimizeBatched::LMYOptions::doHybrid, MCPopulation::get_golden_electrons(), MCPopulation::get_golden_hamiltonian(), MCPopulation::get_golden_twf(), QMCDriverInput::get_num_crowds(), QMCDriverNew::get_root_name(), QMCDriverInput::get_total_walkers(), QMCDriverInput::get_walkers_per_rank(), WalkerConfigurations::getActiveWalkers(), QMCFixedSampleLinearOptimizeBatched::global_emi_, QMCDriverNew::h5_file_root_, QMCFixedSampleLinearOptimizeBatched::hybridEngineObj, QMCFixedSampleLinearOptimizeBatched::m_param, QMCFixedSampleLinearOptimizeBatched::LMYOptions::max_param_change, QMCFixedSampleLinearOptimizeBatched::LMYOptions::max_relative_cost_change, QMCDriverNew::mcwalkerNodePtr, QMCFixedSampleLinearOptimizeBatched::MinMethod, MPIObjectBase::myComm, omp_get_max_threads(), qmcplusplus::ONESHIFTONLY, qmcplusplus::OptimizerNames, QMCFixedSampleLinearOptimizeBatched::options_LMY_, QMCFixedSampleLinearOptimizeBatched::optTarget, QMCDriverNew::population_, QMCFixedSampleLinearOptimizeBatched::LMYOptions::previous_optimizer_type, QMCDriverNew::project_data_, ParameterSet::put(), QMCDriverNew::qmcdriver_input_, Communicate::rank(), VMCDriverInput::readXML(), QMCDriverInput::readXML(), QMCFixedSampleLinearOptimizeBatched::samples_, QMCFixedSampleLinearOptimizeBatched::shift_i_input, QMCFixedSampleLinearOptimizeBatched::shift_s_input, Communicate::size(), QMCFixedSampleLinearOptimizeBatched::LMYOptions::targetExcited, QMCFixedSampleLinearOptimizeBatched::vmcdriver_input_, QMCFixedSampleLinearOptimizeBatched::vmcEngine, QMCDriverNew::walker_configs_ref_, and QMCDriverNew::AdjustedWalkerCounts::walkers_per_crowd.
Referenced by QMCFixedSampleLinearOptimizeBatched::process().
|
overridevirtual |
Run the Optimization algorithm.
Implements QMCDriverInterface.
Definition at line 284 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References qmcplusplus::ADAPTIVE, QMCFixedSampleLinearOptimizeBatched::adaptive_three_shift_run(), qmcplusplus::app_log(), QMCFixedSampleLinearOptimizeBatched::LMYOptions::current_optimizer_type, qmcplusplus::DESCENT, QMCFixedSampleLinearOptimizeBatched::descent_run(), QMCFixedSampleLinearOptimizeBatched::do_output_matrices_csv_, QMCFixedSampleLinearOptimizeBatched::doGradientTest, QMCFixedSampleLinearOptimizeBatched::LMYOptions::doHybrid, QMCDriverNew::get_root_name(), OutputMatrix::init_file(), qmcplusplus::Units::force::N, QMCFixedSampleLinearOptimizeBatched::one_shift_run(), qmcplusplus::ONESHIFTONLY, QMCFixedSampleLinearOptimizeBatched::options_LMY_, QMCFixedSampleLinearOptimizeBatched::optTarget, QMCFixedSampleLinearOptimizeBatched::output_hamiltonian_, QMCFixedSampleLinearOptimizeBatched::output_matrices_initialized_, QMCFixedSampleLinearOptimizeBatched::output_overlap_, QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::test_run().
|
inline |
Definition at line 70 of file QMCFixedSampleLinearOptimizeBatched.h.
References QMCFixedSampleLinearOptimizeBatched::wfNode.
|
private |
For each set of shifts, solves the linear method eigenproblem by building and diagonalizing the matrices.
[in] | shfits_i | vector of identity shifts |
[in] | shfits_s | vector of overlap shifts |
[out] | parameterDirections | on exit, the update directions for the different shifts |
Definition at line 961 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References Matrix< T, Alloc >::copy(), LinearMethod::getLowestEigenvector(), LinearMethod::getNonLinearRescale(), qmcplusplus::invert_matrix(), qmcplusplus::Units::force::N, QMCFixedSampleLinearOptimizeBatched::objFuncWrapper_, QMCFixedSampleLinearOptimizeBatched::optTarget, and qmcplusplus::MatrixOperators::product().
void start | ( | ) |
common operation to start optimization
Definition at line 191 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References qmcplusplus::app_log(), Timer::elapsed(), QMCFixedSampleLinearOptimizeBatched::generateSamples(), QMCFixedSampleLinearOptimizeBatched::initialize_timer_, QMCFixedSampleLinearOptimizeBatched::optTarget, QMCFixedSampleLinearOptimizeBatched::vmcEngine, and QMCFixedSampleLinearOptimizeBatched::wfNode.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::test_run().
|
private |
Definition at line 322 of file QMCFixedSampleLinearOptimizeBatched.cpp.
References QMCFixedSampleLinearOptimizeBatched::finish(), QMCDriverNew::get_root_name(), QMCFixedSampleLinearOptimizeBatched::optTarget, QMCFixedSampleLinearOptimizeBatched::start(), and QMCFixedSampleLinearOptimizeBatched::testEngineObj.
Referenced by QMCFixedSampleLinearOptimizeBatched::run().
|
inlineprivate |
Definition at line 101 of file QMCFixedSampleLinearOptimizeBatched.h.
References qmcplusplus::app_log().
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run().
|
private |
accept history, remember the last 2 iterations, value 00, 01, 10, 11
Definition at line 196 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run().
|
private |
the previous best identity shift
Definition at line 190 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), and QMCFixedSampleLinearOptimizeBatched::processOptXML().
|
private |
the previous best overlap shift
Definition at line 192 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), and QMCFixedSampleLinearOptimizeBatched::processOptXML().
|
private |
Definition at line 188 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
Definition at line 281 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run().
|
private |
Definition at line 285 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run().
|
private |
Definition at line 150 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::processOptXML().
|
private |
Definition at line 265 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), QMCFixedSampleLinearOptimizeBatched::process(), and QMCFixedSampleLinearOptimizeBatched::run().
|
private |
Definition at line 268 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), and QMCFixedSampleLinearOptimizeBatched::process().
|
private |
Definition at line 262 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::process(), and QMCFixedSampleLinearOptimizeBatched::run().
|
private |
Choice of eigenvalue solver.
Definition at line 184 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), and QMCFixedSampleLinearOptimizeBatched::process().
|
private |
Definition at line 283 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), and QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run().
|
private |
Definition at line 188 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
Definition at line 277 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), and QMCFixedSampleLinearOptimizeBatched::process().
|
private |
Definition at line 280 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::generateSamples().
|
private |
This is retained in order to construct and reconstruct the vmcEngine.
Definition at line 302 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::processOptXML().
|
private |
Definition at line 153 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::process(), and QMCFixedSampleLinearOptimizeBatched::processOptXML().
|
private |
Definition at line 279 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::start().
|
private |
Definition at line 282 of file QMCFixedSampleLinearOptimizeBatched.h.
|
private |
Definition at line 284 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run().
|
private |
Definition at line 290 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::process(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
Number of iterations maximum before generating new configurations.
Definition at line 178 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
name of the current optimization method, updated by processOptXML before run
Definition at line 205 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), QMCFixedSampleLinearOptimizeBatched::process(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
Number of iterations maximum before generating new configurations.
Definition at line 187 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
Definition at line 99 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::costFunc(), QMCFixedSampleLinearOptimizeBatched::one_shift_run(), QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::solveShiftsWithoutLMYEngine().
|
private |
Definition at line 175 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::costFunc(), and QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run().
|
private |
LMY engine related options.
Definition at line 257 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::is_best_cost(), QMCFixedSampleLinearOptimizeBatched::prepare_shifts(), QMCFixedSampleLinearOptimizeBatched::process(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched(), and QMCFixedSampleLinearOptimizeBatched::run().
|
private |
Definition at line 175 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::costFunc(), and QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run().
|
private |
target cost function to optimize
Definition at line 293 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::costFunc(), QMCFixedSampleLinearOptimizeBatched::finish(), QMCFixedSampleLinearOptimizeBatched::generateSamples(), QMCFixedSampleLinearOptimizeBatched::one_shift_run(), QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), QMCFixedSampleLinearOptimizeBatched::run(), QMCFixedSampleLinearOptimizeBatched::solveShiftsWithoutLMYEngine(), QMCFixedSampleLinearOptimizeBatched::start(), and QMCFixedSampleLinearOptimizeBatched::test_run().
|
private |
Definition at line 273 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), and QMCFixedSampleLinearOptimizeBatched::run().
|
private |
Definition at line 271 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::run().
|
private |
Definition at line 274 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run(), and QMCFixedSampleLinearOptimizeBatched::run().
|
private |
Definition at line 180 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
Definition at line 299 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::generateSamples(), and QMCFixedSampleLinearOptimizeBatched::processOptXML().
|
private |
current shift_i, shift_s input values
Definition at line 194 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::processOptXML(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
Shift_s adjustment base.
Definition at line 198 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::one_shift_run().
|
private |
Definition at line 194 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::processOptXML(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
Definition at line 188 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::previous_linear_methods_run(), and QMCFixedSampleLinearOptimizeBatched::QMCFixedSampleLinearOptimizeBatched().
|
private |
Definition at line 137 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::process(), and QMCFixedSampleLinearOptimizeBatched::test_run().
|
private |
Definition at line 298 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::processOptXML().
|
private |
vmc engine
Definition at line 296 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::generateSamples(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), and QMCFixedSampleLinearOptimizeBatched::start().
|
private |
xml node to be dumped
Definition at line 288 of file QMCFixedSampleLinearOptimizeBatched.h.
Referenced by QMCFixedSampleLinearOptimizeBatched::setWaveFunctionNode(), and QMCFixedSampleLinearOptimizeBatched::start().