49 tspecies(massIdx, upIdx) = 1.0;
50 tspecies(massIdx, downIdx) = 1.0;
57 int heIdx =
ispecies.addSpecies(
"He");
71 auto twf_ptr = wf_factory.buildTWF(ein_xml, runtime_options);
73 std::unique_ptr<SPOSet> sposet(twf_ptr->getSPOSet(
"spo").makeClone());
84 elec.makeMove(0, newpos);
86 sposet->evaluateValue(elec, 0, values);
89 CHECK(values[0] == ValueApprox(0.9996037001));
91 sposet->evaluateVGL(elec, 0, values, dpsi, d2psi);
94 CHECK(values[0] == ValueApprox(0.9996037001));
95 CHECK(dpsi[0][0] == ValueApprox(-0.0006678035459));
96 CHECK(dpsi[0][1] == ValueApprox(0.0));
97 CHECK(dpsi[0][2] == ValueApprox(0.0));
98 CHECK(d2psi[0] == ValueApprox(-20.03410564));
102 elec.makeMove(0, disp);
104 sposet->evaluateVGL(elec, 0, values, dpsi, d2psi);
106 CHECK(values[0] == ValueApprox(0.2315567641));
107 CHECK(dpsi[0][0] == ValueApprox(-0.3805431885));
108 CHECK(dpsi[0][1] == ValueApprox(0.0));
109 CHECK(dpsi[0][2] == ValueApprox(0.0));
110 CHECK(d2psi[0] == ValueApprox(-0.2618497452));
113 TEST_CASE(
"SPO input spline from xml He_sto3g",
"[wavefunction]")
117 app_log() <<
"-------------------------------------------------------------" << std::endl;
118 app_log() <<
"He_sto3g input style 1 using sposet_collection" << std::endl;
119 app_log() <<
"-------------------------------------------------------------" << std::endl;
120 const char* spo_xml_string1 = R
"(<wavefunction name="psi0" target="e"> 121 <sposet_collection type="MolecularOrbital" name="LCAOBSet" source="ion0" transform="yes" cuspCorrection="no"> 122 <basisset name="LCAOBSet"> 123 <atomicBasisSet name="Gaussian" angular="cartesian" type="Gaussian" elementType="He" normalized="no"> 124 <grid type="log" ri="1.e-6" rf="1.e2" npts="1001"/> 125 <basisGroup rid="He00" n="0" l="0" type="Gaussian"> 126 <radfunc exponent="6.362421400000e+00" contraction="1.543289672950e-01"/> 127 <radfunc exponent="1.158923000000e+00" contraction="5.353281422820e-01"/> 128 <radfunc exponent="3.136498000000e-01" contraction="4.446345421850e-01"/> 132 <sposet name="spo" size="1"> 133 <occupation mode="ground"/> 134 <coefficient size="1" id="updetC"> 141 <determinant name="det_up" sposet="spo"/> 142 <determinant name="det_dn" sposet="spo"/> 149 app_log() << "-------------------------------------------------------------" << std::endl;
150 app_log() <<
"He_sto3g input style 1 using sposet_collection updated" << std::endl;
151 app_log() <<
"-------------------------------------------------------------" << std::endl;
152 const char* spo_xml_string1_updated = R
"(<wavefunction name="psi0" target="e"> 153 <sposet_collection type="MolecularOrbital" name="LCAOBSet" source="ion0" cuspCorrection="no"> 154 <basisset name="LCAOBSet" transform="yes"> 155 <atomicBasisSet name="Gaussian" angular="cartesian" type="Gaussian" elementType="He" normalized="no"> 156 <grid type="log" ri="1.e-6" rf="1.e2" npts="1001"/> 157 <basisGroup rid="He00" n="0" l="0" type="Gaussian"> 158 <radfunc exponent="6.362421400000e+00" contraction="1.543289672950e-01"/> 159 <radfunc exponent="1.158923000000e+00" contraction="5.353281422820e-01"/> 160 <radfunc exponent="3.136498000000e-01" contraction="4.446345421850e-01"/> 164 <sposet name="spo" basisset="LCAOBSet" size="1"> 165 <occupation mode="ground"/> 166 <coefficient size="1" id="updetC"> 173 <determinant name="det_up" sposet="spo"/> 174 <determinant name="det_dn" sposet="spo"/> 181 app_log() << "-------------------------------------------------------------" << std::endl;
182 app_log() <<
"He_sto3g input style 2 sposet inside determinantset" << std::endl;
183 app_log() <<
"-------------------------------------------------------------" << std::endl;
184 const char* spo_xml_string2 = R
"(<wavefunction name="psi0" target="e"> 185 <determinantset type="MolecularOrbital" name="LCAOBSet" source="ion0" transform="yes" cuspCorrection="no"> 186 <basisset name="LCAOBSet"> 187 <grid type="log" ri="1.e-6" rf="1.e2" npts="1001"/> 188 <atomicBasisSet name="Gaussian" angular="cartesian" type="Gaussian" elementType="He" normalized="no"> 189 <basisGroup rid="He00" n="0" l="0" type="Gaussian"> 190 <radfunc exponent="6.362421400000e+00" contraction="1.543289672950e-01"/> 191 <radfunc exponent="1.158923000000e+00" contraction="5.353281422820e-01"/> 192 <radfunc exponent="3.136498000000e-01" contraction="4.446345421850e-01"/> 196 <sposet name="spo" size="1"> 197 <occupation mode="ground"/> 198 <coefficient size="1" id="updetC"> 202 <sposet name="spo-down" size="1"> 203 <occupation mode="ground"/> 204 <coefficient size="1" id="downdetC"> 209 <determinant name="det_up" sposet="spo"/> 210 <determinant name="det_dn" sposet="spo-down"/> 217 app_log() << "-------------------------------------------------------------" << std::endl;
218 app_log() <<
"He_sto3g input style 3 sposet inside determinantset" << std::endl;
219 app_log() <<
"-------------------------------------------------------------" << std::endl;
220 const char* spo_xml_string3 = R
"(<wavefunction name="psi0" target="e"> 221 <determinantset type="MolecularOrbital" name="LCAOBSet" source="ion0" transform="yes" cuspCorrection="no"> 222 <basisset name="LCAOBSet"> 223 <atomicBasisSet name="Gaussian" angular="cartesian" type="Gaussian" elementType="He" normalized="no"> 224 <grid type="log" ri="1.e-6" rf="1.e2" npts="1001"/> 225 <basisGroup rid="He00" n="0" l="0" type="Gaussian"> 226 <radfunc exponent="6.362421400000e+00" contraction="1.543289672950e-01"/> 227 <radfunc exponent="1.158923000000e+00" contraction="5.353281422820e-01"/> 228 <radfunc exponent="3.136498000000e-01" contraction="4.446345421850e-01"/> 233 <determinant name="spo" size="1"> 234 <occupation mode="ground"/> 235 <coefficient size="1" id="updetC"> 239 <determinant name="spo-down" size="1"> 240 <occupation mode="ground"/> 241 <coefficient size="1" id="downdetC"> void setName(const std::string &aname)
class that handles xmlDoc
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
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...
void test_He_sto3g_xml_input(const std::string &spo_xml_string)
void update(bool skipSK=false)
update the internal data
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.
OrbitalSetTraits< ValueType >::ValueVector ValueVector
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void create(const std::vector< int > &agroup)
create grouped particles
OrbitalSetTraits< ValueType >::GradVector GradVector
bool parseFromString(const std::string_view data)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
Declaration of a WaveFunctionFactory.
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.