41 TEST_CASE(
"DMC Particle-by-Particle advanceWalkers ConstantOrbital",
"[drivers][dmc]")
49 ions.
R[0] = {0.0, 0.0, 0.0};
51 std::vector<int> agroup(1);
54 elec.
R[0] = {1.0, 0.0, 0.0};
55 elec.
R[1] = {0.0, 0.0, 1.0};
62 tspecies(chargeIdx, upIdx) = -1;
63 tspecies(massIdx, upIdx) = 1.0;
70 auto orb_uptr = std::make_unique<ConstantOrbital>();
71 auto orb = orb_uptr.get();
74 elec[0]->DataSet.allocate();
79 h.
addOperator(std::make_unique<BareKineticEnergy>(elec, psi),
"Kinetic");
90 dmc.
resetRun(&branch, &EM, &TM, &DM);
103 CHECK(elec.
R[0][0] == Approx(0.6276702589209545));
104 CHECK(elec.
R[0][1] == Approx(0.0));
105 CHECK(elec.
R[0][2] == Approx(-0.3723297410790455));
107 CHECK(elec.
R[1][0] == Approx(0.0));
108 CHECK(elec.
R[1][1] == Approx(-0.3723297410790455));
109 CHECK(elec.
R[1][2] == Approx(1.0));
114 orb->FakeGradRatio = -1.0;
127 TEST_CASE(
"DMC Particle-by-Particle advanceWalkers LinearOrbital",
"[drivers][dmc]")
136 ions.
R[0] = {0.0, 0.0, 0.0};
138 std::vector<int> agroup(1);
141 elec.
R[0] = {1.0, 0.0, 0.0};
142 elec.
R[1] = {0.0, 0.0, 1.0};
149 tspecies(chargeIdx, upIdx) = -1;
150 tspecies(massIdx, upIdx) = 1.0;
159 elec[0]->DataSet.allocate();
164 h.
addOperator(std::make_unique<BareKineticEnergy>(elec, psi),
"Kinetic");
175 dmc.
resetRun(&branch, &EM, &TM, &DM);
188 CHECK(elec.
R[0][0] == Approx(0.695481606677082));
189 CHECK(elec.
R[0][1] == Approx(0.135622695565971));
190 CHECK(elec.
R[0][2] == Approx(-0.168895697756948));
192 CHECK(elec.
R[1][0] == Approx(0.0678113477829853));
193 CHECK(elec.
R[1][1] == Approx(-0.236707045539933));
194 CHECK(elec.
R[1][2] == Approx(1.20343404334896));
int addObservables(ParticleSet &P)
add each term to the PropertyList for averages
void setName(const std::string &aname)
A set of walkers that are to be advanced by Metropolis Monte Carlo.
MCWalkerConfiguration::iterator WalkerIter_t
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
void addOperator(std::unique_ptr< OperatorBase > &&h, const std::string &aname, bool physical=true)
add an operator
TEST_CASE("complex_helper", "[type_traits]")
Collection of Local Energy Operators.
void update(bool skipSK=false)
update the internal data
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
void startBlock(int steps)
prepare to start a block
void resetRun(BranchEngineType *brancher, EstimatorManagerBase *est, TraceManager *traces, const DriftModifierBase *driftmodifer)
reset the QMCUpdateBase parameters
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
Specialized paritlce class for atomistic simulations.
Manages the state of QMC sections and handles population control for DMCs.
REQUIRE(std::filesystem::exists(filename))
void registerData(ParticleSet &P, WFBufferType &buf)
register all the wavefunction components in buffer.
Manager class of scalar estimators.
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void create(const std::vector< int > &agroup)
create grouped particles
Class to manage a set of ScalarEstimators.
Declaration of a TrialWaveFunction.
Class to represent a many-body trial wave function.
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
Declaration of WaveFunctionComponent.
Custom container for set of attributes for a set of species.
IndexType nAccept
counter for number of moves accepted
IndexType nReject
counter for number of moves rejected
void createWalkers(int numWalkers)
create numWalkers Walkers
virtual void advanceWalkers(WalkerIter_t it, WalkerIter_t it_end, bool recompute)
advance walkers executed at each step
iterator end()
return the last iterator, [begin(), end())
Declare a global Random Number Generator.
Declaration of a MCWalkerConfiguration.
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
iterator begin()
return the first iterator