#include <QMCEigenSearch.h>
Public Member Functions | |
QMCEigenSearch (QMCObjectiveFunction *function, QMCLineSearchStepLengthSelectionAlgorithm *stepAlg, int maxSteps, double tol) | |
Constructs and initializes an instance of this class. | |
virtual | ~QMCEigenSearch () |
Virtual destructor. | |
double | get_a_diag (QMCDerivativeProperties &dp, double factor) |
void | setupHalfStep () |
Array1D< double > | getParameters (QMCDerivativeProperties &dp, double a_diag, bool verbose) |
Array1D< double > | optimize (Array1D< double > &initialGuess, QMCDerivativeProperties &dp, double a_diag_factor, int optStep) |
Optimize the function starting from the provided initial guess parameters. | |
Protected Member Functions | |
QMCObjectiveFunction * | getObjectiveFunction () |
Gets the objective function for the calculation. | |
Protected Attributes | |
int | optStep |
int | dim |
stringstream | stepinfo |
Static Protected Attributes | |
static bool | currentlyHalf = true |
static vector< double > | f |
static vector< double > | variance |
static vector< Array1D< double > > | x |
Private Attributes | |
QMCObjectiveFunction * | OF |
Objective function to optimize. | |
QMCLineSearchStepLengthSelectionAlgorithm * | stepLengthAlg |
Step length determining algorithm to use. | |
double | epsilon |
Tolerance to converge the solution to. | |
int | maximumSteps |
Maximum number of steps allowed for the search. | |
Static Private Attributes | |
static int | orig_steps = 0 |
static vector< double > | adiag_tests |
static Array1D< double > | orig_params |
static Array2D< double > | hamiltonian |
static Array2D< double > | overlap |
As is standard in the field, the optimization is a minimization.
Definition at line 29 of file QMCEigenSearch.h.
QMCEigenSearch::QMCEigenSearch | ( | QMCObjectiveFunction * | function, | |
QMCLineSearchStepLengthSelectionAlgorithm * | stepAlg, | |||
int | maxSteps, | |||
double | tol | |||
) |
Constructs and initializes an instance of this class.
function | objective function to optimize. | |
stepAlg | algorithm to use claculate the step length. | |
maxSteps | maximum number of steps to be performed during the line search. | |
tol | tolerance to converge the solution to. Calculation is converged when . |
Definition at line 32 of file QMCEigenSearch.cpp.
References dim, epsilon, maximumSteps, OF, and stepLengthAlg.
virtual QMCEigenSearch::~QMCEigenSearch | ( | ) | [inline, virtual] |
double QMCEigenSearch::get_a_diag | ( | QMCDerivativeProperties & | dp, | |
double | factor | |||
) |
Definition at line 44 of file QMCEigenSearch.cpp.
References QMCFlags::a_diag, adiag_tests, Array1D< T >::dim1(), QMCInput::flags, FunctionR1toR1::function(), QMCDerivativeProperties::getCorrelatedSamples(), globalInput, CubicSpline::initializeWithFunctionValues(), IeeeMath::isNaN(), FunctionR1toR1::minimum(), QMCFlags::optimize_Psi_method, optStep, and Array1D< T >::size().
Referenced by optimize().
void QMCEigenSearch::setupHalfStep | ( | ) |
Array1D< double > QMCEigenSearch::getParameters | ( | QMCDerivativeProperties & | dp, | |
double | a_diag, | |||
bool | verbose | |||
) |
Definition at line 333 of file QMCEigenSearch.cpp.
References dim, Array1D< T >::dim1(), Array2D< T >::dim1(), QMCInput::flags, Array2D< T >::generalizedEigenvectors(), globalInput, hamiltonian, IeeeMath::isNaN(), QMCFlags::ksi, OF, orig_params, overlap, QMCInput::printAIParameters(), Array2D< T >::printArray2D(), stepinfo, QMCLineSearchStepLengthSelectionAlgorithm::stepLength(), and stepLengthAlg.
Referenced by optimize().
Array1D< double > QMCEigenSearch::optimize | ( | Array1D< double > & | initialGuess, | |
QMCDerivativeProperties & | dp, | |||
double | , | |||
int | ||||
) | [virtual] |
Optimize the function starting from the provided initial guess parameters.
initialGuess | initial guess parameters for the optimization. |
Implements QMCOptimizationAlgorithm.
Definition at line 168 of file QMCEigenSearch.cpp.
References QMCFlags::a_diag, adiag_tests, Array1D< T >::allocate(), QMCFlags::calculate_Derivatives, QMCInput::cs_Parameters, currentlyHalf, Array1D< T >::deallocate(), dim, Array1D< T >::dim1(), QMCFlags::energy_trial, QMCFlags::equilibration_steps, f, QMCInput::flags, get_a_diag(), QMCDerivativeProperties::getParameterGradient(), QMCDerivativeProperties::getParameterHamiltonian(), QMCDerivativeProperties::getParameterOverlap(), getParameters(), QMCDerivativeProperties::getParameterValue(), QMCDerivativeProperties::getSampleVariance(), globalInput, hamiltonian, QMCFlags::max_time_steps, QMCFlags::optimize_L, optStep, orig_params, orig_steps, overlap, QMCInput::printAIParameters(), stepinfo, variance, and x.
QMCObjectiveFunction * QMCEigenSearch::getObjectiveFunction | ( | ) | [protected] |
Gets the objective function for the calculation.
Definition at line 499 of file QMCEigenSearch.cpp.
References OF.
bool QMCEigenSearch::currentlyHalf = true [static, protected] |
int QMCEigenSearch::optStep [protected] |
int QMCEigenSearch::dim [protected] |
Definition at line 71 of file QMCEigenSearch.h.
Referenced by getParameters(), optimize(), and QMCEigenSearch().
stringstream QMCEigenSearch::stepinfo [protected] |
vector< double > QMCEigenSearch::f [static, protected] |
vector< double > QMCEigenSearch::variance [static, protected] |
vector< Array1D< double > > QMCEigenSearch::x [static, protected] |
int QMCEigenSearch::orig_steps = 0 [static, private] |
vector< double > QMCEigenSearch::adiag_tests [static, private] |
Array1D< double > QMCEigenSearch::orig_params [static, private] |
Array2D< double > QMCEigenSearch::hamiltonian [static, private] |
Array2D< double > QMCEigenSearch::overlap [static, private] |
QMCObjectiveFunction* QMCEigenSearch::OF [private] |
Objective function to optimize.
Definition at line 88 of file QMCEigenSearch.h.
Referenced by getObjectiveFunction(), getParameters(), and QMCEigenSearch().
Step length determining algorithm to use.
Definition at line 93 of file QMCEigenSearch.h.
Referenced by getParameters(), and QMCEigenSearch().
double QMCEigenSearch::epsilon [private] |
Tolerance to converge the solution to.
Definition at line 98 of file QMCEigenSearch.h.
Referenced by QMCEigenSearch().
int QMCEigenSearch::maximumSteps [private] |
Maximum number of steps allowed for the search.
Definition at line 103 of file QMCEigenSearch.h.
Referenced by QMCEigenSearch().