38 so_ecp.
ppset_[0]->rrotsgrid_m_ = so_ecp.
ppset_[0]->sgridxyz_m_;
42 return so_ecp.
ppset_[0]->rrotsgrid_m_ != so_ecp.
ppset_[0]->sgridxyz_m_;
46 for (
size_t iw = 0; iw < o_list.size(); iw++)
49 auto&
pset = p_list[iw];
50 for (
auto& uptr_comp : sopp.ppset_)
51 uptr_comp.get()->initVirtualParticle(
pset);
61 so_ecp.
mw_evaluateImpl(o_list, twf_list, p_list, listener_opt, keep_grid);
67 for (
auto& uptr_comp : so_ecp.
ppset_)
68 uptr_comp.get()->initVirtualParticle(elec);
94 auto ions_uptr = std::make_unique<ParticleSet>(simulation_cell);
95 auto elec_uptr = std::make_unique<ParticleSet>(simulation_cell);
100 ions.R[0] = {0.0, 0.0, 0.0};
102 SpeciesSet& ion_species = ions.getSpeciesSet();
105 int iatnumber = ion_species.
addAttribute(
"atomic_number");
106 ion_species(pChargeIdx, pIdx) = 0;
107 ion_species(iatnumber, pIdx) = 1;
113 elec.
R[0] = {0.138, -0.24, 0.216};
114 elec.
R[1] = {-0.216, 0.24, -0.138};
115 elec.
spins = {0.2, 0.51};
121 tspecies(chargeIdx, upIdx) = -1;
122 tspecies(massIdx, upIdx) = 1.0;
140 std::vector<Pos> kup, kdn;
141 std::vector<Real> k2up, k2dn;
146 kup[0] = Pos(1, 1, 1);
147 kup[1] = Pos(2, 2, 2);
150 kdn[0] = Pos(2, 2, 2);
151 kdn[1] = Pos(1, 1, 1);
153 auto spo_up = std::make_unique<FreeOrbital>(
"free_orb_up", kup);
154 auto spo_dn = std::make_unique<FreeOrbital>(
"free_orb_dn", kdn);
156 auto spinor_set = std::make_unique<SpinorSet>(
"free_orb_spinor");
157 spinor_set->set_spos(std::move(spo_up), std::move(spo_dn));
163 std::vector<std::unique_ptr<DiracDeterminantBase>> dirac_dets;
164 dirac_dets.push_back(std::move(dd));
165 auto sd = std::make_unique<SlaterDet>(elec, std::move(dirac_dets));
171 const char* particles = R
"(<tmp> 172 <jastrow name="J2" type="Two-Body" function="Bspline" print="yes" gpu="no"> 173 <correlation speciesA="u" speciesB="u" rcut="5" size="5"> 174 <coefficients id="uu" type="Array"> 0.02904699284 -0.1004179 -0.1752703883 -0.2232576505 -0.2728029201</coefficients> 183 xmlNodePtr jas2 = xmlFirstElementChild(root);
187 std::unique_ptr<TrialWaveFunction> psi_clone = psi.
makeClone(elec2);
206 so_ecp2.setRandomGenerator(&rng2);
226 std::vector<ListenerVector<Real>> listeners;
232 std::vector<ListenerVector<Real>> ion_listeners;
243 auto value = o_list[0].evaluateDeterministic(p_list[0]);
247 CHECK(value == Approx(-3.530511241));
249 CHECK(std::accumulate(local_pots.
begin(), local_pots.
begin() + local_pots.
cols(), 0.0) == Approx(value));
250 CHECK(std::accumulate(local_pots2.
begin(), local_pots2.
begin() + local_pots2.
cols(), 0.0) == Approx(value));
251 CHECK(std::accumulate(ion_pots.
begin(), ion_pots.
begin() + ion_pots.
cols(), 0.0) == Approx(value));
252 CHECK(std::accumulate(ion_pots2.
begin(), ion_pots2.
begin() + ion_pots2.
cols(), 0.0) == Approx(value));
266 CHECK(value == Approx(-3.530511241));
272 elec.R[0] = {0.05, 0.0, -0.05};
278 auto value2 = o_list[0].evaluateDeterministic(elec);
280 CHECK(std::accumulate(local_pots.
begin(), local_pots.
begin() + local_pots.
cols(), 0.0) == Approx(value2));
282 CHECK(std::accumulate(local_pots2[1], local_pots2[1] + local_pots2.
cols(), 0.0) == Approx(value));
void evaluateImpl(ParticleSet &elec, bool keep_grid=false)
a class that defines a supercell in D-dimensional Euclean space.
static void mw_evaluateImpl(SOECPotential &so_ecp, const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &twf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::optional< ListenerOption< Real >> listener_opt, bool keep_grid)
void setName(const std::string &aname)
std::vector< std::unique_ptr< SOECPComponent > > ppset_
Container_t::iterator begin()
class that handles xmlDoc
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) final
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
ParticleScalar spins
internal spin variables for dynamical spin calculations
void createResource(ResourceCollection &collection) const
initialize a shared resource and hand it to a collection
QTBase::RealType RealType
void doSOECPotentialTest(bool use_VPs)
size_t getTotalNum() const
static void evalFast(SOECPotential &so_ecp, ParticleSet &elec, OperatorBase::Return_t &value)
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 ...
static bool didGridChange(SOECPotential &so_ecp)
void update(bool skipSK=false)
update the internal data
void createResource(ResourceCollection &collection) const override
Initialize a shared resource and hand it to a collection.
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 ...
static void addVPs(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< ParticleSet > &p_list)
std::unique_ptr< TrialWaveFunction > makeClone(ParticleSet &tqp) const
Wrapping information on parallelism.
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
Specialized paritlce class for atomistic simulations.
std::unique_ptr< SOECPComponent > pp_so
QTBase::ValueType ValueType
REQUIRE(std::filesystem::exists(filename))
Declaration of a builder class for an ECP component for an ionic type.
CASTTYPE & getCastedElement(size_t i) const
static void mw_evaluateImpl(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, std::optional< ListenerOption< Real >> listeners, bool keep_grid=false)
std::unique_ptr< T > UPtr
auto getParticularListener(Matrix< T > &local_pots)
OHMMS_INDEXTYPE IndexType
define other types
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
void setRandomGenerator(RandomBase< FullPrecRealType > *rng) override
Set the Random Generator object TODO: add docs.
bool read_pp_file(const std::string &fname)
FullPrecRealType Return_t
type of return value of evaluate
std::vector< std::reference_wrapper< T > > RefVector
Declaration of DiracDeterminantBatched with a S(ingle)P(article)O(rbital)Set.
Class to represent a many-body trial wave function.
bool parseFromString(const std::string_view data)
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 }))
void addComponent(int groupID, std::unique_ptr< SOECPComponent > &&pp)
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.
void setSpinor(bool is_spinor)
DMCRefEnergy::FullPrecReal FullPrecReal
static void copyGridUnrotatedForTest(SOECPotential &so_ecp)
Convenience container for common optional element to mw_eval.._impl.
void addComponent(std::unique_ptr< WaveFunctionComponent > &&aterm)
add a WaveFunctionComponent
static void mw_evaluateLog(const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list)
batched version of evaluateLog.