44 ions.
R[0] = {0.0, 0.0, 0.0};
47 elec.
R[0] = {0.0, 1.0, 0.0};
48 elec.
R[1] = {1.0, 1.0, 0.0};
52 tspecies(massIdx, upIdx) = 1.0;
57 const char* particles = R
"(<tmp></tmp>)"; 65 xmlNodePtr h1 = xmlFirstElementChild(root);
111 ions.
R[0] = {0.0, 0.0, 0.0};
112 ions.
R[1] = {6.0, 0.0, 0.0};
116 int iatnumber = ion_species.
addAttribute(
"atomic_number");
117 ion_species(pChargeIdx, pIdx) = 1;
118 ion_species(iatnumber, pIdx) = 11;
122 std::vector<int> agroup(2, 1);
124 elec.
R[0] = {2.0, 0.0, 0.0};
125 elec.
R[1] = {3.0, 0.0, 0.0};
131 tspecies(chargeIdx, upIdx) = -1;
132 tspecies(chargeIdx, downIdx) = -1;
133 tspecies(massIdx, upIdx) = 1.0;
134 tspecies(massIdx, downIdx) = 1.0;
149 const char* particles = R
"(<tmp> 150 <jastrow name="J2" type="Two-Body" function="Bspline" print="yes" gpu="no"> 151 <correlation speciesA="u" speciesB="d" rcut="10" size="8"> 152 <coefficients id="ud" type="Array"> 2.015599059 1.548994099 1.17959447 0.8769687661 0.6245736507 0.4133517767 0.2333851935 0.1035636904</coefficients> 163 xmlNodePtr jas2 = xmlFirstElementChild(root);
170 const char* particles2 = R
"(<tmp> 171 <jastrow name="J1" type="One-Body" function="Bspline" source="ion0" print="yes"> 172 <correlation elementType="Na" rcut="10" size="10" cusp="0"> 173 <coefficients id="eNa" type="Array"> 1.244201343 -1.188935609 -1.840397253 -1.803849126 -1.612058635 -1.35993202 -1.083353212 -0.8066295188 -0.5319252448 -0.3158819772</coefficients> 183 xmlNodePtr jas1 = xmlFirstElementChild(root);
188 const char* kexml = R
"(<tmp></tmp>)"; 192 xmlNodePtr h1 = xmlFirstElementChild(root); 206 CHECK(keval == Approx(-0.147507745));
214 CHECK(keval2 == Approx(-0.147507745));
216 CHECK(PulayTerm[0][0] == Approx(-0.13166));
217 CHECK(PulayTerm[0][1] == Approx(0.0));
218 CHECK(PulayTerm[0][2] == Approx(0.0));
219 CHECK(PulayTerm[1][0] == Approx(-0.12145));
220 CHECK(PulayTerm[1][1] == Approx(0.0));
221 CHECK(PulayTerm[1][2] == Approx(0.0));
247 ions.
R[0] = {0.0, 0.0, 0.0};
254 elec.
R[0] = {0.0, 1.0, 0.0};
255 elec.
R[1] = {1.0, 1.0, 0.0};
261 tspecies(chargeIdx, upIdx) = -1;
262 tspecies(chargeIdx, downIdx) = -1;
263 tspecies(massIdx, upIdx) = mass_up;
264 tspecies(massIdx, downIdx) = mass_dn;
300 std::vector<ListenerVector<Real>> listeners;
303 std::vector<ListenerVector<Real>> ion_listeners;
305 tests(o_list, twf_list, p_list, kinetic_energies, listeners, ion_listeners);
311 return [value1, value2,
314 std::vector<ListenerVector<Real>>& listeners, std::vector<ListenerVector<Real>>& ion_listeners) {
315 auto& bare_ke = o_list[0];
316 bare_ke.mw_evaluatePerParticle(o_list, twf_list, p_list, listeners, ion_listeners);
317 CHECK(bare_ke.getValue() == Approx(value1));
318 auto& bare_ke2 = o_list[1];
319 CHECK(bare_ke2.getValue() == Approx(value1));
321 CHECK(std::accumulate(kinetic_energies.begin(), kinetic_energies.begin() + kinetic_energies.cols(), 0.0) ==
322 Approx(bare_ke.getValue()));
324 CHECK(std::accumulate(kinetic_energies[1], kinetic_energies[1] + kinetic_energies.cols(), 0.0) == Approx(value1));
326 auto& elec = p_list[0];
329 auto& elec2 = p_list[1];
333 bare_ke.mw_evaluatePerParticle(o_list, twf_list, p_list, listeners, ion_listeners);
334 CHECK(std::accumulate(kinetic_energies.begin(), kinetic_energies.begin() + kinetic_energies.cols(), 0.0) ==
335 Approx(bare_ke.getValue()));
336 CHECK(std::accumulate(kinetic_energies[1], kinetic_energies[1] + kinetic_energies.cols(), 0.0) == Approx(value2));
346 bare_ke.mw_evaluatePerParticleWithToperator(o_list, twf_list, p_list, listeners, ion_listeners);
347 CHECK(std::accumulate(kinetic_energies[1], kinetic_energies[1] + kinetic_energies.cols(), 0.0) == Approx(value3));
void resize(size_type n, Type_t val=Type_t())
Resize the container.
a class that defines a supercell in D-dimensional Euclean space.
RealType evaluateLog(ParticleSet &P)
evalaute the log (internally gradients and laplacian) of the trial wavefunction.
void setName(const std::string &aname)
class that handles xmlDoc
void pause()
Pause the summary and log streams.
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
size_t getTotalNum() const
TEST_CASE("complex_helper", "[type_traits]")
std::unique_ptr< WaveFunctionComponent > buildComponent(xmlNodePtr cur) override
process a xml node at cur
JastrowBuilder using an analytic 1d functor Should be able to eventually handle all one and two body ...
An object of this type is a listener expecting a callback to the report function with a vector of val...
void createResource(ResourceCollection &collection) const
initialize a shared resource and hand it to a collection
Return_t evaluateWithIonDerivs(ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_terms, ParticleSet::ParticlePos &pulay_terms) override
Function to compute the value, direct ionic gradient terms, and pulay terms for the local kinetic ene...
void update(bool skipSK=false)
update the internal data
Attaches a unit to a Vector for IO.
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 ...
OutputManagerClass outputManager(Verbosity::HIGH)
Wrapping information on parallelism.
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
void resume()
Resume the summary and log streams.
auto getTestCaseForWeights(Real value1, Real value2, Real value3)
just set the values to test the electron weights
Specialized paritlce class for atomistic simulations.
void testElecCase(double mass_up, double mass_dn, std::function< void(RefVectorWithLeader< OperatorBase > &o_list, RefVectorWithLeader< TrialWaveFunction > &twf_list, RefVectorWithLeader< ParticleSet > &p_list, Matrix< Real > &kinetic_energies, std::vector< ListenerVector< Real >> &listeners, std::vector< ListenerVector< Real >> &ion_listeners)> tests)
Provide a test scope parameterized on electron species mass that then can run a set of tests using it...
void createResource(ResourceCollection &collection) const override
initialize a shared resource and hand it to a collection
QTBase::ValueType ValueType
REQUIRE(std::filesystem::exists(filename))
ParticleGradient G
gradients of the particles
auto getParticularListener(Matrix< T > &local_pots)
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void create(const std::vector< int > &agroup)
create grouped particles
Declaration of a TrialWaveFunction.
std::vector< std::reference_wrapper< T > > RefVector
Class to represent a many-body trial wave function.
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
bool parseFromString(const std::string_view data)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
handles acquire/release resource by the consumer (RefVectorWithLeader type).
LatticeGaussianProduct::ValueType ValueType
bool put(xmlNodePtr) override
implements the virtual function.
void createSK()
create Structure Factor with PBCs
Custom container for set of attributes for a set of species.
void addComponent(std::unique_ptr< WaveFunctionComponent > &&aterm)
add a WaveFunctionComponent
Evaluate the kinetic energy with a single mass.