28 using Value = WF::Value;
29 using Grad = WF::Grad;
35 ValueVector row0{Value(0.92387953), Value(0.92387953)};
36 ValueVector row1{Value(0.29131988), Value(0.81078057)};
38 GradVector grow0{Grad({-2.22222, -1.11111, 0.33333}), Grad({8.795388, -0.816057, -0.9238793})};
39 GradVector grow1{Grad({2.22222, 1.11111, -0.33333}), Grad({-8.795388, 0.816057, 0.9238793})};
41 ValueVector lrow0{Value(-0.2234545), Value(0.72340234)};
42 ValueVector lrow1{Value(-12.291810), Value(6.879057)};
46 GradMatrix gradspomat;
47 ValueMatrix laplspomat;
49 spomat.
resize(nelec, norb);
50 gradspomat.resize(nelec, norb);
51 laplspomat.resize(nelec, norb);
53 for (
int iorb = 0; iorb < norb; iorb++)
55 spomat(0, iorb) = row0[iorb];
56 spomat(1, iorb) = row1[iorb];
58 gradspomat(0, iorb) = grow0[iorb];
59 gradspomat(1, iorb) = grow1[iorb];
61 laplspomat(0, iorb) = lrow0[iorb];
62 laplspomat(1, iorb) = lrow1[iorb];
77 auto sposet = std::make_unique<ConstantSPOSet>(
"constant_spo", nelec, norb);
78 sposet->setRefVals(spomat);
79 sposet->setRefEGrads(gradspomat);
80 sposet->setRefELapls(laplspomat);
82 sposet->evaluateValue(elec, 0, psiV);
84 CHECK(psiV[0] == row0[0]);
85 CHECK(psiV[1] == row0[1]);
90 sposet->evaluateValue(elec, 1, psiV);
91 CHECK(psiV[0] == row1[0]);
92 CHECK(psiV[1] == row1[1]);
96 sposet->evaluateVGL(elec, 1, psiV, psiG, psiL);
98 for (
int iorb = 0; iorb < norb; iorb++)
100 CHECK(psiV[iorb] == row1[iorb]);
101 CHECK(psiL[iorb] == lrow1[iorb]);
103 for (
int idim = 0; idim <
OHMMS_DIM; idim++)
104 CHECK(psiG[iorb][idim] == grow1[iorb][idim]);
107 ValueMatrix phimat, lphimat;
109 phimat.resize(nelec, norb);
110 gphimat.resize(nelec, norb);
111 lphimat.resize(nelec, norb);
113 const int first_index = 0;
114 const int last_index = 2;
115 sposet->evaluate_notranspose(elec, first_index, last_index, phimat, gphimat, lphimat);
118 CHECKED_ELSE(check.result) { FAIL(check.result_message); }
120 CHECKED_ELSE(check.result) { FAIL(check.result_message); }
123 auto sposet_vgl2 = sposet->makeClone();
128 sposet_vgl2->evaluate_notranspose(elec, first_index, last_index, phimat, gphimat, lphimat);
131 CHECKED_ELSE(check.result) { FAIL(check.result_message); }
133 CHECKED_ELSE(check.result) { FAIL(check.result_message); }
136 std::string myname = sposet_vgl2->getClassName();
137 std::string targetstring(
"ConstantSPOSet");
138 CHECK(myname == targetstring);
helper functions for EinsplineSetBuilder
TEST_CASE("complex_helper", "[type_traits]")
Consistent way to get the set of types used in the QMCWaveFunction module, without resorting to ifdef...
CHECKED_ELSE(check_matrix_result.result)
void resize(size_type n, size_type m)
Resize the container.
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Specialized paritlce class for atomistic simulations.
void create(const std::vector< int > &agroup)
create grouped particles
CheckMatrixResult checkMatrix(M1 &a_mat, M2 &b_mat, const bool check_all=false, std::optional< const double > eps=std::nullopt)
This function checks equality a_mat and b_mat elements M1, M2 need to have their element type declare...
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))