QMCPACK
MPC.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) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
10 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
11 //
12 // File created by: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
13 //////////////////////////////////////////////////////////////////////////////////////
14 
15 
16 #ifndef QMCPLUSPLUS_MPC_H
17 #define QMCPLUSPLUS_MPC_H
18 
21 
22 #if defined(HAVE_EINSPLINE)
23 #include "einspline/bspline.h"
24 #else
25 class UBspline_3d_d;
26 #endif
27 namespace qmcplusplus
28 {
29 /** @ingroup hamiltonian
30  *\brief Calculates the Model Periodic Coulomb potential using PBCs
31  */
32 
33 class MPC : public OperatorBase
34 {
35 protected:
36  std::shared_ptr<UBspline_3d_d> VlongSpline;
37  //std::shared_ptr<UBspline_3d_d> DensitySpline;
38  double Vconst;
39  double Ecut;
40  std::vector<TinyVector<int, OHMMS_DIM>> Gints;
41  std::vector<PosType> Gvecs;
42  std::vector<ComplexType> Rho_G;
43  std::array<size_t, OHMMS_DIM> SplineDim;
44  int MaxDim;
45  // AA table ID
46  const int d_aa_ID;
47 
48  void initBreakup(const ParticleSet& ptcl);
49  void compute_g_G(const ParticleSet& ptcl, double& g_0_N, std::vector<double>& g_G_N, int N);
50  void init_gvecs(const ParticleSet& ptcl);
51  void init_f_G(const ParticleSet& ptcl);
52  void init_spline(const ParticleSet& ptcl);
53  Return_t evalSR(ParticleSet& P) const;
54  Return_t evalLR(ParticleSet& P) const;
55 
56 public:
57  // Store the average electron charge density in reciprocal space
58  std::vector<ComplexType> RhoAvg_G;
59  std::vector<RealType> f_G;
60  // The G=0 component
61  double f_0;
62 
63  bool FirstTime;
70  std::vector<RealType> Zat, Zspec;
71  std::vector<int> NofSpecies;
72 
73  MPC(ParticleSet& ref, double cutoff);
74 
75  /// copy constructor
76  // MPC(const MPC& c);
77 
78  ~MPC() override;
79 
80  std::string getClassName() const override { return "MPC"; }
81  void resetTargetParticleSet(ParticleSet& P) override;
82 
83  Return_t evaluate(ParticleSet& P) override;
84 
85  /** Do nothing */
86  bool put(xmlNodePtr cur) override;
87 
88  bool get(std::ostream& os) const override
89  {
90  //os << "MPC potential: " << PtclRef->getName();
91  return true;
92  }
93 
94  std::unique_ptr<OperatorBase> makeClone(ParticleSet& qp, TrialWaveFunction& psi) override;
95 };
96 
97 } // namespace qmcplusplus
98 #endif
double Ecut
Definition: MPC.h:39
void resetTargetParticleSet(ParticleSet &P) override
Reset the data with the target ParticleSet.
Definition: MPC.cpp:33
std::shared_ptr< UBspline_3d_d > VlongSpline
Definition: MPC.h:36
std::array< size_t, OHMMS_DIM > SplineDim
Definition: MPC.h:43
MPC(ParticleSet &ref, double cutoff)
Definition: MPC.cpp:35
int ChargeAttribIndx
Definition: MPC.h:65
std::vector< ComplexType > Rho_G
Definition: MPC.h:42
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
Definition: MPC.cpp:355
const int d_aa_ID
Definition: MPC.h:46
Declaration of OperatorBase.
std::string getClassName() const override
return class name
Definition: MPC.h:80
Return_t evalLR(ParticleSet &P) const
Definition: MPC.cpp:338
void init_f_G(const ParticleSet &ptcl)
Definition: MPC.cpp:165
double f_0
Definition: MPC.h:61
Calculates the Model Periodic Coulomb potential using PBCs.
Definition: MPC.h:33
int NumSpecies
Definition: MPC.h:64
bool FirstTime
Definition: MPC.h:63
void init_gvecs(const ParticleSet &ptcl)
Definition: MPC.cpp:43
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
RealType myRcut
Definition: MPC.h:69
Return_t evalSR(ParticleSet &P) const
Definition: MPC.cpp:322
int MaxDim
Definition: MPC.h:44
void init_spline(const ParticleSet &ptcl)
Definition: MPC.cpp:221
int NParticles
Definition: MPC.h:67
~MPC() override
copy constructor
std::vector< RealType > f_G
Definition: MPC.h:59
An abstract class for Local Energy operators.
Definition: OperatorBase.h:59
FullPrecRealType Return_t
type of return value of evaluate
Definition: OperatorBase.h:64
Class to represent a many-body trial wave function.
std::vector< RealType > Zspec
Definition: MPC.h:70
RealType myConst
Definition: MPC.h:68
void initBreakup(const ParticleSet &ptcl)
Definition: MPC.cpp:291
std::vector< RealType > Zat
Definition: MPC.h:70
Define a LRHandler with two template parameters.
std::vector< PosType > Gvecs
Definition: MPC.h:41
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) override
Definition: MPC.cpp:316
double Vconst
Definition: MPC.h:38
int MemberAttribIndx
Definition: MPC.h:66
std::vector< ComplexType > RhoAvg_G
Definition: MPC.h:58
std::vector< int > NofSpecies
Definition: MPC.h:71
void compute_g_G(const ParticleSet &ptcl, double &g_0_N, std::vector< double > &g_G_N, int N)
Definition: MPC.cpp:78
BareKineticEnergy::Return_t Return_t
std::vector< TinyVector< int, OHMMS_DIM > > Gints
Definition: MPC.h:40
bool put(xmlNodePtr cur) override
Do nothing.
Definition: MPC.cpp:361