22 TEST_CASE(
"ShortRangeCuspJastrowFunctor",
"[wavefunction]")
29 const std::string xmltext(
"<tmp> " 30 " <correlation rcut=\"6\" cusp=\"3\" elementType=\"Li\"> " 31 " <var id=\"LiCuspR0\" name=\"R0\" optimize=\"yes\"> 0.0624 </var>" 32 " <coefficients id=\"LiCuspB\" type=\"Array\" optimize=\"yes\"> " 41 REQUIRE(xml_parsed_okay ==
true);
48 xmlNodePtr child = root->xmlChildrenNode;
51 if (xmlIsBlankNode(child))
63 CHECK(f.
B.at(0) == Approx(0.3));
64 CHECK(f.
B.at(1) == Approx(0.2));
65 CHECK(f.
B.at(2) == Approx(0.4));
87 CHECK(val == Approx(-0.1970331287).epsilon(eps));
88 CHECK(val_2 == Approx(-0.1970331287).epsilon(eps));
89 CHECK(val == Approx(val_2));
100 RealType approx_dudr = (val_ph - val_mh) / (2 * h);
101 RealType approx_d2udr2 = (dudr_ph - dudr_mh) / (2 * h);
102 CHECK(dudr == Approx(approx_dudr).epsilon(eps));
103 CHECK(d2udr2 == Approx(approx_d2udr2).epsilon(eps));
117 const int nparam = 4;
121 std::vector<TinyVector<RealType, 3>> param_derivs(nparam);
130 for (
int i = 0; i < nparam; i++)
132 const std::string var_name = var_param.
name(i);
138 var_param[var_name] = old_param + h;
144 var_param[var_name] = old_param - h;
148 const RealType val_dp = (val_h - val_m) / (2.0 * h);
149 CHECK(val_dp == Approx(param_derivs[i][0]).epsilon(eps));
151 const RealType dudr_dp = (dudr_h - dudr_m) / (2.0 * h);
152 CHECK(dudr_dp == Approx(param_derivs[i][1]).epsilon(eps));
154 const RealType d2udr2_dp = (d2udr2_h - d2udr2_m) / (2.0 * h);
155 CHECK(d2udr2_dp == Approx(param_derivs[i][2]).epsilon(eps));
157 var_param[var_name] = old_param;
class that handles xmlDoc
bool evaluateDerivatives(real_type r, std::vector< TinyVector< real_type, 3 >> &derivs) override
compute derivatives of U(r), dU/dr, and d^2U/dr^2 with respect to the variational parameters ...
helper functions for EinsplineSetBuilder
bool Opt_R0
true, if R0 is optimizable
TEST_CASE("complex_helper", "[type_traits]")
Functor designed to encode short-ranged structure near a nuclear cusp.
void resetIndex()
reset Index
Communicate * Controller
Global Communicator for a process.
Wrapping information on parallelism.
real_type A
variable that controls the cusp
bool put(xmlNodePtr cur) override
read in information about the functor from an xml node
REQUIRE(std::filesystem::exists(filename))
class to handle a set of variables that can be modified during optimizations
int size_of_active() const
return the number of active variables
bool Opt_A
true, if A is optimizable
real_type evaluate(real_type r) const
compute U(r) at a particular value of r
void resetParametersExclusive(const opt_variables_type &active) override
reset the parameters during optimizations.
real_type cutoff_radius
maximum cutoff
bool Opt_B
true, if B variables are optimizable
void checkInVariablesExclusive(opt_variables_type &active) override
check in variational parameters to the global list of parameters used by the optimizer.
std::string ID_R0
id of R0
bool parseFromString(const std::string_view data)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
const std::string & name(int i) const
return the name of i-th variable
std::vector< real_type > B
variables that add detail through an expansion in sigmoidal functions
optimize::VariableSet::real_type real_type
typedef for real values
real_type R0
the soft cutoff distance that controls how short ranged the functor is