17 #ifndef QMCPLUSPLUS_QMCFSLINEAROPTIMIZATION_VMCSINGLE_H 18 #define QMCPLUSPLUS_QMCFSLINEAROPTIMIZATION_VMCSINGLE_H 20 #include "Optimize/NRCOptimization.h" 21 #ifdef HAVE_LMY_ENGINE 22 #include "formic/utils/matrix.h" 23 #include "formic/utils/lmyengine/engine.h" 59 bool put(xmlNodePtr cur)
override;
61 bool processOptXML(xmlNodePtr cur,
const std::string& vmcMove,
bool reportH5);
73 app_log() <<
" Cost Function is Invalid. If this frequently, try reducing the step size of the line minimization " 74 "or reduce the number of cycles. " 81 const std::vector<RealType>& cv,
82 const std::vector<double>& sh,
94 #ifdef HAVE_LMY_ENGINE 106 const std::vector<double>& shiffts_s,
107 std::vector<std::vector<RealType>>& parameterDirections);
109 #ifdef HAVE_LMY_ENGINE 110 formic::VarDeps vdeps;
111 cqmc::engine::LMYEngine<ValueType>* EngineObj;
121 std::vector<double>
prepare_shifts(
const double central_shift)
const;
124 #ifdef HAVE_LMY_ENGINE 125 std::vector<formic::ColVec<double>> previous_update;
234 #ifdef HAVE_LMY_ENGINE 235 void engine_start(cqmc::engine::LMYEngine<ValueType>* EngineObj,
std::unique_ptr< HybridEngine > hybridEngineObj
bool targetExcited
whether we are targeting an excited state
std::unique_ptr< QMCDriver > vmcEngine
vmc engine
bool block_first
whether to do the first part of block lm
bool run() override
Run the Optimization algorithm.
NewTimer & eigenvalue_timer_
int nkept
number of directions kept
NewTimer & initialize_timer_
int nolds
number of old updates kept
void finish()
common operation to finish optimization, used by the derived classes
std::bitset< 2 > accept_history
accept history, remember the last 2 iterations, value 00, 01, 10, 11
RealType max_param_change
max amount a parameter may change relative to current wave function weight
A set of walkers that are to be advanced by Metropolis Monte Carlo.
helper functions for EinsplineSetBuilder
NewTimer & generate_samples_timer_
std::unique_ptr< GradientTest > testEngineObj
bool block_lm
whether we are doing block algorithm
std::unique_ptr< QMCCostFunctionBase > optTarget
target cost function to optimize
bool ValidCostFunction(bool valid)
LinearMethod related functions.
OutputMatrix output_overlap_
RealType Func(RealType dl) override
RealType max_relative_cost_change
the maximum relative change in the cost function for the adaptive three-shift scheme ...
void print_cost_summary_header()
bool block_second
whether to do the second part of block lm
Collection of Local Energy Operators.
int eigCG
number of previous steps to orthogonalize to.
int nsamp_comp
number of samples to do in correlated sampling part
Timer accumulates time and call counts.
std::string block_lmStr
whether we are doing block algorithm
RealType bestShift_i
the previous best identity shift
abstract base class for QMC engines
xmlNodePtr wfNode
xml node to be dumped
bool block_third
whether to do the third part of block lm
NewTimer & cost_function_timer_
bool adaptive_three_shift_run()
int TotalCGSteps
total number of cg steps per iterations
RealType shift_i_input
current shift_i, shift_s input values
std::vector< RealType > optdir
RealType shift_s_base
Shift_s adjustment base.
Wrapping information on parallelism.
OptimizerType previous_optimizer_type_
Declaration of QMCDriver.
std::vector< double > prepare_shifts(const double central_shift) const
OptimizerType current_optimizer_type_
std::string StabilizerMethod
OutputMatrix output_hamiltonian_
void start()
common operation to start optimization, used by the derived classes
std::vector< RealType > optparam
void solveShiftsWithoutLMYEngine(const std::vector< double > &shifts_i, const std::vector< double > &shiffts_s, std::vector< std::vector< RealType >> ¶meterDirections)
RealType omega_shift
the shift to use when targeting an excited state
std::unique_ptr< DescentEngine > descentEngineObj
bool processOptXML(xmlNodePtr cur, const std::string &vmcMove, bool reportH5)
process xml node value (parameters for both VMC and OPT) for the actual optimization ...
Class to represent a many-body trial wave function.
RealType cost_increase_tol
the tolerance to cost function increases when choosing the best shift in the adaptive shift method ...
std::string targetExcitedStr
whether we are targeting an excited state
int nblocks
number of blocks used in block algorithm
RealType target_shift_i
the shift_i value that the adaptive shift method should aim for
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)
QMCRunType getRunType() override
int num_shifts
number of shifts we will try
bool put(xmlNodePtr cur) override
preprocess xml node
int Max_iterations
Number of iterations maximum before generating new configurations.
bool output_matrices_initialized_
void setWaveFunctionNode(xmlNodePtr cur)
Implements wave-function optimization.
int NumOfVMCWalkers
total number of VMC walkers
Output the Hamiltonian and overlap matrices from linear method.
NewTimer & line_min_timer_
RealType bestShift_s
the previous best overlap shift
QMCFixedSampleLinearOptimize(const ProjectData &project_data, MCWalkerConfiguration &w, TrialWaveFunction &psi, QMCHamiltonian &h, Communicate *)
Constructor.
~QMCFixedSampleLinearOptimize() override
Destructor.
bool is_best_cost(const int ii, const std::vector< RealType > &cv, const std::vector< double > &sh, const RealType ic) const
NewTimer & involvmat_timer_