QMCPACK
test_SpinDensityInput.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2024 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Lab
8 //
9 // File created by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Lab
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #include "catch.hpp"
14 
15 #include "SpinDensityInput.h"
16 #include "ValidSpinDensityInput.h"
17 #include "EstimatorTesting.h"
18 #include "ParticleSet.h"
19 #include "OhmmsData/Libxml2Doc.h"
20 
21 #include <stdio.h>
22 #include <sstream>
23 
24 namespace qmcplusplus
25 {
26 TEST_CASE("SpinDensityInput::readXML", "[estimators]")
27 {
28  using POLT = PtclOnLatticeTraits;
31  for (auto input_xml : input::xml)
32  {
34  bool okay = doc.parseFromString(input_xml);
35  REQUIRE(okay);
36  xmlNodePtr node = doc.getRoot();
37 
39 
41  if (sdi.get_cell().explicitly_defined == true)
42  lattice = sdi.get_cell();
43  else
45 
47 
48  CHECK(dev_par.npoints == 1000);
50  CHECK(dev_par.grid == grid);
52  CHECK(dev_par.gdims == gdims);
53  }
54 }
55 
56 } // namespace qmcplusplus
a class that defines a supercell in D-dimensional Euclean space.
Fixed-size array.
Definition: OhmmsTinyMeta.h:30
class that handles xmlDoc
Definition: Libxml2Doc.h:76
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
if(!okay) throw std xmlNodePtr node
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > ParticleLayout
Definition: Configuration.h:79
TEST_CASE("complex_helper", "[type_traits]")
xmlNodePtr getRoot()
Definition: Libxml2Doc.h:88
static constexpr std::array< std::string_view, 3 > xml
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
REQUIRE(std::filesystem::exists(filename))
Native representation for Spin Density Estimators inputs.
Particle traits to use UniformGridLayout for the ParticleLayout.
Definition: Configuration.h:77
bool parseFromString(const std::string_view data)
Definition: Libxml2Doc.cpp:204
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
bool explicitly_defined
true, the lattice is defined by the input instead of an artificial default
SpinDensityInput sdi(node)
DerivedParameters calculateDerivedParameters(const Lattice &lattice) const
Derived parameters of SpinDensity.