QMCPACK
MinimalWaveFunctionPool.h
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) 2019 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 //
9 // File created by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef QMCPLUSPLUS_MINIMALWAVEFUNCTIONPOOL_H
13 #define QMCPLUSPLUS_MINIMALWAVEFUNCTIONPOOL_H
14 
15 #include "catch.hpp"
16 #include "Message/Communicate.h"
17 #include "OhmmsData/Libxml2Doc.h"
19 
20 namespace qmcplusplus
21 {
23 {
24  static constexpr const char* const wf_input = R"(
25 <wavefunction target='e'>
26  <sposet_collection type="bspline" source="ion" href="diamondC_1x1x1.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" meshfactor="0.8" twist="0 0 0" precision="double">
27  <sposet name="spo_for_dets" size="4" spindataset="0"/>
28  </sposet_collection>
29  <sposet_collection type="bspline" source="ion" href="diamondC_1x1x1.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" gpu="no" meshfactor="0.8" twist="0 0 0" precision="double">
30  <sposet name="spo_ud" size="4" spindataset="0"/>
31  <sposet name="spo_dm" index_min="4" index_max="8" spindataset="0"/>
32  </sposet_collection>
33  <determinantset>
34  <slaterdeterminant>
35  <determinant sposet='spo_for_dets'/>
36  <determinant sposet='spo_for_dets'/>
37  </slaterdeterminant>
38  </determinantset>
39 </wavefunction>
40  )";
41 
42  static constexpr const char* const wf_input_spinor = R"(
43 <wavefunction name="psi0" target="e">
44  <sposet_collection name="A" type="einspline" href="o2_45deg_spins.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" source="ion0" size="12">
45  <sposet name="spo_ud" size="12"/>
46  <sposet name="spo_dm" size="8" index_min="12" index_max="20"/>
47  </sposet_collection>
48  <determinantset>
49  <slaterdeterminant>
50  <determinant sposet="spo_ud"/>
51  </slaterdeterminant>
52  </determinantset>
53 </wavefunction>
54  )";
55 
56  static constexpr const char* const wf_input_spinor_J12 = R"(
57 <wavefunction name="psi0" target="e">
58  <sposet_collection name="A" type="einspline" href="o2_45deg_spins.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" source="ion0" size="12">
59  <sposet name="spo_ud" size="12"/>
60  <sposet name="spo_dm" size="8" index_min="12" index_max="20"/>
61  </sposet_collection>
62  <determinantset>
63  <slaterdeterminant>
64  <determinant sposet="spo_ud"/>
65  </slaterdeterminant>
66  </determinantset>
67  <jastrow type="One-Body" name="J1" function="bspline" source="ion0" print="yes">
68  <correlation elementType="O" size="9" rcut="2.336894584512495" cusp="0.0">
69  <coefficients id="eO" type="Array">
70 -0.51632 -0.1591167977 -0.172367432 -0.1238310413 -0.09792672786
71 -0.91785 -0.05476753103 -0.03482448615 -0.01864350288
72  </coefficients>
73  </correlation>
74  </jastrow>
75  <jastrow type="Two-Body" name="J2" function="bspline" print="yes">
76  <correlation speciesA="u" speciesB="u" size="9" rcut="2.336894584512495" cusp="-0.5">
77  <coefficients id="uu" type="Array">
78 0.7554 0.5342428628 0.3861610501 0.2724177345 0.186010153 0.1213795099
79 0.04796 0.04068638111 0.01968948012
80  </coefficients>
81  </correlation>
82  </jastrow>
83 </wavefunction>
84  )";
85 
86 public:
87  static WaveFunctionPool make_diamondC_1x1x1(const RuntimeOptions& runtime_options,
90  {
91  WaveFunctionPool wp(runtime_options, particle_pool, comm);
92 
95  REQUIRE(okay);
96 
97  xmlNodePtr root = doc.getRoot();
98 
99  wp.put(root);
100 
101  return wp;
102  }
103 
104  static WaveFunctionPool make_O2_spinor(const RuntimeOptions& runtime_options,
105  Communicate* comm,
107  {
108  WaveFunctionPool wp(runtime_options, particle_pool, comm);
109 
112  REQUIRE(okay);
113 
114  xmlNodePtr root = doc.getRoot();
115 
116  wp.put(root);
117 
118  return wp;
119  }
120 
121  static WaveFunctionPool make_O2_spinor_J12(const RuntimeOptions& runtime_options,
122  Communicate* comm,
124  {
125  WaveFunctionPool wp(runtime_options, particle_pool, comm);
126 
129  REQUIRE(okay);
130 
131  xmlNodePtr root = doc.getRoot();
132 
133  wp.put(root);
134 
135  return wp;
136  }
137 };
138 
139 } // namespace qmcplusplus
140 #endif
class that handles xmlDoc
Definition: Libxml2Doc.h:76
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
static WaveFunctionPool make_diamondC_1x1x1(const RuntimeOptions &runtime_options, Communicate *comm, ParticleSetPool &particle_pool)
xmlNodePtr getRoot()
Definition: Libxml2Doc.h:88
static WaveFunctionPool make_O2_spinor(const RuntimeOptions &runtime_options, Communicate *comm, ParticleSetPool &particle_pool)
Wrapping information on parallelism.
Definition: Communicate.h:68
static constexpr const char *const wf_input
REQUIRE(std::filesystem::exists(filename))
Declaration of WaveFunctionPool.
Manage a collection of ParticleSet objects.
static constexpr const char *const wf_input_spinor_J12
static WaveFunctionPool make_O2_spinor_J12(const RuntimeOptions &runtime_options, Communicate *comm, ParticleSetPool &particle_pool)
bool parseFromString(const std::string_view data)
Definition: Libxml2Doc.cpp:204
static constexpr const char *const wf_input_spinor
Manage a collection of TrialWaveFunction objects.