43 CHECK(u == Approx(2.232142857142857));
59 CHECK(u == Approx(0.11657142857142856));
74 ions_.
R[0] = {0.0, 0.0, 0.0};
77 elec_.
R[0] = {-0.28, 0.0225, -2.709};
78 elec_.
R[1] = {-1.08389, 1.9679, -0.0128914};
84 tspecies(chargeIdx, upIdx) = -1;
85 tspecies(chargeIdx, downIdx) = -1;
86 tspecies(massIdx, upIdx) = 1;
87 tspecies(massIdx, downIdx) = 1;
89 const char* particles = R
"(<tmp> 90 <jastrow name="Jee" type="Two-Body" function="pade"> 91 <correlation speciesA="u" speciesB="u"> 92 <var id="juu_b" name="B">0.1</var> 103 xmlNodePtr jas1 = xmlFirstElementChild(root);
108 std::unique_ptr<WaveFunctionComponent> jas(jastrow.
buildComponent(jas1));
113 double logpsi_real =
std::real(jas->evaluateLog(elec_, elec_.
G, elec_.
L));
114 CHECK(logpsi_real == Approx(-1.862821769493147));
123 auto ions_uptr = std::make_unique<ParticleSet>(simulation_cell);
124 auto elec_uptr = std::make_unique<ParticleSet>(simulation_cell);
128 ions_.setName(
"ion0");
131 ions_.R[0] = {0.0, 0.0, 0.0};
133 int HIdx =
ispecies.addSpecies(
"H");
134 int ichargeIdx =
ispecies.addAttribute(
"charge");
140 elec_.
R[0] = {0.5, 0.5, 0.5};
141 elec_.
R[1] = {-0.5, -0.5, -0.5};
148 tspecies(massIdx, upIdx) = 1.0;
149 tspecies(massIdx, downIdx) = 1.0;
150 tspecies(chargeIdx, upIdx) = -1.0;
151 tspecies(massIdx, downIdx) = -1.0;
160 const char* jasxml = R
"(<wavefunction name="psi0" target="e"> 161 <jastrow name="J1" type="One-Body" function="pade2" print="yes" source="ion0"> 162 <correlation elementType="H"> 163 <var id="J1H_A" name="A">0.8</var> 164 <var id="J1H_B" name="B">5.0</var> 165 <var id="J1H_C" name="C">-0.1</var> 180 auto twf_ptr = wf_factory.buildTWF(jas1, runtime_options);
182 twf.setMassTerm(elec_);
183 twf.evaluateLog(elec_);
184 twf.prepareGroup(elec_, 0);
186 auto& twf_component_list =
twf.getOrbitals();
189 twf.checkInVariables(active);
198 twf_component_list[0]->evaluateDerivatives(elec_, active, dlogpsi, dhpsioverpsi);
201 std::vector<ValueType> expected_dlogpsi = {-0.3249548841, 0.0376658437, -0.2814191847};
202 std::vector<ValueType> expected_dhpsioverpsi = {0.0146266746, 0.0031788682, 0.4554097531};
203 for (
int i = 0; i < nparam; i++)
205 CHECK(dlogpsi[i] == ValueApprox(expected_dlogpsi[i]));
206 CHECK(dhpsioverpsi[i] == ValueApprox(expected_dhpsioverpsi[i]));
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
real_type evaluate(real_type r) const
TEST_CASE("complex_helper", "[type_traits]")
std::unique_ptr< WaveFunctionComponent > buildComponent(xmlNodePtr cur) override
process a xml node at cur
void addParticleSet(std::unique_ptr< ParticleSet > &&p)
add a ParticleSet* to the pool with its ownership transferred ParticleSet built outside the ParticleS...
JastrowBuilder using an analytic 1d functor Should be able to eventually handle all one and two body ...
void update(bool skipSK=false)
update the internal data
Communicate * Controller
Global Communicator for a process.
ParticleLaplacian L
laplacians of the particles
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.
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
Specialized paritlce class for atomistic simulations.
QTBase::ValueType ValueType
REQUIRE(std::filesystem::exists(filename))
Manage a collection of ParticleSet objects.
ParticleGradient G
gradients of the particles
Factory class to build a many-body wavefunction.
class to handle a set of variables that can be modified during optimizations
Functors which implement Pade functions.
int size_of_active() const
return the number of active variables
real_type evaluate(real_type r) const
Implements a Pade Function .
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)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
LatticeGaussianProduct::ValueType ValueType
Declaration of a WaveFunctionFactory.
Declaration of WaveFunctionComponent.
Custom container for set of attributes for a set of species.
const PoolType & getPool() const
get the Pool object
double B(double x, int k, int i, const std::vector< double > &t)
void removeInactive()
remove inactive variables and trim the internal data
void setCusp(real_type cusp) override
empty virtual function to help builder classes
const auto & getSimulationCell() const
get simulation cell
Declaration of ParticleSetPool.
void reset() override
reset the internal variables.