QMCPACK
LRHandlerSRCoulomb.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) 2020 QMCPACK developers.
6 //
7 // File developed by: Raymond Clay III, j.k.rofling@gmail.com, Lawrence Livermore National Laboratory
8 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
9 //
10 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
11 //////////////////////////////////////////////////////////////////////////////////////
12 
13 
14 /** @file LRHandlerSRCoulomb.h
15  * @brief Define a LRHandler with two template parameters
16  */
17 #ifndef QMCPLUSPLUS_LRHANLDERSRCOULOMBTEMP_H
18 #define QMCPLUSPLUS_LRHANLDERSRCOULOMBTEMP_H
19 
22 #include "LongRange/LRBreakup.h"
23 #include "OhmmsPETE/OhmmsMatrix.h"
28 
29 #include <sstream>
30 #include <string>
31 
32 namespace qmcplusplus
33 {
34 /* Templated LRHandler class
35  *
36  * LRHandlerSRCoulomb<Func,BreakupBasis> is a modification of LRHandler
37  * and a derived class from LRHanlderBase. Implements the LR breakup http://dx.doi.org/10.1006/jcph.1995.1054 .
38  * The first template parameter Func is a generic functor, e.g., CoulombFunctor.
39  * The second template parameter is a BreakupBasis and the default is set to LPQHIBasis.
40  * LRHandlerBase is introduced to enable run-time options. See RPAContstraints.h
41  */
42 template<class Func, class BreakupBasis = LPQHISRCoulombBasis>
44 {
45 public:
46  //Typedef for the lattice-type.
48  using BreakupBasisType = BreakupBasis;
50 
51  bool FirstTime;
53  BreakupBasisType Basis; //This needs a Lattice for the constructor...
54  Func myFunc;
55 
56  std::vector<mRealType> Fk_copy;
57 
58 
59  //Constructor
61  : LRHandlerBase(kc_in), FirstTime(true), Basis(ref.getLRBox())
62 
63  {
64  LRHandlerBase::ClassName = "LRHandlerSRCoulomb";
65  myFunc.reset(ref);
66  }
67 
68  ~LRHandlerSRCoulomb() override {}
69 
70  /** "copy" constructor
71  * @param aLR LRHandlerSRCoulomb
72  * @param ref Particleset
73  *
74  * Copy the content of aLR
75  * References to ParticleSet or ParticleLayoutout_t are not copied.
76  */
78  : LRHandlerBase(aLR), FirstTime(true), Basis(aLR.Basis, ref.getLRBox())
79  {}
80 
81  LRHandlerBase* makeClone(ParticleSet& ref) const override
82  {
84  // tmp->makeSplines(1001);
85  return tmp;
86  }
87 
88  void initBreakup(ParticleSet& ref) override
89  {
90  InitBreakup(ref.getLRBox(), 1);
91  // fillYk(ref.getSimulationCell().getKLists());
92  fillYkg(ref.getSimulationCell().getKLists());
93  //This is expensive to calculate. Deprecating stresses for now.
94  //filldFk_dk(ref.getSimulationCell().getKLists());
95  LR_rc = Basis.get_rc();
96  }
97 
98  void Breakup(ParticleSet& ref, mRealType rs_ext) override
99  {
100  rs = rs_ext;
101  myFunc.reset(ref, rs);
102  InitBreakup(ref.getLRBox(), 1);
103  // fillYk(ref.getSimulationCell().getKLists());
104  fillYkg(ref.getSimulationCell().getKLists());
105  //This is expensive to calculate. Deprecating stresses for now.
106  //filldFk_dk(ref.getSimulationCell().getKLists());
107  LR_rc = Basis.get_rc();
108  }
109 
110  void resetTargetParticleSet(ParticleSet& ref) override { myFunc.reset(ref); }
111 
113 
114  inline mRealType evaluate(mRealType r, mRealType rinv) const override
115  {
116  //Right now LRHandlerSRCoulomb is the force only handler. This is why the gcoefs are used for evaluate.
117  mRealType v = Basis.f(r, gcoefs);
118  return v;
119  }
120 
121  inline mRealType evaluate_vlr_k(mRealType k) const override { return evalYk(k); }
122 
123  /** evaluate the first derivative of the short range part at r
124  *
125  * @param r radius
126  * @param rinv 1/r
127  */
128  inline mRealType srDf(mRealType r, mRealType rinv) const override
129  {
130  mRealType df = Basis.df_dr(r, gcoefs);
131  return df;
132  }
133 
134  inline mRealType srDf_strain(mRealType r, mRealType rinv) const
135  {
136  APP_ABORT("Stresses not supported yet\n");
137  mRealType df = Basis.df_dr(r, gstraincoefs);
138  return df;
139  }
140 
141  inline mRealType lrDf(mRealType r) const override
142  {
143  mRealType lr = myFunc.df(r) - srDf(r, 1.0 / r);
144  return lr;
145  }
146  /** evaluate the contribution from the long-range part for for spline
147  */
148  inline mRealType evaluateLR(mRealType r) const override
149  {
150  mRealType v = 0.0;
151  v = myFunc(r, 1.0 / r) - evaluate(r, 1.0 / r);
152  return v;
153  }
154 
155  inline mRealType evaluateSR_k0() const override
156  {
157  mRealType v0 = 0.0;
158  for (int n = 0; n < coefs.size(); n++)
159  v0 += coefs[n] * Basis.hintr2(n);
160  return v0 * 2.0 * TWOPI / Basis.get_CellVolume();
161  }
162 
163 
164  inline mRealType evaluateLR_r0() const override
165  {
166  //this is because the constraint v(r)=sigma(r) as r-->0.
167  // so v(r)-sigma(r)="0". Divergence prevents me from coding this.
168  mRealType v0 = 0.0;
169  return v0;
170  }
171 
172  //This returns the stress derivative of Fk, except for the explicit volume dependence. The explicit volume dependence is factored away into V.
174  pRealType kmag) const override
175  {
176  APP_ABORT("Stresses not supported yet\n");
177  SymTensor<mRealType, OHMMS_DIM> deriv_tensor = 0;
178  for (int dim1 = 0; dim1 < OHMMS_DIM; dim1++)
179  for (int dim2 = dim1; dim2 < OHMMS_DIM; dim2++)
180  {
181  deriv_tensor(dim1, dim2) =
182  -evaldYkgstrain(kmag) * k[dim1] * k[dim2] / kmag; //- evaldFk_dk(kmag)*k[dim1]*k[dim2]/kmag ;
183  if (dim1 == dim2)
184  deriv_tensor(dim1, dim2) -= evalYkgstrain(kmag); //+ derivconst;
185  }
186  return deriv_tensor;
187  }
188 
189 
191  pRealType rmag) const override
192  {
193  APP_ABORT("Stresses not supported yet\n");
194  SymTensor<mRealType, OHMMS_DIM> deriv_tensor = 0;
195 
196  mRealType Sr_r = srDf_strain(rmag, 1.0 / mRealType(rmag)) / mRealType(rmag);
197 
198  for (int dim1 = 0; dim1 < OHMMS_DIM; dim1++)
199  {
200  for (int dim2 = dim1; dim2 < OHMMS_DIM; dim2++)
201  deriv_tensor(dim1, dim2) = r[dim1] * r[dim2] * Sr_r;
202  }
203  return deriv_tensor;
204  }
205 
207  {
208  APP_ABORT("Stresses not supported yet\n");
209  mRealType v0 = 0.0;
210  mRealType norm = 2.0 * TWOPI / Basis.get_CellVolume();
211 
212  for (int n = 0; n < coefs.size(); n++)
213  v0 += gstraincoefs[n] * Basis.hintr2(n);
214 
215  v0 *= -norm;
217  for (int i = 0; i < OHMMS_DIM; i++)
218  stress(i, i) = v0;
219 
220  return stress;
221  }
222 
223  inline mRealType evaluateLR_r0_dstrain(int i, int j) const
224  {
225  APP_ABORT("Stresses not supported yet\n");
226  //the t derivative for the relevant basis elements are all zero because of constraints.
227  return 0.0; //Basis.f(0,dcoefs(i,j));
228  }
229 
231  {
232  APP_ABORT("Stresses not supported yet\n");
234  return stress;
235  }
236 
237 private:
238  inline mRealType evalYk(mRealType k) const
239  {
240  //FatK = 4.0*M_PI/(Basis.get_CellVolume()*k*k)* std::cos(k*Basis.get_rc());
241  mRealType FatK = myFunc.Vk(k) - Basis.fk(k, coefs);
242  // for(int n=0; n<Basis.NumBasisElem(); n++)
243  // FatK -= coefs[n]*Basis.c(n,k);
244  return FatK;
245  }
246  inline mRealType evalYkg(mRealType k) const
247  {
248  mRealType FatK = myFunc.Vk(k) - Basis.fk(k, gcoefs);
249  //for(int n=0; n<Basis.NumBasisElem(); n++)
250  // FatK -= gcoefs[n]*Basis.c(n,k);
251  return FatK;
252  }
254  {
255  APP_ABORT("Stresses not supported yet\n");
256  mRealType FatK = myFunc.Vk(k) - Basis.fk(k, gstraincoefs);
257  //for(int n=0; n<Basis.NumBasisElem(); n++)
258  // FatK -= gcoefs[n]*Basis.c(n,k);
259  return FatK;
260  }
261 
263  {
264  APP_ABORT("Stresses not supported yet\n");
265  mRealType dFk_dk = myFunc.dVk_dk(k) - Basis.dfk_dk(k, gstraincoefs);
266  // mRealType dFk_dk = myFunc.dVk_dk(k,Basis.get_rc()) - Basis.dfk_dk(k,coefs);
267  return dFk_dk;
268  }
269 
270  /** Initialise the basis and coefficients for the long-range beakup.
271  *
272  * We loocally create a breakup handler and pass in the basis
273  * that has been initialised here. We then discard the handler, leaving
274  * basis and coefs in a usable state.
275  * This method can be re-called later if lattice changes shape.
276  */
277  void InitBreakup(const ParticleLayout& ref, int NumFunctions)
278  {
279  //First we send the new Lattice to the Basis, in case it has been updated.
280  Basis.set_Lattice(ref);
281  //Compute RC from box-size - in constructor?
282  //No here...need update if box changes
283  int NumKnots(17);
284  Basis.set_NumKnots(NumKnots);
285  Basis.set_rc(ref.LR_rc);
286  //Initialise the breakup - pass in basis.
287  LRBreakup<BreakupBasis> breakuphandler(Basis);
288  //Find size of basis from cutoffs
289  mRealType kc = (LR_kc < 0) ? ref.LR_kc : LR_kc;
290  LR_kc = kc; // set internal kc
291  //mRealType kc(ref.LR_kc); //User cutoff parameter...
292  //kcut is the cutoff for switching to approximate k-point degeneracies for
293  //better performance in making the breakup. A good bet is 30*K-spacing so that
294  //there are 30 "boxes" in each direction that are treated with exact degeneracies.
295  //Assume orthorhombic cell just for deriving this cutoff - should be insensitive.
296  //K-Spacing = (kpt_vol)**1/3 = 2*pi/(cellvol**1/3)
297  mRealType kcut = 60 * M_PI * std::pow(Basis.get_CellVolume(), -1.0 / 3.0);
298  //Use 3000/LMax here...==6000/rc for non-ortho cells
299  mRealType kmax(6000.0 / ref.LR_rc);
300  MaxKshell = static_cast<int>(breakuphandler.SetupKVecs(kc, kcut, kmax));
301  if (FirstTime)
302  {
303  app_log() << "\nPerforming Optimized Breakup with Short Range Coulomb Basis\n";
304  app_log() << " finding kc: " << ref.LR_kc << " , " << LR_kc << std::endl;
305  app_log() << " LRBreakp parameter Kc =" << kc << std::endl;
306  app_log() << " Continuum approximation in k = [" << kcut << "," << kmax << ")" << std::endl;
307  FirstTime = false;
308  }
309  //Set up x_k
310  //This is the FT of -V(r) from r_c to infinity.
311  //This is the only data that the breakup handler needs to do the breakup.
312  //We temporarily store it in Fk, which is replaced with the full FT (0->inf)
313  //of V_l(r) after the breakup has been done.
314  fillVk(breakuphandler.KList);
315  //Allocate the space for the coefficients.
316  int Nbasis = Basis.NumBasisElem();
317  // coefs.resize(Nbasis); //This must be after SetupKVecs.
318  gcoefs.resize(Nbasis);
319  // gstraincoefs.resize(Nbasis);
320 
321  //Going to implement a smooth real space cutoff. This means that alpha=0,1,2 for the LPQHI basis at knot r_c
322  //all equal the 0, 1st, and 2nd derivatives of our bare function.
323  //These three functions are the last three basis elements in our set.
324 
325 
326  Vector<mRealType> constraints;
327 
328  constraints.resize(Nbasis);
329  for (int i = 0; i < Nbasis; i++)
330  constraints[i] = 1;
331 
332 
333  ///This is to make sure there's no cusp in the LR part.
334  // gstraincoefs[0]=gcoefs[0]=coefs[0] = 1.0;
335  gcoefs[0] = 1.0;
336  constraints[0] = 0;
337 
338  //gstraincoefs[1]=gcoefs[1] = coefs[1] = 0.0;
339  gcoefs[1] = 0.0;
340  constraints[1] = 0;
341 
342  //gstraincoefs[2]=gcoefs[2] = coefs[2] = 0.0;
343  gcoefs[2] = 0.0;
344  constraints[2] = 0.0;
345 
346  //Boundary conditions at r=rc
347  //
348  //2nd derivative continuity.
349  //gstraincoefs[Nbasis-1]= gcoefs[Nbasis-1]=coefs[Nbasis-1]=0.0;
350  gcoefs[Nbasis - 1] = 0.0;
351  constraints[Nbasis - 1] = 0;
352 
353  //1st derivative continuity
354 
355  //gstraincoefs[Nbasis-2]=gcoefs[Nbasis-2]=coefs[Nbasis-2]=0.0;
356  gcoefs[Nbasis - 2] = 0.0;
357  constraints[Nbasis - 2] = 0;
358 
359  //Function value continuity
360  //gstraincoefs[Nbasis-3]=gcoefs[Nbasis-3]=coefs[Nbasis-3]=0.0;
361  gcoefs[Nbasis - 3] = 0.0;
362  constraints[Nbasis - 3] = 0;
363  //And now to impose the constraints
364 
365 
366  Vector<mRealType> chisqr(3);
367  // breakuphandler.DoAllBreakup(chisqr.data(), Fk.data(), Fkgstrain.data(), coefs.data(), gcoefs.data(), gstraincoefs.data(), constraints.data());
368  mRealType chisqr_force = 0;
369  chisqr_force = breakuphandler.DoGradBreakup(Fkg.data(), gcoefs.data(), constraints.data());
370  //I want this in scientific notation, but I don't want to mess up formatting flags elsewhere.
371  //Save stream state.
372  std::ios_base::fmtflags app_log_flags(app_log().flags());
373  app_log() << std::scientific;
374  app_log().precision(5);
375 
376  // app_log()<<" LR function chi^2 = "<<chisqr[0]<< std::endl;
377  app_log() << " LR grad function chi^2 = " << chisqr_force << std::endl;
378  // app_log()<<" LR strain function chi^2 = "<<chisqr[2]<< std::endl;
379 
380  app_log().flags(app_log_flags);
381  }
382 
383 
384  void fillVk(std::vector<TinyVector<mRealType, 2>>& KList)
385  {
386  Fk.resize(KList.size());
387  Fkg.resize(KList.size());
388  // Fkgstrain.resize(KList.size());
389  // Fk_copy.resize(KList.size());
390  for (int ki = 0; ki < KList.size(); ki++)
391  {
392  mRealType k = KList[ki][0];
393  // Fk[ki] = myFunc.Vk(k); //Call derived fn.
394  Fkg[ki] = myFunc.Vk(k);
395  // Fkgstrain[ki] = myFunc.dVk_dk(k);
396  // Fk_copy[ki]=myFunc.Vk(k);
397  }
398  }
399 
400  void fillYk(KContainer& KList)
401  {
402  Fk.resize(KList.kpts_cart.size());
403  const std::vector<int>& kshell(KList.kshell);
404  if (MaxKshell >= kshell.size())
405  MaxKshell = kshell.size() - 1;
407  for (int ks = 0, ki = 0; ks < Fk_symm.size(); ks++)
408  {
409  mRealType uk = evalYk(std::sqrt(KList.ksq[ki]));
410  Fk_symm[ks] = uk;
411  while (ki < KList.kshell[ks + 1] && ki < Fk.size())
412  Fk[ki++] = uk;
413  }
414  //for(int ki=0; ki<KList.kpts_cart.size(); ki++){
415  // mRealType k=dot(KList.kpts_cart[ki],KList.kpts_cart[ki]);
416  // k=std::sqrt(k);
417  // Fk[ki] = evalFk(k); //Call derived fn.
418  //}
419  }
420  void fillYkg(const KContainer& KList)
421  {
422  Fkg.resize(KList.kpts_cart.size());
423  //LRHandlerSRCoulomb is the force handler now. Only want
424  //Fourier coefficients optimized for forces being used period.
425 
426  Fk.resize(KList.kpts_cart.size());
427  const std::vector<int>& kshell(KList.kshell);
428  if (MaxKshell >= kshell.size())
429  MaxKshell = kshell.size() - 1;
430 
431  for (int ks = 0, ki = 0; ks < MaxKshell; ks++)
432  {
433  mRealType uk = evalYkg(std::sqrt(KList.ksq[ki]));
434 
435  while (ki < KList.kshell[ks + 1] && ki < Fkg.size())
436  Fkg[ki++] = uk;
437  }
438  //Have to set this, because evaluate and evaluateGrad for LR piece uses
439  //diferent fourier components. Only want to use the ones optimized for
440  //forces.
441  Fk = Fkg;
442  }
443 
445  {
446  APP_ABORT("Stresses not supported yet\n");
447  Fkgstrain.resize(KList.kpts_cart.size());
448  const std::vector<int>& kshell(KList.kshell);
449  if (MaxKshell >= kshell.size())
450  MaxKshell = kshell.size() - 1;
451  for (int ks = 0, ki = 0; ks < MaxKshell; ks++)
452  {
453  mRealType uk = evalYkgstrain(std::sqrt(KList.ksq[ki]));
454  while (ki < KList.kshell[ks + 1] && ki < Fkgstrain.size())
455  Fkgstrain[ki++] = uk;
456  }
457  }
458  void filldFk_dk(KContainer& KList)
459  {
460  APP_ABORT("Stresses not supported yet\n");
461  dFk_dstrain.resize(KList.kpts_cart.size());
462 
463  for (int ki = 0; ki < dFk_dstrain.size(); ki++)
464  dFk_dstrain[ki] = evaluateLR_dstrain(KList.kpts_cart[ki], std::sqrt(KList.ksq[ki]));
465  }
466 };
467 } // namespace qmcplusplus
468 #endif
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
a class that defines a supercell in D-dimensional Euclean space.
mRealType evaluate_vlr_k(mRealType k) const override
const auto & getLRBox() const
Definition: ParticleSet.h:253
std::vector< PosType > kpts_cart
K-vector in Cartesian coordinates.
Definition: KContainer.h:53
Fixed-size array.
Definition: OhmmsTinyMeta.h:30
One-Dimensional linear-grid.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
mRealType evaluateLR_r0_dstrain(int i, int j) const
void fillVk(std::vector< TinyVector< mRealType, 2 >> &KList)
mRealType LR_kc
Maximum k cutoff.
Definition: LRHandlerBase.h:37
std::ostream & app_log()
Definition: OutputManager.h:65
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > ParticleLayout
Definition: Configuration.h:79
int SetupKVecs(mRealType kc, mRealType kcont, mRealType kmax)
setup KList
Definition: LRBreakup.h:333
DECLARE_COULOMB_TYPES int MaxKshell
Maxkimum Kshell for the given Kc.
Definition: LRHandlerBase.h:35
mRealType DoGradBreakup(mRealType *Fk, mRealType *t, mRealType *adjust)
Definition: LRBreakup.h:557
EwaldHandler3D::mRealType mRealType
SymTensor< mRealType, OHMMS_DIM > evaluateLR_r0_dstrain() const override
These functions return the strain derivatives of all corresponding quantities in total energy...
Vector< mRealType > Fkgstrain
Vector of df_k/dk, fit as to optimize strains.
Definition: LRHandlerBase.h:47
void filldFk_dk(KContainer &KList)
mRealType evalYk(mRealType k) const
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
Definition: LRHandlerBase.h:53
LRHandlerBase * makeClone(ParticleSet &ref) const override
make clone
LRHandlerSRCoulomb(ParticleSet &ref, mRealType kc_in=-1.0)
void resetTargetParticleSet(ParticleSet &ref, mRealType rs)
mRealType evaluateSR_k0() const override
evaluate
#define OHMMS_DIM
Definition: config.h:64
void initBreakup(ParticleSet &ref) override
std::vector< SymTensor< mRealType, OHMMS_DIM > > dFk_dstrain
Fourier component of the LR part of strain tensor, by optimized breakup.
Definition: LRHandlerBase.h:45
mRealType lrDf(mRealType r) const override
MakeReturn< BinaryNode< FnPow, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t, typename CreateLeaf< Vector< T2, C2 > >::Leaf_t > >::Expression_t pow(const Vector< T1, C1 > &l, const Vector< T2, C2 > &r)
const auto & getSimulationCell() const
Definition: ParticleSet.h:250
Decalaration of One-Dimesional grids.
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
mRealType srDf(mRealType r, mRealType rinv) const override
evaluate the first derivative of the short range part at r
size_type size() const
return the current size
Definition: OhmmsVector.h:162
qmcplusplus::LRHandlerBase::pRealType pRealType
SymTensor< mRealType, OHMMS_DIM > evaluateLR_dstrain(TinyVector< pRealType, OHMMS_DIM > k, pRealType kmag) const override
double norm(const zVec &c)
Definition: VectorOps.h:118
std::vector< mRealType > Fk_copy
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39
void InitBreakup(const ParticleLayout &ref, int NumFunctions)
Initialise the basis and coefficients for the long-range beakup.
Vector< mRealType > Fkg
Fourier component of the LR part, fit to optimize the gradients.
Definition: LRHandlerBase.h:43
mRealType srDf_strain(mRealType r, mRealType rinv) const
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27
mRealType evaldYkgstrain(mRealType k) const
SymTensor< mRealType, OHMMS_DIM > evaluateSR_k0_dstrain() const override
void Breakup(ParticleSet &ref, mRealType rs_ext) override
Container for k-points.
Definition: KContainer.h:29
std::vector< int > kshell
kpts which belong to the ith-shell [kshell[i], kshell[i+1])
Definition: KContainer.h:61
Vector< mRealType > Fk
Fourier component for all the k-point.
Definition: LRHandlerBase.h:41
std::vector< mRealType > gcoefs
Coefficient for gradient fit.
Definition: LRHandlerBase.h:55
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
std::vector< RealType > ksq
squre of kpts in Cartesian coordniates
Definition: KContainer.h:56
mRealType evalYkg(mRealType k) const
mRealType evaluateLR(mRealType r) const override
evaluate the contribution from the long-range part for for spline
SymTensor< mRealType, OHMMS_DIM > evaluateSR_dstrain(TinyVector< pRealType, OHMMS_DIM > r, pRealType rmag) const override
void fillYk(KContainer &KList)
std::vector< mRealType > gstraincoefs
Coefficient for strain fit.
Definition: LRHandlerBase.h:57
void fillYkgstrain(KContainer &KList)
void resetTargetParticleSet(ParticleSet &ref) override
base class for LRHandlerTemp<FUNC,BASIS> and DummyLRHanlder<typename Func>
Definition: LRHandlerBase.h:30
void fillYkg(const KContainer &KList)
std::vector< TinyVector< mRealType, 2 > > KList
For each k, KList[k][0] = |k| and KList[k][1] = degeneracy.
Definition: LRBreakup.h:44
mRealType evaluate(mRealType r, mRealType rinv) const override
Define LRHandlerBase and DummyLRHandler<typename Func>
LRHandlerSRCoulomb(const LRHandlerSRCoulomb &aLR, ParticleSet &ref)
"copy" constructor
Vector< mRealType > Fk_symm
Fourier component for each k-shell.
Definition: LRHandlerBase.h:49
mRealType evalYkgstrain(mRealType k) const
mRealType evaluateLR_r0() const override
evaluate for the self-interaction term