QMCPACK
NonLocalTOperator.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: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
8 // Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
9 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
10 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
11 //
12 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
13 //////////////////////////////////////////////////////////////////////////////////////
14 
15 
16 /**@file NonLocalTOperator.h
17  * @brief Declaration of NonLocalTOperator
18  *
19  * NonLocalTOperator has the off-diagonal transition probability matrix.
20  */
21 #ifndef QMCPLUSPLUS_NONLOCALTRANSITIONOPERATOR_H
22 #define QMCPLUSPLUS_NONLOCALTRANSITIONOPERATOR_H
23 
24 #include "NonLocalData.h"
25 
26 namespace qmcplusplus
27 {
28 /// Tmove options
29 enum
30 {
31  TMOVE_OFF = 0, // no Tmove
32  TMOVE_V0, // M. Casula, PRB 74, 161102(R) (2006)
33  TMOVE_V1, // version 1, M. Casula et al., JCP 132, 154113 (2010)
34  TMOVE_V3, // an approximation to version 1 but much faster.
35 };
36 
38 {
41 
43 
44  /** replacement for put because wouldn't it be cool to know what the classes configuration actually
45  * is.
46  */
47  int thingsThatShouldBeInMyConstructor(const std::string& non_local_move_option,
48  const double tau,
49  const double alpha,
50  const double gamma);
51  /** initialize the parameters */
52  int put(xmlNodePtr cur);
53 
54  /** select the move for a given probability
55  * @param prob value [0,1)
56  * @param txy a given Txy collection
57  * @return pointer to NonLocalData
58  */
59  const NonLocalData* selectMove(RealType prob, const std::vector<NonLocalData>& txy);
60 
61  /** select the move for a given probability using internal txy_by_elec_
62  * @param prob value [0,1)
63  * @param iel reference electron
64  * @return pointer to NonLocalData
65  */
66  inline const NonLocalData* selectMove(RealType prob, int iel) { return selectMove(prob, txy_by_elec_[iel]); }
67 
68  /** sort all the Txy elements by electron */
69  void groupByElectron(size_t num_elec, const std::vector<NonLocalData>& txy);
70 
71 private:
75  /// factor applied on >0 weight
77  /// factor applied on <=0 weight
79  // for selecting a move
80  std::vector<RealType> txy_scan_;
81  // txy grouped by electron id
82  std::vector<std::vector<NonLocalData>> txy_by_elec_;
83 };
84 
85 } // namespace qmcplusplus
86 #endif
void groupByElectron(size_t num_elec, const std::vector< NonLocalData > &txy)
sort all the Txy elements by electron
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QTBase::RealType RealType
Definition: Configuration.h:58
int thingsThatShouldBeInMyConstructor(const std::string &non_local_move_option, const double tau, const double alpha, const double gamma)
replacement for put because wouldn&#39;t it be cool to know what the classes configuration actually is...
std::vector< std::vector< NonLocalData > > txy_by_elec_
NonLocalData::RealType RealType
int put(xmlNodePtr cur)
initialize the parameters
QTBase::PosType PosType
Definition: Configuration.h:61
const NonLocalData * selectMove(RealType prob, int iel)
select the move for a given probability using internal txy_by_elec_
std::vector< RealType > txy_scan_
const NonLocalData * selectMove(RealType prob, const std::vector< NonLocalData > &txy)
select the move for a given probability
RealType plusFactor
factor applied on >0 weight
RealType minusFactor
factor applied on <=0 weight