32 const std::string& check_sponame,
34 int check_basisset_size)
44 ions_.setName(
"ion0");
47 ions_.R[0] = {0.0, 0.0, 0.0};
48 ions_.R[1] = {0.0, 0.0, 3.0139239693};
50 int LiIdx =
ispecies.addSpecies(
"Li");
56 elec_.
R[0] = {0.5, 0.5, 0.5};
57 elec_.
R[1] = {0.1, 0.1, 1.1};
58 elec_.
R[2] = {-0.5, -0.5, -0.5};
59 elec_.
R[3] = {-0.1, -0.1, 1.5};
65 tspecies(massIdx, upIdx) = 1.0;
66 tspecies(massIdx, downIdx) = 1.0;
76 auto twf_ptr = wf_factory.buildTWF(ein_xml, runtime_options);
78 auto& spo =
dynamic_cast<const LCAOrbitalSet&
>(twf_ptr->getSPOSet(check_sponame));
79 REQUIRE(spo.getOrbitalSetSize() == check_spo_size);
80 REQUIRE(spo.getBasisSetSize() == check_basisset_size);
83 TEST_CASE(
"SPO input spline from xml LiH_msd",
"[wavefunction]")
87 app_log() <<
"-------------------------------------------------------------" << std::endl;
88 app_log() <<
"LiH_msd input style 1 using sposet_collection" << std::endl;
89 app_log() <<
"-------------------------------------------------------------" << std::endl;
90 const char* spo_xml_string1 = R
"(<wavefunction name="psi0" target="e"> 91 <sposet_collection type="MolecularOrbital" name="LCAOBSet" source="ion0" transform="yes" cuspCorrection="no" href="LiH.orbs.h5"> 92 <sposet basisset="LCAOBSet" name="spo-up" size="85"> 93 <occupation mode="ground"/> 94 <coefficient size="85" spindataset="0"/> 96 <sposet basisset="LCAOBSet" name="spo-dn" size="85"> 97 <occupation mode="ground"/> 98 <coefficient size="85" spindataset="0"/> 102 <multideterminant optimize="yes" spo_up="spo-up" spo_dn="spo-dn"> 103 <detlist size="1487" type="DETS" nca="0" ncb="0" nea="2" neb="2" nstates="85" cutoff="1e-20" href="LiH.orbs.h5"/> 110 app_log() <<
"-----------------------------------------------------------------" << std::endl;
111 app_log() <<
"LiH_msd input style 1 using sposet_collection with basisset added" << std::endl;
112 app_log() <<
"-----------------------------------------------------------------" << std::endl;
113 const char* spo_xml_string1_updated =
114 R
"(<wavefunction name=" psi0 " target=" e "> 115 <sposet_collection type = "MolecularOrbital" name = "LCAOBSet" source = "ion0" cuspCorrection = "no" href = 116 "LiH.orbs.h5" > <basisset name = "LCAOBSet" key = "GTO" transform = "yes"> 117 <grid type = "log" ri = "1.e-6" rf = "1.e2" npts = "1001" /></basisset> 118 <sposet basisset = "LCAOBSet" name = "spo-up" size = "85"><occupation mode = "ground" /> 119 <coefficient size = "85" spindataset = "0" /></sposet> 120 <sposet basisset = "LCAOBSet" name = "spo-dn" size = "85"><occupation mode = "ground" /> 121 <coefficient size = "85" spindataset = "0" /></sposet></sposet_collection><determinantset> 122 <multideterminant optimize = "yes" spo_up = "spo-up" spo_dn = "spo-dn"> 123 <detlist size = "1487" type = "DETS" nca = "0" ncb = "0" nea = "2" neb = "2" nstates = "85" cutoff = 124 "1e-20" href = "LiH.orbs.h5" /></multideterminant></determinantset></wavefunction>)"; 127 app_log() <<
"------------------------------------------------------------------------------" << std::endl;
128 app_log() <<
"LiH_msd input style 1 using sposet_collection with basisset added no transform" << std::endl;
129 app_log() <<
"------------------------------------------------------------------------------" << std::endl;
130 const char* spo_xml_string1_updated_no_transform = R
"(<wavefunction name="psi0" target="e"> 131 <sposet_collection type="MolecularOrbital" name="LCAOBSet" source="ion0" cuspCorrection="no" href="LiH.orbs.h5"> 132 <basisset name="LCAOBSet" key="GTO" transform="no"> 133 <grid type="log" ri="1.e-6" rf="1.e2" npts="1001"/> 135 <sposet basisset="LCAOBSet" name="spo-up" size="85"> 136 <occupation mode="ground"/> 137 <coefficient size="85" spindataset="0"/> 139 <sposet basisset="LCAOBSet" name="spo-dn" size="85"> 140 <occupation mode="ground"/> 141 <coefficient size="85" spindataset="0"/> 145 <multideterminant optimize="yes" spo_up="spo-up" spo_dn="spo-dn"> 146 <detlist size="1487" type="DETS" nca="0" ncb="0" nea="2" neb="2" nstates="85" cutoff="1e-20" href="LiH.orbs.h5"/> 153 app_log() <<
"-------------------------------------------------------------" << std::endl;
154 app_log() <<
"LiH_msd input style 2 using sposet_collection" << std::endl;
155 app_log() <<
"-------------------------------------------------------------" << std::endl;
156 const char* spo_xml_string2 = R
"(<wavefunction name="psi0" target="e"> 157 <sposet_collection type="MolecularOrbital" name="LCAOBSet" source="ion0" transform="yes" cuspCorrection="no" href="LiH.orbs.h5"> 158 <sposet basisset="LCAOBSet" name="spo" size="85"> 159 <occupation mode="ground"/> 160 <coefficient size="85" spindataset="0"/> 164 <multideterminant optimize="yes" spo_up="spo" spo_dn="spo"> 165 <detlist size="1487" type="DETS" nca="0" ncb="0" nea="2" neb="2" nstates="85" cutoff="1e-20" href="LiH.orbs.h5"/> 172 app_log() <<
"-------------------------------------------------------------" << std::endl;
173 app_log() <<
"LiH_msd input style 3 sposet inside determinantset" << std::endl;
174 app_log() <<
"-------------------------------------------------------------" << std::endl;
175 const char* spo_xml_string3 = R
"(<wavefunction name="psi0" target="e"> 176 <determinantset type="MolecularOrbital" name="LCAOBSet" source="ion0" transform="yes" cuspCorrection="no" href="LiH.orbs.h5"> 177 <sposet basisset="LCAOBSet" name="spo-up" size="85"> 178 <occupation mode="ground"/> 179 <coefficient size="85" spindataset="0"/> 181 <sposet basisset="LCAOBSet" name="spo-dn" size="85"> 182 <occupation mode="ground"/> \ 183 <coefficient size="85" spindataset="0"/> 185 <multideterminant optimize="yes" spo_up="spo-up" spo_dn="spo-dn"> 186 <detlist size="1487" type="DETS" nca="0" ncb="0" nea="2" neb="2" nstates="85" cutoff="1e-20" href="LiH.orbs.h5"/> 195 const std::string& check_sponame,
197 int check_basisset_size)
207 ions_.setName(
"ion0");
209 ions_.create({1, 1});
210 ions_.R[0] = {0.0, 0.0, 0.0};
211 ions_.R[1] = {0.0, 0.0, 3.0139239693};
213 int LiIdx =
ispecies.addSpecies(
"Li");
214 int HIdx =
ispecies.addSpecies(
"H");
219 elec_.
R[0] = {0.5, 0.5, 0.5};
220 elec_.
R[1] = {0.1, 0.1, 1.1};
221 elec_.
R[2] = {-0.5, -0.5, -0.5};
222 elec_.
R[3] = {-0.1, -0.1, 1.5};
223 elec_.
R[4] = {0.0, -1.0, 2};
231 tspecies(massIdx, upIdx) = 1.0;
232 tspecies(massIdx, downIdx) = 1.0;
233 tspecies(massIdx, positronIdx) = 1.0;
234 tspecies(chargeIdx, upIdx) = -1.0;
235 tspecies(chargeIdx, downIdx) = -1.0;
236 tspecies(chargeIdx, positronIdx) = 1.0;
246 auto twf_ptr = wf_factory.buildTWF(ein_xml, runtime_options);
248 auto& spo =
dynamic_cast<const LCAOrbitalSet&
>(twf_ptr->getSPOSet(check_sponame));
249 REQUIRE(spo.getOrbitalSetSize() == check_spo_size);
250 REQUIRE(spo.getBasisSetSize() == check_basisset_size);
253 TEST_CASE(
"SPO input spline from xml LiH_msd arbitrary species",
"[wavefunction]")
255 app_log() <<
"-------------------------------------------------------------" << std::endl;
256 app_log() <<
"LiH_msd with positron xml input style" << std::endl;
257 app_log() <<
"-------------------------------------------------------------" << std::endl;
258 const char* spo_xml_string1 = R
"(<wavefunction name="psi0" target="e"> 259 <sposet_collection type="MolecularOrbital" name="LCAOBSet" source="ion0" transform="yes" cuspCorrection="no" href="LiH.orbs.h5"> 260 <sposet basisset="LCAOBSet" name="spo-up" size="5"> 261 <occupation mode="ground"/> 262 <coefficient size="5" spindataset="0"/> 264 <sposet basisset="LCAOBSet" name="spo-dn" size="5"> 265 <occupation mode="ground"/> 266 <coefficient size="5" spindataset="0"/> 268 <sposet basisset="LCAOBSet" name="spo-ps" size="5"> 269 <occupation mode="ground"/> 270 <coefficient size="5" spindataset="0"/> 274 <multideterminant optimize="yes" spo_0="spo-up" spo_1="spo-dn" spo_2="spo-ps"> 275 <detlist size="2" type="DETS" nc0="0" nc1="0" nc2="0" ne0="2" ne1="2" ne2="1" nstates="5" cutoff="1e-20"> 276 <ci id="CIcoeff_0" coeff="0.7071" qchem_coeff="0.7071" occ0="11000" occ1="11000" occ2="10000"/> 277 <ci id="CIcoeff_1" coeff="-0.7071" qchem_coeff="-0.7071" occ0="10100" occ1="11000" occ2="00100" /> 285 TEST_CASE(
"SPO input spline from h5 LiH_msd arbitrary species",
"[wavefunction]")
287 app_log() <<
"-------------------------------------------------------------" << std::endl;
288 app_log() <<
"LiH_msd with positron h5 input style" << std::endl;
289 app_log() <<
"-------------------------------------------------------------" << std::endl;
290 const char* spo_xml_string1 = R
"(<wavefunction name="psi0" target="e"> 291 <sposet_collection type="MolecularOrbital" name="LCAOBSet" source="ion0" transform="yes" cuspCorrection="no" href="LiH.orbs.h5"> 292 <sposet basisset="LCAOBSet" name="spo-up" size="5"> 293 <occupation mode="ground"/> 294 <coefficient size="5" spindataset="0"/> 296 <sposet basisset="LCAOBSet" name="spo-dn" size="5"> 297 <occupation mode="ground"/> 298 <coefficient size="5" spindataset="0"/> 300 <sposet basisset="LCAOBSet" name="spo-ps" size="5"> 301 <occupation mode="ground"/> 302 <coefficient size="5" spindataset="0"/> 306 <multideterminant optimize="yes" spo_0="spo-up" spo_1="spo-dn" spo_2="spo-ps"> 307 <detlist size="2" type="DETS" cutoff="1e-20" href="LiH.Multidet.h5"/> void setName(const std::string &aname)
class that handles xmlDoc
void test_LiH_msd_xml_input(const std::string &spo_xml_string, const std::string &check_sponame, int check_spo_size, int check_basisset_size)
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
void test_LiH_msd_xml_input_with_positron(const std::string &spo_xml_string, const std::string &check_sponame, int check_spo_size, int check_basisset_size)
TEST_CASE("complex_helper", "[type_traits]")
void addParticleSet(std::unique_ptr< ParticleSet > &&p)
add a ParticleSet* to the pool with its ownership transferred ParticleSet built outside the ParticleS...
Communicate * Controller
Global Communicator for a process.
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
Wrapping information on parallelism.
Specialized paritlce class for atomistic simulations.
REQUIRE(std::filesystem::exists(filename))
Manage a collection of ParticleSet objects.
Factory class to build a many-body wavefunction.
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void create(const std::vector< int > &agroup)
create grouped particles
bool parseFromString(const std::string_view data)
Declaration of a WaveFunctionFactory.
class to handle linear combinations of basis orbitals used to evaluate the Dirac determinants.
Custom container for set of attributes for a set of species.
const PoolType & getPool() const
get the Pool object
const auto & getSimulationCell() const
get simulation cell
Declaration of ParticleSetPool.