23 std::vector<std::unique_ptr<Determinant_t>> dets,
24 std::unique_ptr<BackflowTransformation> BF)
25 : Dets(
std::move(dets)), BFTrans(
std::move(BF))
36 return BFTrans->isOptimizable() ||
37 std::any_of(
Dets.begin(),
Dets.end(), [](
const auto&
det) {
return det->isOptimizable(); });
43 for (
int i = 0; i <
Dets.size(); i++)
49 for (
int i = 0; i <
Dets.size(); ++i)
59 for (
int i = 0; i <
Dets.size(); ++i)
67 for (
int i = 0; i <
Dets.size(); ++i)
73 BFTrans->updateBuffer(P, buf, fromscratch);
75 for (
int i = 0; i <
Dets.size(); ++i)
82 BFTrans->copyFromBuffer(P, buf);
83 for (
int i = 0; i <
Dets.size(); i++)
89 auto bf =
BFTrans->makeClone(tqp);
90 std::vector<std::unique_ptr<Determinant_t>> dets;
92 dets.push_back(
det->makeCopyWithBF(
det->getPhi()->makeClone(), *bf));
93 auto myclone = std::make_unique<SlaterDetWithBackflow>(tqp, std::move(dets), std::move(bf));
101 app_log() <<
"testing derivatives of G and L \n";
106 obj.checkInVariablesExclusive(wfVars);
108 int Nvars = wfVars.
size();
109 wfvar_prime = wfVars;
110 wfVars.
print(std::cout);
111 std::vector<RealType> dlogpsi;
112 std::vector<RealType> dhpsi;
113 dlogpsi.resize(Nvars);
126 for (
int k = 0; k <
Dets.size(); k++)
130 for (
int i = 0; i < Nvars; i++)
136 app_log() <<
"Nvars: " << Nvars << std::endl;
137 for (
int i = 0; i < Nvars; i++)
139 for (
int j = 0; j < Nvars; j++)
140 wfvar_prime[j] = wfVars[j];
142 obj.checkInVariablesExclusive(wfvar_prime);
143 BFTrans->evaluateDerivatives(P);
150 for (
int k = 0; k <
Dets.size(); k++)
156 for (
int j = 0; j < Nvars; j++)
157 wfvar_prime[j] = wfVars[j];
158 wfvar_prime[i] = wfVars[i] + dh;
160 obj.checkInVariablesExclusive(wfvar_prime);
162 for (
int k = 0; k <
Dets.size(); k++)
165 for (
int j = 0; j < Nvars; j++)
166 wfvar_prime[j] = wfVars[j];
167 wfvar_prime[i] = wfVars[i] - dh;
169 obj.checkInVariablesExclusive(wfvar_prime);
171 for (
int k = 0; k <
Dets.size(); k++)
176 tmp += (L1[q] - L2[q]) / (2.0 * dh);
178 <<
"Ldiff : " << L0[0] <<
" " << tmp <<
" " << L0[0] - tmp << std::endl;
181 app_log() << G0[k] << std::endl
182 << (G1[k] - G2[k]) / (2.0 * dh) << std::endl
183 <<
"Gdiff: " << G0[k] - (G1[k] - G2[k]) / (2.0 * dh) << std::endl
188 obj.checkInVariablesExclusive(wfVars);
202 BFTrans->evaluateDerivatives(P);
203 for (
int i = 0; i <
Dets.size(); i++)
void resize(size_type n, Type_t val=Type_t())
Resize the container.
void evaluateDerivatives(ParticleSet &P, const opt_variables_type &active, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi) override
Compute the derivatives of both the log of the wavefunction and kinetic energy with respect to optimi...
void extractOptimizableObjectRefs(UniqueOptObjRefs &opt_obj_refs) override
extract underlying OptimizableObject references
helper functions for EinsplineSetBuilder
Tensor< T, D >::Type_t det(const Tensor< T, D > &a)
QTBase::RealType RealType
void evaluateDerivatives(ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi) override
Compute the derivatives of both the log of the wavefunction and kinetic energy with respect to optimi...
void checkOutVariables(const opt_variables_type &active) override
check out variational optimizable variables
size_t getTotalNum() const
void copyFromBuffer(ParticleSet &P, WFBufferType &buf) override
For particle-by-particle move.
~SlaterDetWithBackflow() override
destructor
Attaches a unit to a Vector for IO.
QTFull::ValueType SingleParticleValue
std::unique_ptr< WaveFunctionComponent > makeClone(ParticleSet &tqp) const override
make clone
void testDerivFjj(ParticleSet &P, int pa)
void evaluateRatiosAlltoOne(ParticleSet &P, std::vector< ValueType > &ratios) override
evaluate the ratios of one virtual move with respect to all the particles
std::complex< QTFull::RealType > LogValue
int groups() const
return the number of groups
Specialized paritlce class for atomistic simulations.
void testGGG(ParticleSet &P)
const std::unique_ptr< BackflowTransformation > BFTrans
backflow transformation
LogValue updateBuffer(ParticleSet &P, WFBufferType &buf, bool fromscratch=false) override
For particle-by-particle move.
void testDerivGL(ParticleSet &P)
SlaterDetWithBackflow(ParticleSet &targetPtcl, std::vector< std::unique_ptr< Determinant_t >> dets, std::unique_ptr< BackflowTransformation > BF)
constructor
bool isOptimizable() const override
if true, this contains optimizable components
class to handle a set of variables that can be modified during optimizations
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
void registerData(ParticleSet &P, WFBufferType &buf) override
For particle-by-particle move.
size_type size() const
return the size
class to handle determinants with backflow
LogValue log_value_
Current .
void testDerivLi(ParticleSet &P, int pa)
void print(std::ostream &os, int leftPadSpaces=0, bool printHeader=false) const
void push_back(OptimizableObject &obj)
LogValue evaluateLog(const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L) override
evaluate the value of the WaveFunctionComponent from scratch
const std::vector< std::unique_ptr< Determinant_t > > Dets
container for the DiracDeterminants