QMCPACK
QMCFiniteSize.h
Go to the documentation of this file.
1 #ifndef QMC_FINITE_SIZE_H
2 #define QMC_FINITE_SIZE_H
3 
4 #include "QMCApp/QMCAppBase.h"
8 #include "einspline/bspline_structs.h"
9 
10 namespace qmcplusplus
11 {
12 /** Class to handle FS corrections
13  *
14  * Implements finite size corrections from Holzmann et al., PRB (2016)
15  * Currently implements Eqn. (30), using a long-rang break up of the
16  * Coulomb interaction and a spline representation of S(k).
17  * S(k) is obtained from SkParserBase
18  */
20 {
21 public:
30  QMCFiniteSize();
31  QMCFiniteSize(SkParserBase* skparser_i);
33 
34 
35  inline void setSkParser(SkParserBase* skparser_i) { skparser = skparser_i; };
36  bool validateXML() override;
37  bool execute() override;
38 
40  void getSkInfo(UBspline_3d_d* spline, std::vector<RealType>& symmatelem);
41  UBspline_3d_d* getSkSpline(std::vector<RealType> sk, RealType limit = 1.0);
42  RealType sphericalAvgSk(UBspline_3d_d* spline, RealType k);
43 
44  RealType integrate_spline(UBspline_1d_d* spline, RealType a, RealType b, IndexType N);
45  UBspline_1d_d* spline_clamped(std::vector<RealType>& grid, std::vector<RealType>& vals, RealType lVal, RealType rVal);
46 
47  void initialize();
50  void summary();
51  RealType calcPotentialDiscrete(std::vector<RealType> sk);
52  RealType calcPotentialInt(std::vector<RealType> sk);
53 
54 private:
60  RealType h; //this is for finite differencing.
61  std::vector<PosType> sphericalgrid;
62  std::unique_ptr<LRHandlerType> AA;
63  std::unique_ptr<RadFunctorType> rVs;
64  bool processPWH(xmlNodePtr cur);
65  void wfnPut(xmlNodePtr cur);
66  void initBreakup();
70  void printSkRawSphAvg(const std::vector<RealType>& sk);
71  void printSkSplineSphAvg(UBspline_3d_d* spline);
73  std::vector<TinyVector<int, OHMMS_DIM>> kpts;
74  std::vector<RealType> SK_raw;
75  std::vector<RealType> SKerr_raw;
76  std::vector<RealType> SK;
77  std::vector<RealType> SKerr;
83 };
84 } // namespace qmcplusplus
85 
86 #endif
std::unique_ptr< LRHandlerType > AA
Definition: QMCFiniteSize.h:62
std::vector< TinyVector< int, OHMMS_DIM > > kpts
Definition: QMCFiniteSize.h:73
Fixed-size array.
Definition: OhmmsTinyMeta.h:30
LRHandlerType::mRealType mRealType
Definition: QMCFiniteSize.h:25
bool validateXML() override
validate the input file
One-Dimensional linear-grid.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
RealType integrate_spline(UBspline_1d_d *spline, RealType a, RealType b, IndexType N)
QTBase::RealType RealType
Definition: Configuration.h:58
QMCTraits::RealType RealType
Definition: QMCFiniteSize.h:27
UBspline_3d_d * getSkSpline(std::vector< RealType > sk, RealType limit=1.0)
std::vector< RealType > SKerr
Definition: QMCFiniteSize.h:77
EwaldHandler3D::mRealType mRealType
void build_spherical_grid(IndexType mtheta, IndexType mphi)
QMCTraits::IndexType IndexType
Definition: FSUtilities.h:11
RealType sphericalAvgSk(UBspline_3d_d *spline, RealType k)
void wfnPut(xmlNodePtr cur)
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
void setSkParser(SkParserBase *skparser_i)
Definition: QMCFiniteSize.h:35
RealType calcPotentialInt(std::vector< RealType > sk)
void printSkRawSphAvg(const std::vector< RealType > &sk)
Manage a collection of ParticleSet objects.
void getSkInfo(UBspline_3d_d *spline, std::vector< RealType > &symmatelem)
OneDimCubicSpline< pRealType > RadFunctorType
QTBase::PosType PosType
Definition: Configuration.h:61
std::vector< PosType > sphericalgrid
Definition: QMCFiniteSize.h:61
OHMMS_INDEXTYPE IndexType
define other types
Definition: Configuration.h:65
Container for k-points.
Definition: KContainer.h:29
ParticleSetPool ptclPool
Definition: QMCFiniteSize.h:56
std::vector< RealType > SK
Definition: QMCFiniteSize.h:76
LinearGrid< RealType > Grid_t
Definition: SkParserBase.h:22
bool processPWH(xmlNodePtr cur)
void printSkSplineSphAvg(UBspline_3d_d *spline)
UBspline_1d_d * spline_clamped(std::vector< RealType > &grid, std::vector< RealType > &vals, RealType lVal, RealType rVal)
std::unique_ptr< RadFunctorType > rVs
Definition: QMCFiniteSize.h:63
Define a LRHandler with two template parameters.
base class for LRHandlerTemp<FUNC,BASIS> and DummyLRHanlder<typename Func>
Definition: LRHandlerBase.h:30
std::vector< RealType > SK_raw
Definition: QMCFiniteSize.h:74
QTFull::RealType FullPrecRealType
Definition: Configuration.h:66
LinearGrid< pRealType > GridType
traits for QMC variables
Definition: Configuration.h:49
bool execute() override
execute the main function
Class to handle FS corrections.
Definition: QMCFiniteSize.h:19
Base class for QMC applications and utilities.
Definition: QMCAppBase.h:34
std::vector< RealType > SKerr_raw
Definition: QMCFiniteSize.h:75
Declaration of ParticleSetPool.
Base class for Sk parser.
Definition: SkParserBase.h:19
RealType calcPotentialDiscrete(std::vector< RealType > sk)