43 std::cout << std::fixed;
44 std::cout << std::setprecision(8);
58 const char*
lat_xml = R
"(<simulationcell> 59 <parameter name="lattice" units="bohr"> 64 <parameter name="bconds"> 67 <parameter name="LR_dim_cutoff" > 6 </parameter> 68 <parameter name="rs" > 1.0 </parameter> 69 <parameter name="nparticles" > 8 </parameter> 73 const char* elec_pset_xml = R
"(<particleset name="e" random="yes"> 74 <group name="u" size="4"> 75 <parameter name="charge" > -1 </parameter> 76 <parameter name="mass" > 1.0 </parameter> 78 <group name="d" size="4"> 79 <parameter name="charge" > -1 </parameter> 80 <parameter name="mass" > 1.0 </parameter> 85 const char* ion_pset_xml = R
"(<particleset name="i" size="4"> 87 <parameter name="charge" > 2 </parameter> 88 <parameter name="valence" > 2 </parameter> 89 <parameter name="atomicnumber"> 2 </parameter> 91 <attrib name="position" datatype="posArray" 98 <attrib name="ionid" datatype="stringArray"> 104 const char* skall_xml = R
"(<estimator 105 name="Skall" type="skall" 106 source="i" target="e" hdf5="yes" 114 std::cout <<
"\n\n\ntest_SkAllEstimator: START\n";
125 xmlNodePtr elec_pset_xml_root =
doc.
getRoot();
126 pset_builder.
put(elec_pset_xml_root);
163 elec->
get(std::cout);
170 pset_builder.
put(ion_pset_xml_root);
182 const int ee_table_id = elec->
addTable(*elec);
194 skall.
put(skall_xml_root);
213 std::cout <<
"SkAll results:\n";
214 std::cout << std::fixed;
215 std::cout << std::setprecision(6);
216 std::cout << std::setw(4) <<
"i" 217 <<
" " << std::setw(8) <<
"kx" 218 <<
" " << std::setw(8) <<
"ky" 219 <<
" " << std::setw(8) <<
"kz" 220 <<
" " << std::setw(8) <<
"rhok_r" 221 <<
" " << std::setw(8) <<
"rhok_i" 222 <<
" " << std::setw(8) <<
"c.c." 224 std::cout <<
"================================================================\n";
228 std::cout << std::fixed;
229 std::cout << std::setprecision(5);
230 for (
int k = 0; k < nkpts; k++)
237 RealType rk_i = rhok[2 * nkpts + k];
239 std::cout << std::setw(4) << k <<
" " << std::setw(8) << kx <<
" " << std::setw(8) << ky <<
" " << std::setw(8)
240 << kz <<
" " << std::setw(8) << rk_r <<
" " << std::setw(8) << rk_i <<
" " << std::setw(8) << rk_cc
276 REQUIRE(std::fabs(rhok[26] - 2.52341) < eps);
277 REQUIRE(std::fabs(rhok[52] + 3.71748) < eps);
278 REQUIRE(std::fabs(rhok[26 + 1] - 2.52341) < eps);
279 REQUIRE(std::fabs(rhok[52 + 1] + 3.71748) < eps);
280 REQUIRE(std::fabs(rhok[26 + 2] - 2.52341) < eps);
281 REQUIRE(std::fabs(rhok[52 + 2] + 3.71748) < eps);
283 REQUIRE(std::fabs(rhok[26 + 3] - 2.52341) < eps);
284 REQUIRE(std::fabs(rhok[52 + 3] - 3.71748) < eps);
285 REQUIRE(std::fabs(rhok[26 + 4] - 2.52341) < eps);
286 REQUIRE(std::fabs(rhok[52 + 4] - 3.71748) < eps);
287 REQUIRE(std::fabs(rhok[26 + 5] - 2.52341) < eps);
288 REQUIRE(std::fabs(rhok[52 + 5] - 3.71748) < eps);
290 REQUIRE(std::fabs(rhok[26 + 6] + 0.93151) < eps);
291 REQUIRE(std::fabs(rhok[52 + 6] + 2.34518) < eps);
292 REQUIRE(std::fabs(rhok[26 + 7] + 0.93151) < eps);
293 REQUIRE(std::fabs(rhok[52 + 7] + 2.34518) < eps);
294 REQUIRE(std::fabs(rhok[26 + 8] - 2.52341) < eps);
295 REQUIRE(std::fabs(rhok[52 + 8] - 0.00000) < eps);
297 REQUIRE(std::fabs(rhok[26 + 9] - 2.52341) < eps);
298 REQUIRE(std::fabs(rhok[52 + 9] - 0.00000) < eps);
299 REQUIRE(std::fabs(rhok[26 + 10] + 0.93151) < eps);
300 REQUIRE(std::fabs(rhok[52 + 10] + 2.34518) < eps);
301 REQUIRE(std::fabs(rhok[26 + 11] - 2.52341) < eps);
302 REQUIRE(std::fabs(rhok[52 + 11] - 0.00000) < eps);
304 REQUIRE(std::fabs(rhok[26 + 12] - 2.52341) < eps);
305 REQUIRE(std::fabs(rhok[52 + 12] - 0.00000) < eps);
306 REQUIRE(std::fabs(rhok[26 + 13] + 0.93151) < eps);
307 REQUIRE(std::fabs(rhok[52 + 13] - 2.34518) < eps);
308 REQUIRE(std::fabs(rhok[26 + 14] - 2.52341) < eps);
309 REQUIRE(std::fabs(rhok[52 + 14] - 0.00000) < eps);
311 REQUIRE(std::fabs(rhok[26 + 15] - 2.52341) < eps);
312 REQUIRE(std::fabs(rhok[52 + 15] - 0.00000) < eps);
313 REQUIRE(std::fabs(rhok[26 + 16] + 0.93151) < eps);
314 REQUIRE(std::fabs(rhok[52 + 16] - 2.34518) < eps);
315 REQUIRE(std::fabs(rhok[26 + 17] + 0.93151) < eps);
316 REQUIRE(std::fabs(rhok[52 + 17] - 2.34518) < eps);
318 REQUIRE(std::fabs(rhok[26 + 18] + 1.38359) < eps);
319 REQUIRE(std::fabs(rhok[52 + 18] + 0.30687) < eps);
320 REQUIRE(std::fabs(rhok[26 + 19] - 0.79595) < eps);
321 REQUIRE(std::fabs(rhok[52 + 19] + 1.17259) < eps);
322 REQUIRE(std::fabs(rhok[26 + 20] - 0.79595) < eps);
323 REQUIRE(std::fabs(rhok[52 + 20] + 1.17259) < eps);
325 REQUIRE(std::fabs(rhok[26 + 21] - 0.79595) < eps);
326 REQUIRE(std::fabs(rhok[52 + 21] - 1.17259) < eps);
327 REQUIRE(std::fabs(rhok[26 + 22] - 0.79595) < eps);
328 REQUIRE(std::fabs(rhok[52 + 22] + 1.17259) < eps);
329 REQUIRE(std::fabs(rhok[26 + 23] - 0.79595) < eps);
330 REQUIRE(std::fabs(rhok[52 + 23] - 1.17259) < eps);
332 REQUIRE(std::fabs(rhok[26 + 24] - 0.79595) < eps);
333 REQUIRE(std::fabs(rhok[52 + 24] - 1.17259) < eps);
334 REQUIRE(std::fabs(rhok[26 + 25] + 1.38359) < eps);
335 REQUIRE(std::fabs(rhok[52 + 25] - 0.30687) < eps);
337 std::cout <<
"test_SkAllEstimator:: STOP\n";
Walker< QMCTraits, PtclOnLatticeTraits > Walker_t
walker type
class that handles xmlDoc
const std::string & getName() const
return the name
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
bool put(xmlNodePtr cur)
process an xml element
TEST_CASE("complex_helper", "[type_traits]")
void update(bool skipSK=false)
update the internal data
Communicate * Controller
Global Communicator for a process.
bool put(xmlNodePtr cur) override
Read the input parameter.
Declaration of CrystalLattice<T,D>
PropertySetType PropertyList
name-value map of Walker Properties
Wrapping information on parallelism.
const auto & getSimulationCell() const
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
Specialized paritlce class for atomistic simulations.
void addObservables(PropertySetType &plist)
REQUIRE(std::filesystem::exists(filename))
ParticleSet * getParticleSet(const std::string &pname)
get a named ParticleSet
Manage a collection of ParticleSet objects.
virtual void setHistories(Walker_t &ThisWalker)
bool get(std::ostream &os) const override
write about the class
auto & getDistTable(int table_ID) const
get a distance table by table_ID
Buffer_t Collectables
observables in addition to those registered in Properties/PropertyList
bool readSimulationCellXML(xmlNodePtr cur)
initialize the supercell shared by all the particle sets
bool parseFromString(const std::string_view data)
SkAllEstimator evaluate the structure factor of the target particleset.
bool get(std::ostream &os) const override
dummy. For satisfying OhmmsElementBase.
A container class to represent a walker.
Declaration of ParticleSetPool.