52 ions.
R[0] = {0.0, 0.0, 0.0};
55 std::vector<int> agroup(1, 2);
57 elec.
R[0] = {1.0, 0.0, 0.0};
58 elec.
R[1] = {0.0, 0.0, 1.0};
65 tspecies(chargeIdx, upIdx) = -1;
66 tspecies(massIdx, upIdx) = 1.0;
75 psi.registerData(elec, elec[0]->DataSet);
76 elec[0]->DataSet.allocate();
80 for (std::unique_ptr<RNG>& rng : rngs)
81 rng = std::make_unique<FakeRandom<QMCTraits::FullPrecRealType>>();
84 h.
addOperator(std::make_unique<BareKineticEnergy>(elec, psi),
"Kinetic");
85 h.addObservables(elec);
89 VMC vmc_omp(project_data, elec, psi, h, rngs, c,
false);
91 const char* vmc_input = R
"(<qmc method="vmc" move="pbyp" checkpoint="-1"> 92 <parameter name="substeps">1</parameter> 93 <parameter name="steps">1</parameter> 94 <parameter name="blocks">1</parameter> 95 <parameter name="timestep">0.1</parameter> 96 <parameter name="usedrift">no</parameter> 110 CHECK(ar == Approx(1.0));
116 CHECK(elec[0]->R[0][0] == Approx(0.627670258894097));
117 CHECK(elec.
R[0][1] == Approx(0.0));
118 CHECK(elec.
R[0][2] == Approx(-0.372329741105903));
120 CHECK(elec.
R[1][0] == Approx(0.0));
121 CHECK(elec.
R[1][1] == Approx(-0.372329741105903));
122 CHECK(elec.
R[1][2] == Approx(1.0));
136 ions.
R[0] = {0.0, 0.0, 0.0};
139 std::vector<int> agroup(1, 1);
141 elec.
R[0] = {1.0, 0.0, 0.0};
150 tspecies(chargeIdx, upIdx) = -1;
151 tspecies(massIdx, upIdx) = 1.0;
160 psi.registerData(elec, elec[0]->DataSet);
161 elec[0]->DataSet.allocate();
165 for (std::unique_ptr<RNG>& rng : rngs)
166 rng = std::make_unique<FakeRandom<QMCTraits::FullPrecRealType>>();
169 h.
addOperator(std::make_unique<BareKineticEnergy>(elec, psi),
"Kinetic");
170 h.addObservables(elec);
174 VMC vmc_omp(project_data, elec, psi, h, rngs, c,
false);
176 const char* vmc_input = R
"(<qmc method="vmc" move="pbyp" checkpoint="-1"> 177 <parameter name="substeps">1</parameter> 178 <parameter name="steps">1</parameter> 179 <parameter name="blocks">1</parameter> 180 <parameter name="timestep">0.1</parameter> 181 <parameter name="usedrift">no</parameter> 182 <parameter name="SpinMass">0.25</parameter> 196 CHECK(ar == Approx(1.0));
202 CHECK(elec.
R[0][0] == Approx(0.627670258894097));
203 CHECK(elec.
R[0][1] == Approx(0.0));
204 CHECK(elec.
R[0][2] == Approx(-0.372329741105903));
206 CHECK(elec.
spins[0] == Approx(-0.74465948215809097));
209 CHECK(elec[0]->R[0][0] == Approx(elec.
R[0][0]));
210 CHECK(elec[0]->R[0][1] == Approx(elec.
R[0][1]));
211 CHECK(elec[0]->R[0][2] == Approx(elec.
R[0][2]));
212 CHECK(elec[0]->spins[0] == Approx(elec.
spins[0]));
226 ions.
R[0] = {0.0, 0.0, 0.0};
229 std::vector<int> agroup(1, 1);
231 elec.
R[0] = {1.0, 0.0, 0.0};
240 tspecies(chargeIdx, upIdx) = -1;
241 tspecies(massIdx, upIdx) = 1.0;
250 psi.registerData(elec, elec[0]->DataSet);
251 elec[0]->DataSet.allocate();
255 for (std::unique_ptr<RNG>& rng : rngs)
256 rng = std::make_unique<FakeRandom<QMCTraits::FullPrecRealType>>();
259 h.
addOperator(std::make_unique<BareKineticEnergy>(elec, psi),
"Kinetic");
260 h.addObservables(elec);
264 VMC vmc_omp(project_data, elec, psi, h, rngs, c,
false);
266 const char* vmc_input = R
"(<qmc method="vmc" move="alle" checkpoint="-1"> 267 <parameter name="substeps">1</parameter> 268 <parameter name="steps">1</parameter> 269 <parameter name="blocks">1</parameter> 270 <parameter name="timestep">0.1</parameter> 271 <parameter name="usedrift">no</parameter> 272 <parameter name="SpinMass">0.25</parameter> 287 CHECK(ar == Approx(1.0));
293 CHECK(elec.
R[0][0] == Approx(0.627670258894097));
294 CHECK(elec.
R[0][1] == Approx(0.0));
295 CHECK(elec.
R[0][2] == Approx(-0.372329741105903));
297 CHECK(elec.
spins[0] == Approx(-0.74465948215809097));
300 CHECK(elec[0]->R[0][0] == Approx(elec.
R[0][0]));
301 CHECK(elec[0]->R[0][1] == Approx(elec.
R[0][1]));
302 CHECK(elec[0]->R[0][2] == Approx(elec.
R[0][2]));
303 CHECK(elec[0]->spins[0] == Approx(elec.
spins[0]));
void setName(const std::string &aname)
class that handles xmlDoc
A set of walkers that are to be advanced by Metropolis Monte Carlo.
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 addOperator(std::unique_ptr< OperatorBase > &&h, const std::string &aname, bool physical=true)
add an operator
static void clearClones()
TEST_CASE("complex_helper", "[type_traits]")
Implements a VMC using particle-by-particle move.
Collection of Local Energy Operators.
std::vector< std::unique_ptr< T > > UPtrVector
void update(bool skipSK=false)
update the internal data
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 ...
const RuntimeOptions & getRuntimeOptions() const noexcept
Wrapping information on parallelism.
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
Specialized paritlce class for atomistic simulations.
omp_int_t omp_get_max_threads()
REQUIRE(std::filesystem::exists(filename))
Declaration of WaveFunctionPool.
Manager class of scalar estimators.
void setName(const std::string &aname)
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void create(const std::vector< int > &agroup)
create grouped particles
Declaration of a TrialWaveFunction.
Declaration of HamiltonianPool.
Class to represent a many-body trial wave function.
bool parseFromString(const std::string_view data)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
RealType acceptRatio() const
Declaration of WaveFunctionComponent.
Custom container for set of attributes for a set of species.
void setSpinor(bool is_spinor)
void createWalkers(int numWalkers)
create numWalkers Walkers
Declare a global Random Number Generator.
Declaration of a MCWalkerConfiguration.
void process(xmlNodePtr cur) override
initialize with xmlNode
void addComponent(std::unique_ptr< WaveFunctionComponent > &&aterm)
add a WaveFunctionComponent
Declaration of ParticleSetPool.
void resetWalkerProperty(int ncopy=1)
reset the Property container of all the walkers