QMCPACK
LinearOrbital.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2017 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef QMCPLUSPLUS_LINEARORBITAL_H
14 #define QMCPLUSPLUS_LINEARORBITAL_H
15 
17 
18 namespace qmcplusplus
19 {
20 // Only for testing - has constant gradient and zero laplacian
21 // phi = coeff[0]*x + coeff[1]*y + coeff[2]*z
22 
23 
25 {
26 public:
28 
30  {
31  coeff[0] = 1.0;
32  coeff[1] = 2.0;
33  coeff[2] = 3.0;
34  }
35 
36  std::string getClassName() const override { return "LinearOrbital"; }
37 
41  {
42  ValueType v = 0.0;
43  for (int i = 0; i < P.R.size(); i++)
44  {
45  for (int d = 0; d < OHMMS_DIM; d++)
46  {
47  v += coeff[d] * P.R[i][d];
48  }
49  G[i] = coeff;
50  }
51  L = 0.0;
53  return log_value_;
54  }
55 
56  void acceptMove(ParticleSet& P, int iat, bool safe_to_delay = false) override {}
57 
58  void restore(int iat) override {}
59 
60  PsiValue ratio(ParticleSet& P, int iat) override { return 1.0; }
61 
62  GradType evalGrad(ParticleSet& P, int iat) override { return GradType(coeff); }
63 
64  PsiValue ratioGrad(ParticleSet& P, int iat, GradType& grad_iat) override { return 1.0; }
65 
66  void registerData(ParticleSet& P, WFBufferType& buf) override {}
67 
68  LogValue updateBuffer(ParticleSet& P, WFBufferType& buf, bool fromscratch = false) override
69  {
70  return evaluateLog(P, P.G, P.L);
71  }
72 
73  void copyFromBuffer(ParticleSet& P, WFBufferType& buf) override {}
74 
76  const opt_variables_type& optvars,
77  Vector<ValueType>& dlogpsi,
78  Vector<ValueType>& dhpsioverpsi) override
79  {}
80 };
81 
82 
83 } // namespace qmcplusplus
84 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QTBase::GradType GradType
Definition: Configuration.h:62
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...
Definition: LinearOrbital.h:75
PsiValue ratio(ParticleSet &P, int iat) override
evaluate the ratio of the new to old WaveFunctionComponent value
Definition: LinearOrbital.h:60
Attaches a unit to a Vector for IO.
std::complex< T > convertValueToLog(const std::complex< T > &logpsi)
evaluate log(psi) as log(|psi|) and phase
ParticleLaplacian L
laplacians of the particles
Definition: ParticleSet.h:85
#define OHMMS_DIM
Definition: config.h:64
TinyVector< ValueType, 3 > coeff
Definition: LinearOrbital.h:27
void acceptMove(ParticleSet &P, int iat, bool safe_to_delay=false) override
a move for iat-th particle is accepted.
Definition: LinearOrbital.h:56
std::complex< QTFull::RealType > LogValue
PsiValue ratioGrad(ParticleSet &P, int iat, GradType &grad_iat) override
evaluate the ratio of the new to old WaveFunctionComponent value and the new gradient ...
Definition: LinearOrbital.h:64
An abstract class for a component of a many-body trial wave function.
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
ParticleGradient G
gradients of the particles
Definition: ParticleSet.h:83
class to handle a set of variables that can be modified during optimizations
Definition: VariableSet.h:49
ParticlePos R
Position.
Definition: ParticleSet.h:79
void copyFromBuffer(ParticleSet &P, WFBufferType &buf) override
For particle-by-particle move.
Definition: LinearOrbital.h:73
LogValue updateBuffer(ParticleSet &P, WFBufferType &buf, bool fromscratch=false) override
For particle-by-particle move.
Definition: LinearOrbital.h:68
LogValue evaluateLog(const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L) override
evaluate the value of the WaveFunctionComponent from scratch
Definition: LinearOrbital.h:38
void restore(int iat) override
If a move for iat-th particle is rejected, restore to the content.
Definition: LinearOrbital.h:58
LatticeGaussianProduct::ValueType ValueType
Declaration of WaveFunctionComponent.
std::string getClassName() const override
return class name
Definition: LinearOrbital.h:36
GradType evalGrad(ParticleSet &P, int iat) override
return the current gradient for the iat-th particle
Definition: LinearOrbital.h:62
void registerData(ParticleSet &P, WFBufferType &buf) override
For particle-by-particle move.
Definition: LinearOrbital.h:66