34 using QMCT = QMCTraits;
52 ions.
R[0] = {0.0, 0.0, 0.0};
56 ion_species(pChargeIdx, pIdx) = 1;
63 elec.
R[0] = {0.5, 0.0, 0.0};
68 tspecies(chargeIdx, upIdx) = -1;
69 tspecies(massIdx, upIdx) = 1.0;
83 CHECK(val_ei == Approx(-0.005314032183 + 2 * 0.0506238028));
87 double val_ee = caa_elec.
evaluate(elec);
88 double val_ii = caa_ion.
evaluate(ions);
89 double sum = val_ee + val_ii + val_ei;
90 CHECK(sum == Approx(-2.741363553));
100 lattice.R.diagonal(3.77945227);
109 ions.
R[0] = {0.0, 0.0, 0.0};
110 ions.
R[1] = {1.88972614, 1.88972614, 1.88972614};
114 ion_species(pChargeIdx, pIdx) = 1;
120 elec.
R[0] = {0.5, 0.0, 0.0};
121 elec.
R[1] = {0.0, 0.5, 0.0};
126 tspecies(chargeIdx, upIdx) = -1;
127 tspecies(massIdx, upIdx) = 1.0;
138 CHECK(consts == Approx(0.0267892759 * 4));
142 CHECK(val_ei == Approx(-2.219665062 + 0.0267892759 * 4));
147 double val_ee = caa_elec.
evaluate(elec);
148 double val_ii = caa_ion.
evaluate(ions);
149 double sum = val_ee + val_ii + val_ei;
150 CHECK(sum == Approx(-3.143491064));
162 lattice.R.diagonal(3.77945227);
171 ions.
R[0] = {0.0, 0.0, 0.0};
172 ions.
R[1] = {1.88972614, 1.88972614, 1.88972614};
176 ion_species(pChargeIdx, pIdx) = 1;
188 elec.
R[0] = {0.0, 0.5, 0.0};
189 elec.
R[1] = {0.0, 0.5, 0.0};
194 tspecies(chargeIdx, upIdx) = -1;
195 tspecies(massIdx, upIdx) = 1.0;
203 elec2.
R[0] = {0.0, 0.5, 0.1};
204 elec2.
R[1] = {0.6, 0.05, -0.1};
213 CHECK(consts == Approx(0.0267892759 * 4));
236 std::vector<ListenerVector<Real>> listeners;
243 std::vector<ListenerVector<Real>> ion_listeners;
249 CHECK(cab.
getValue() == Approx(-2.219665062 + 0.0267892759 * 4));
252 Real elec_ion_sum = std::accumulate(local_pots.begin(), local_pots.begin() + local_pots.cols(), 0.0);
253 CHECK(elec_ion_sum == Approx(-1.0562537047));
254 CHECK(elec_ion_sum + std::accumulate(ion_pots.
begin(), ion_pots.
begin() + ion_pots.
cols(), 0.0) ==
255 Approx(-2.219665062 + 0.0267892759 * 4));
256 elec_ion_sum = std::accumulate(local_pots[1], local_pots[1] + local_pots.cols(), 0.0);
257 CHECK(elec_ion_sum == Approx(-0.8611171676));
258 CHECK(elec_ion_sum + std::accumulate(ion_pots[1], ion_pots[1] + ion_pots.
cols(), 0.0) == Approx(-1.7222343352));
a class that defines a supercell in D-dimensional Euclean space.
void setName(const std::string &aname)
Container_t::iterator begin()
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
Calculates the AA Coulomb potential using PBCs.
Return_t myConst
const energy after breakup
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
Calculates the AA Coulomb potential using PBCs.
QTBase::RealType RealType
TEST_CASE("complex_helper", "[type_traits]")
void createResource(ResourceCollection &collection) const
initialize a shared resource and hand it to a collection
void update(bool skipSK=false)
update the internal data
static std::unique_ptr< LRHandlerType > CoulombHandler
Stores the energ optimized LR handler.
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
void turnOnPerParticleSK()
Turn on per particle storage in Structure Factor.
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
Specialized paritlce class for atomistic simulations.
void createResource(ResourceCollection &collection) const override
initialize a shared resource and hand it to a collection
auto getParticularListener(Matrix< T > &local_pots)
Return_t getValue() const noexcept
get a copy of value_
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.
static void mw_update(const RefVectorWithLeader< ParticleSet > &p_list, bool skipSK=false)
batched version of update
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
handles acquire/release resource by the consumer (RefVectorWithLeader type).
void createSK()
create Structure Factor with PBCs
Custom container for set of attributes for a set of species.
void mw_evaluatePerParticle(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< ListenerVector< RealType >> &listeners, const std::vector< ListenerVector< RealType >> &ion_listeners) const override
Evaluate the contribution of this component of multiple walkers per particle reporting to registered ...
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
Return_t evalConsts(const ParticleSet &P, bool report=true)
Evaluates madelung and background contributions to total energy.