38 nl_ecp.
PPset[0]->rrotsgrid_m = nl_ecp.
PPset[0]->sgridxyz_m;
42 return nl_ecp.
PPset[0]->rrotsgrid_m != nl_ecp.
PPset[0]->sgridxyz_m;
52 nl_ecp.
mw_evaluateImpl(o_list, twf_list, p_list, Tmove, listener_opt, keep_grid);
77 ions.
R[0] = {0.0, 1.0, 0.0};
78 ions.
R[1] = {0.0, -1.0, 0.0};
81 int index_species = ion_species.
addSpecies(
"Na");
83 int index_atomic_number = ion_species.
addAttribute(
"atomic_number");
84 ion_species(index_charge, index_species) = 1;
85 ion_species(index_atomic_number, index_species) = 1;
96 elec.
R[0] = {0.4, 0.0, 0.0};
97 elec.
R[1] = {1.0, 0.0, 0.0};
103 tspecies(chargeIdx, upIdx) = -1;
104 tspecies(massIdx, upIdx) = 1.0;
109 tspecies(chargeIdx, dnIdx) = -1;
110 tspecies(massIdx, dnIdx) = 1.0;
114 const int ei_table_index = elec.
addTable(ions);
128 bool doForces =
false;
129 bool use_DLA =
false;
142 std::vector<ListenerVector<Real>> listeners;
149 std::vector<ListenerVector<Real>> ion_listeners;
169 nl_ecp2.setRandomGenerator(&rng2);
189 auto value = o_list[0].evaluateDeterministic(p_list[0]);
191 CHECK(std::accumulate(local_pots.
begin(), local_pots.
begin() + local_pots.
cols(), 0.0) == Approx(value));
192 CHECK(std::accumulate(local_pots2.
begin(), local_pots2.
begin() + local_pots2.
cols(), 0.0) == Approx(value));
193 CHECK(std::accumulate(ion_pots.
begin(), ion_pots.
begin() + ion_pots.
cols(), 0.0) == Approx(-2.1047365665));
194 CHECK(std::accumulate(ion_pots2.
begin(), ion_pots2.
begin() + ion_pots2.
cols(), 0.0) == Approx(-2.1047365665));
198 elec.
R[0] = {0.5, 0.0, 2.0};
204 auto value2 = o_list[0].evaluateDeterministic(elec);
206 CHECK(std::accumulate(local_pots.
begin(), local_pots.
begin() + local_pots.
cols(), 0.0) == Approx(value2));
208 CHECK(std::accumulate(local_pots2[1], local_pots2[1] + local_pots2.
cols(), 0.0) == Approx(value));
212 auto value3 = o_list[0].evaluateDeterministic(p_list[0]);
213 CHECK(std::accumulate(local_pots.
begin(), local_pots.
begin() + local_pots.
cols(), 0.0) == Approx(value3));
a class that defines a supercell in D-dimensional Euclean space.
void setName(const std::string &aname)
Container_t::iterator begin()
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
class to violate access control because evaluation of NonLocalECPotential uses RNG which we may not b...
TEST_CASE("complex_helper", "[type_traits]")
static void mw_evaluateImpl(NonLocalECPotential &nl_ecp, const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &twf_list, const RefVectorWithLeader< ParticleSet > &p_list, bool Tmove, const std::optional< ListenerOption< Real >> listener_opt, bool keep_grid)
void createResource(ResourceCollection &collection) const
initialize a shared resource and hand it to a collection
void update(bool skipSK=false)
update the internal data
Communicate * Controller
Global Communicator for a process.
static bool didGridChange(NonLocalECPotential &nl_ecp)
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
std::unique_ptr< NonLocalECPComponent > pp_nonloc
Wrapping information on parallelism.
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
static void mw_evaluateImpl(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, bool Tmove, std::optional< ListenerOption< Real >> listeners, bool keepGrid=false)
the actual implementation for batched walkers, used by mw_evaluate, mw_evaluateWithToperator mw_evalu...
REQUIRE(std::filesystem::exists(filename))
Declaration of a builder class for an ECP component for an ionic type.
void addComponent(int groupID, std::unique_ptr< NonLocalECPComponent > &&pp)
std::unique_ptr< T > UPtr
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
bool read_pp_file(const std::string &fname)
std::vector< std::reference_wrapper< T > > RefVector
void setRandomGenerator(RandomBase< FullPrecRealType > *rng) override
set the internal RNG pointer as the given pointer
Evaluate the semi local potentials.
Class to represent a many-body trial wave function.
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
QTFull::RealType FullPrecRealType
Custom container for set of attributes for a set of species.
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) override
std::vector< std::unique_ptr< NonLocalECPComponent > > PPset
unique NonLocalECPComponent to remove
DMCRefEnergy::FullPrecReal FullPrecReal
static void copyGridUnrotatedForTest(NonLocalECPotential &nl_ecp)
Convenience container for common optional element to mw_eval.._impl.