38 int orbital_set_size = 7;
39 info.
resize(num_center, orbital_set_size);
41 bool okay =
readCuspInfo(
"hcn_downdet.cuspInfo.xml",
"downdet", orbital_set_size, info);
45 CHECK(info(0, 0).redo == Approx(0.0));
46 CHECK(info(0, 0).
C == Approx(0.0));
47 CHECK(info(0, 0).sg == Approx(1.0));
48 CHECK(info(0, 0).Rc == Approx(0.0769130700800000));
49 CHECK(info(0, 0).alpha[0] == Approx(2.29508580995773));
50 CHECK(info(0, 0).alpha[1] == Approx(-7.00028778782666));
51 CHECK(info(0, 0).alpha[2] == Approx(0.834942828252775));
52 CHECK(info(0, 0).alpha[3] == Approx(-4.61597420905980));
53 CHECK(info(0, 0).alpha[4] == Approx(31.6558091872316));
57 CHECK(info(0, 6).
C == Approx(0.0));
58 CHECK(info(0, 6).alpha[4] == Approx(0.0));
61 CHECK(info(2, 4).alpha[4] == Approx(-404.733151049101));
75 auto ions_ptr = std::make_unique<ParticleSet>(simulation_cell);
76 auto& ions(*ions_ptr);
79 REQUIRE(particleset_ion.size() == 1);
80 parse_ions.
readXML(particleset_ion[0]);
86 auto elec_ptr = std::make_unique<ParticleSet>(simulation_cell);
87 auto& elec(*elec_ptr);
90 REQUIRE(particleset_elec.size() == 1);
91 parse_elec.
readXML(particleset_elec[0]);
104 xmlNodePtr root2 = doc2.
getRoot();
107 particle_set_map.emplace(elec_ptr->getName(), std::move(elec_ptr));
108 particle_set_map.emplace(ions_ptr->getName(), std::move(ions_ptr));
119 auto sposet = bb.createSPOSet(slater_base[0]);
129 *(eta.C) = *(lcob.
C);
130 *(phi.C) = *(lcob.
C);
134 std::vector<bool> corrCenter(num_center,
"true");
144 CHECK((*phi.C)(0, 0) == Approx(1.00180500));
145 CHECK((*eta.C)(0, 0) == Approx(0.0));
147 int orbital_set_size = 7;
149 info.
resize(num_center, orbital_set_size);
150 okay =
readCuspInfo(
"hcn_downdet.cuspInfo.xml",
"downdet", orbital_set_size, info);
157 for (
int i = 0; i < ngrid; i++)
159 xgrid[i] = 0.012 * (i + 1);
165 computeRadialPhiBar(&elec, &ions, mo_idx, center_idx, &phi, xgrid, rad_orb, info(center_idx, mo_idx));
169 CHECK(rad_orb[0] == Approx(9.1266186340));
170 CHECK(rad_orb[1] == Approx(8.3939106599));
171 CHECK(rad_orb[2] == Approx(7.7213972780));
172 CHECK(rad_orb[3] == Approx(7.1039662640));
173 CHECK(rad_orb[4] == Approx(6.5370601478));
174 CHECK(rad_orb[5] == Approx(6.0165935481));
175 CHECK(rad_orb[6] == Approx(5.5390213984));
176 CHECK(rad_orb[7] == Approx(5.1023814795));
177 CHECK(rad_orb[8] == Approx(4.7033287383));
178 CHECK(rad_orb[9] == Approx(4.3370522377));
182 computeRadialPhiBar(&elec, &ions, mo_idx, center_idx, &phi, xgrid, rad_orb, info(center_idx, mo_idx));
185 CHECK(rad_orb[0] == Approx(-0.0099816961));
186 CHECK(rad_orb[1] == Approx(-0.0092950723));
187 CHECK(rad_orb[2] == Approx(-0.0086498844));
188 CHECK(rad_orb[3] == Approx(-0.0080440071));
189 CHECK(rad_orb[4] == Approx(-0.0074778482));
190 CHECK(rad_orb[5] == Approx(-0.0069529708));
191 CHECK(rad_orb[6] == Approx(-0.0064707256));
192 CHECK(rad_orb[7] == Approx(-0.0060313791));
193 CHECK(rad_orb[8] == Approx(-0.0056312867));
194 CHECK(rad_orb[9] == Approx(-0.0052652668));
199 *(eta.C) = *(lcob.
C);
200 *(phi.C) = *(lcob.
C);
208 CHECK((*phi.C)(0, 0) == Approx(0.0));
209 CHECK((*eta.C)(0, 0) == Approx(1.00180500));
212 computeRadialPhiBar(&elec, &ions, mo_idx, center_idx, &phi, xgrid, rad_orb, info(center_idx, mo_idx));
215 CHECK(rad_orb[0] == Approx(0.0017535517));
216 CHECK(rad_orb[1] == Approx(0.0016496533));
217 CHECK(rad_orb[2] == Approx(0.0015544835));
218 CHECK(rad_orb[3] == Approx(0.0014678130));
219 CHECK(rad_orb[4] == Approx(0.0013891000));
220 CHECK(rad_orb[5] == Approx(0.0013175785));
221 CHECK(rad_orb[6] == Approx(0.0012523246));
222 CHECK(rad_orb[7] == Approx(0.0011923038));
223 CHECK(rad_orb[8] == Approx(0.0011364095));
224 CHECK(rad_orb[9] == Approx(0.0010837868));
229 CHECK((*lcob.
C)(0, 0) == Approx(0.0));
230 CHECK((*lcob.
C)(0, 1) == Approx(0.0));
231 CHECK((*lcob.
C)(0, 2) == Approx(0.0));
232 CHECK((*lcob.
C)(0, 3) != 0.0);
245 auto ions_ptr = std::make_unique<ParticleSet>(simulation_cell);
246 auto& ions(*ions_ptr);
249 REQUIRE(particleset_ion.size() == 1);
250 parse_ions.
readXML(particleset_ion[0]);
256 auto elec_ptr = std::make_unique<ParticleSet>(simulation_cell);
257 auto& elec(*elec_ptr);
260 REQUIRE(particleset_elec.size() == 1);
261 parse_elec.
readXML(particleset_elec[0]);
274 xmlNodePtr root2 = doc2.
getRoot();
277 particle_set_map.emplace(elec_ptr->getName(), std::move(elec_ptr));
278 particle_set_map.emplace(ions_ptr->getName(), std::move(ions_ptr));
291 auto sposet = bb.createSPOSet(slater_base[0]);
303 elec.makeMove(0, newpos);
305 sposet->evaluateValue(elec, 0, values);
308 CHECK(values[0] == Approx(0.00945227));
309 CHECK(values[1] == Approx(0.0200836));
310 CHECK(values[2] == Approx(0.416375));
311 CHECK(values[3] == Approx(-0.0885443));
312 CHECK(values[4] == Approx(0.273159));
313 CHECK(values[5] == Approx(0));
314 CHECK(values[6] == Approx(0));
317 elec.R[0][0] = -1.09;
319 elec.makeMove(0, newpos);
322 sposet->evaluateValue(elec, 0, values);
325 CHECK(values[0] == Approx(9.5150713253));
326 CHECK(values[1] == Approx(-0.0086731542));
327 CHECK(values[2] == Approx(-1.6426151116));
328 CHECK(values[3] == Approx(0.6569242017));
329 CHECK(values[4] == Approx(0.9775522176));
330 CHECK(values[5] == Approx(0.0000000000));
331 CHECK(values[6] == Approx(0.0000000000));
335 sposet->evaluateVGL(elec, 0, values, dpsi, d2psi);
342 CHECK(values[0] == Approx(9.5150713253));
343 CHECK(values[1] == Approx(-0.0086731542));
344 CHECK(values[2] == Approx(-1.6426151116));
345 CHECK(values[3] == Approx(0.6569242017));
346 CHECK(values[4] == Approx(0.9775522176));
347 CHECK(values[5] == Approx(0.0000000000));
348 CHECK(values[6] == Approx(0.0000000000));
350 CHECK(dpsi[0][0] == Approx(-66.5007223213));
351 CHECK(dpsi[0][1] == Approx(0.0000000000));
352 CHECK(dpsi[0][2] == Approx(0.0000000000));
353 CHECK(d2psi[0] == Approx(-21540.9990552510));
355 CHECK(values[1] == Approx(-0.0086731542));
356 CHECK(dpsi[1][0] == Approx(0.0616909346));
357 CHECK(dpsi[1][1] == Approx(0.0000000000));
358 CHECK(dpsi[1][2] == Approx(0.0000000000));
359 CHECK(d2psi[1] == Approx(19.8720529007));
365 all_values.resize(7, 7);
366 all_grad.resize(7, 7);
367 all_lap.resize(7, 7);
370 sposet->evaluate_notranspose(elec, 0, 7, all_values, all_grad, all_lap);
373 CHECK(values[0] == Approx(9.5150713253));
375 CHECK(all_values[0][0] == Approx(9.5150713253));
376 CHECK(all_grad[0][0][0] == Approx(-66.5007223213));
377 CHECK(all_grad[0][0][1] == Approx(0.0000000000));
378 CHECK(all_grad[0][0][2] == Approx(0.0000000000));
379 CHECK(all_lap[0][0] == Approx(-21540.9990552510));
381 CHECK(all_values[0][1] == Approx(-0.0086731542));
382 CHECK(all_grad[0][1][0] == Approx(0.0616909346));
383 CHECK(all_grad[0][1][1] == Approx(0.0000000000));
384 CHECK(all_grad[0][1][2] == Approx(0.0000000000));
385 CHECK(all_lap[0][1] == Approx(19.8720529007));
389 std::unique_ptr<SPOSet> sposet_clone(sposet->makeClone());
391 sposet_clone->evaluate_notranspose(elec, 0, 7, all_values, all_grad, all_lap);
394 CHECK(values[0] == Approx(9.5150713253));
396 CHECK(all_values[0][0] == Approx(9.5150713253));
397 CHECK(all_grad[0][0][0] == Approx(-66.5007223213));
398 CHECK(all_grad[0][0][1] == Approx(0.0000000000));
399 CHECK(all_grad[0][0][2] == Approx(0.0000000000));
400 CHECK(all_lap[0][0] == Approx(-21540.9990552510));
402 CHECK(all_values[0][1] == Approx(-0.0086731542));
403 CHECK(all_grad[0][1][0] == Approx(0.0616909346));
404 CHECK(all_grad[0][1][1] == Approx(0.0000000000));
405 CHECK(all_grad[0][1][2] == Approx(0.0000000000));
406 CHECK(all_lap[0][1] == Approx(19.8720529007));
420 auto ions_ptr = std::make_unique<ParticleSet>(simulation_cell);
421 auto& ions(*ions_ptr);
424 REQUIRE(particleset_ion.size() == 1);
425 parse_ions.
readXML(particleset_ion[0]);
431 auto elec_ptr = std::make_unique<ParticleSet>(simulation_cell);
432 auto& elec(*elec_ptr);
435 REQUIRE(particleset_elec.size() == 1);
436 parse_elec.
readXML(particleset_elec[0]);
449 xmlNodePtr root2 = doc2.
getRoot();
452 particle_set_map.emplace(elec_ptr->getName(), std::move(elec_ptr));
453 particle_set_map.emplace(ions_ptr->getName(), std::move(ions_ptr));
466 auto sposet = bb.createSPOSet(slater_base[0]);
477 elec.R[0][0] = -2.10;
482 elec.makeMove(0, newpos);
484 sposet->evaluateValue(elec, 0, values);
487 CHECK(values[0] == Approx(4.3617329704));
488 CHECK(values[1] == Approx(0.0014119853));
489 CHECK(values[2] == Approx(0.0001156461));
490 CHECK(values[3] == Approx(-0.6722670611));
491 CHECK(values[4] == Approx(0.2762949842));
492 CHECK(values[5] == Approx(0.2198735778));
493 CHECK(values[6] == Approx(0.0659454461));
494 CHECK(values[7] == Approx(0.2952071056));
495 CHECK(values[8] == Approx(0.0322071389));
496 CHECK(values[9] == Approx(0.0877981239));
497 CHECK(values[10] == Approx(-0.2151873873));
498 CHECK(values[11] == Approx(0.4250074750));
499 CHECK(values[12] == Approx(0.0767950823));
501 sposet->evaluateVGL(elec, 0, values, dpsi, d2psi);
503 CHECK(values[0] == Approx(4.3617329704));
504 CHECK(values[1] == Approx(0.0014119853));
505 CHECK(values[2] == Approx(0.0001156461));
506 CHECK(values[3] == Approx(-0.6722670611));
507 CHECK(values[4] == Approx(0.2762949842));
508 CHECK(values[5] == Approx(0.2198735778));
509 CHECK(values[6] == Approx(0.0659454461));
510 CHECK(values[7] == Approx(0.2952071056));
511 CHECK(values[8] == Approx(0.0322071389));
512 CHECK(values[9] == Approx(0.0877981239));
513 CHECK(values[10] == Approx(-0.2151873873));
514 CHECK(values[11] == Approx(0.4250074750));
515 CHECK(values[12] == Approx(0.0767950823));
517 CHECK(dpsi[0][0] == Approx(-27.2844138432));
518 CHECK(dpsi[0][1] == Approx(15.9958208598));
519 CHECK(dpsi[0][2] == Approx(0.0195317131));
520 CHECK(d2psi[0] == Approx(-293.2869628790));
522 CHECK(dpsi[12][0] == Approx(1.7548511775));
523 CHECK(dpsi[12][1] == Approx(2.2759333828));
524 CHECK(dpsi[12][2] == Approx(-1.4878277937));
525 CHECK(d2psi[12] == Approx(-4.3399821309));
531 all_values.resize(10, 13);
532 all_grad.resize(10, 13);
533 all_lap.resize(10, 13);
535 sposet->evaluate_notranspose(elec, 0, 7, all_values, all_grad, all_lap);
537 CHECK(all_values[0][0] == Approx(4.3617329704));
538 CHECK(all_grad[0][0][0] == Approx(-27.2844138432));
539 CHECK(all_grad[0][0][1] == Approx(15.9958208598));
540 CHECK(all_grad[0][0][2] == Approx(0.0195317131));
541 CHECK(all_lap[0][0] == Approx(-293.2869628790));
543 CHECK(all_values[0][11] == Approx(0.4250074750));
544 CHECK(all_grad[0][11][0] == Approx(-0.3947036210));
545 CHECK(all_grad[0][11][1] == Approx(0.9883840215));
546 CHECK(all_grad[0][11][2] == Approx(1.7863218842));
547 CHECK(all_lap[0][11] == Approx(-33.5202249813));
556 if (c->
rank() == root)
572 CHECK(cp.
C == Approx(3.0));
void resize(size_type n, Type_t val=Type_t())
Resize the container.
class that handles xmlDoc
TinyVector< ValueType, 5 > alpha
The coefficients of the polynomial in Eq 8.
One-Dimensional linear-grid.
helper functions for EinsplineSetBuilder
int rank() const
return the rank
QTBase::RealType RealType
Cusp correction parameters.
xmlXPathContextPtr getXPathContext()
RealType sg
The sign of the wavefunction at the nucleus.
RealType Rc
The cutoff radius.
TEST_CASE("complex_helper", "[type_traits]")
std::unique_ptr< basis_type > myBasisSet
pointer to the basis set
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
void resize(size_type n, size_type m)
Resize the container.
Communicate * Controller
Global Communicator for a process.
void broadcastCuspInfo(CuspCorrectionParameters ¶m, Communicate &Comm, int root)
Broadcast cusp correction parameters.
std::map< std::string, const std::unique_ptr< ParticleSet > > PSetMap
class to handle xmlXPathObject
int redo
Flag to indicate the correction should be recalculated.
An abstract base class to implement a One-Dimensional grid.
bool readCuspInfo(const std::string &cuspInfoFile, const std::string &objectName, int OrbitalSetSize, Matrix< CuspCorrectionParameters > &info)
Read cusp correction parameters from XML file.
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
Wrapping information on parallelism.
Decalaration of One-Dimesional grids.
void removeSTypeOrbitals(const std::vector< bool > &corrCenter, LCAOrbitalSet &Phi)
Remove S atomic orbitals from all molecular orbitals on all centers.
REQUIRE(std::filesystem::exists(filename))
OrbitalSetTraits< ValueType >::ValueVector ValueVector
std::shared_ptr< OffloadValueMatrix > C
pointer to matrix containing the coefficients
int getOrbitalSetSize() const
return the size of the orbitals
bool readXML(xmlNodePtr cur)
process xmlnode <particleset/> which contains everything about the particle set to initialize ...
void computeRadialPhiBar(ParticleSet *targetP, ParticleSet *sourceP, int curOrb_, int curCenter_, SPOSet *Phi, Vector< QMCTraits::RealType > &xgrid, Vector< QMCTraits::RealType > &rad_orb, const CuspCorrectionParameters &data)
Compute the radial part of the corrected wavefunction.
OrbitalSetTraits< ValueType >::GradVector GradVector
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
bool parse(const std::string &fname)
class to handle linear combinations of basis orbitals used to evaluate the Dirac determinants.
std::unique_ptr< SPOSetBuilder > createSPOSetBuilder(xmlNodePtr rootNode)
RealType C
A shift to keep correction to a single sign.
bool isOMPoffload() const override
Query if this SPOSet uses OpenMP offload.
xmlChar * castCharToXMLChar(char *c)
unsafe char* to xmlChar* cast
void splitPhiEta(int center, const std::vector< bool > &corrCenter, LCAOrbitalSet &Phi, LCAOrbitalSet &Eta)
Divide molecular orbital into atomic S-orbitals on this center (phi), and everything else (eta)...